Bug 229790 - src/sys/mips/ingenic/jz4780_timer.c:187: strange bitmask ?
Summary: src/sys/mips/ingenic/jz4780_timer.c:187: strange bitmask ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Oleksandr Tymoshenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-15 17:43 UTC by David Binderman
Modified: 2019-02-03 08:53 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2018-07-15 17:43:06 UTC
Source code is

        CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 |
            TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST3);

Maybe better code:

        CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 |
            TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST7);
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-01-25 20:03:58 UTC
A commit references this bug:

Author: gonzo
Date: Fri Jan 25 20:02:56 UTC 2019
New revision: 343448
URL: https://svnweb.freebsd.org/changeset/base/343448

Log:
  [mips] Fix counter mask in jz4780 timer driver

  Fix dublicate value in what is apparent copypaste mistake. The last value
  in mask is supposed to be for counter 7, not counter 3.

  PR:		229790
  Submitted by:	David Binderman <dcb314@hotmail.com>
  MFC after:	1 week

Changes:
  head/sys/mips/ingenic/jz4780_timer.c
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-25 20:11:18 UTC
Fix committed, thanks for reporting.
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-02-03 08:53:45 UTC
A commit references this bug:

Author: gonzo
Date: Sun Feb  3 08:53:04 UTC 2019
New revision: 343709
URL: https://svnweb.freebsd.org/changeset/base/343709

Log:
  MFC r343443, r343446, r343448, r343452

  r343443:
  [mips] remove dublicate values in enable mask in nlm_usb_intr_en

  PR:		230572
  Submitted by:	David Binderman <dcb314@hotmail.com>

  r343446:
  [mips] remove check that is always false (unsinged < 0)

  cpuid and local cpu variable are unsigned so checking if value is less than zero
  always yields false.

  PR:		211088
  Submitted by:	David Binderman <dcb314@hotmail.com>

  r343448:
  [mips] Fix counter mask in jz4780 timer driver

  Fix dublicate value in what is apparent copypaste mistake. The last value
  in mask is supposed to be for counter 7, not counter 3.

  PR:		229790
  Submitted by:	David Binderman <dcb314@hotmail.com>

  r343452:
  [mips] Fix error condition check that always evaluates to false

  Use proper logical operand when checking the value of srcid

  PR:		200988
  Submitted by:	David Binderman <dcb314@hotmail.com>

Changes:
_U  stable/12/
  stable/12/sys/mips/ingenic/jz4780_timer.c
  stable/12/sys/mips/mips/tlb.c
  stable/12/sys/mips/nlm/cms.c
  stable/12/sys/mips/nlm/usb_init.c