Bug 200988 - sys/mips/nlm/cms.c:205: bad if statement ?
Summary: sys/mips/nlm/cms.c:205: bad if statement ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Oleksandr Tymoshenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-20 08:44 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 2015-06-20 08:44:07 UTC
sys/mips/nlm/cms.c:205]: (warning) Logical conjunction always evaluates to false: srcid < 0 && srcid >= 1024.

    if (srcid < 0 && srcid >= 1024) {

Maybe

    if (srcid < 0 || srcid >= 1024) {
Comment 1 David Binderman 2018-07-05 20:33:54 UTC
Still broken three years later.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-01-25 20:15:13 UTC
A commit references this bug:

Author: gonzo
Date: Fri Jan 25 20:14:29 UTC 2019
New revision: 343452
URL: https://svnweb.freebsd.org/changeset/base/343452

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

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