Bug 211088 - sys/mips/mips/tlb.c:356: pointless test ?
Summary: sys/mips/mips/tlb.c:356: pointless test ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Oleksandr Tymoshenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-13 18:04 UTC by David Binderman
Modified: 2019-02-03 08:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2016-07-13 18:04:47 UTC
sys/mips/mips/tlb.c:356]: (style) Checking if unsigned variable 'cpu' is less than zero.

Source code is

   if (cpu < 0 || cpu >= mp_ncpus) {
Comment 1 commit-hook freebsd_committer 2019-01-25 19:59:48 UTC
A commit references this bug:

Author: gonzo
Date: Fri Jan 25 19:58:57 UTC 2019
New revision: 343446
URL: https://svnweb.freebsd.org/changeset/base/343446

Log:
  [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>
  MFC after:	1 week

Changes:
  head/sys/mips/mips/tlb.c
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-25 20:11:27 UTC
Fix committed, thanks for reporting.
Comment 3 commit-hook freebsd_committer 2019-02-03 08:53:43 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