Bug 210709

Summary: freebsd/sys/dev/pcf/pcf_isa.c:112]: (style) Suspicious condition
Product: Base System Reporter: David Binderman <dcb314>
Component: kernAssignee: Andriy Voskoboinyk <avos>
Status: Closed FIXED    
Severity: Affects Some People CC: avos, emaste
Priority: --- Keywords: patch
Version: CURRENTFlags: avos: mfc-stable12+
avos: mfc-stable11+
avos: mfc-stable10+
Hardware: Any   
OS: Any   

Description David Binderman 2016-06-29 19:44:55 UTC
freebsd/sys/dev/pcf/pcf_isa.c:112]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

    if ((error = resource_int_value(PCF_NAME, 0, "port", &port) != 0))
        return (error);

Maybe better code

    if ((error = resource_int_value(PCF_NAME, 0, "port", &port)) != 0)
        return error;
Comment 1 David Binderman 2018-07-05 20:20:31 UTC
Still broken a couple of years later.
Comment 2 Andriy Voskoboinyk freebsd_committer freebsd_triage 2019-01-26 16:13:24 UTC
*** Bug 210708 has been marked as a duplicate of this bug. ***
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-01-27 15:19:54 UTC
A commit references this bug:

Author: avos
Date: Sun Jan 27 15:19:29 UTC 2019
New revision: 343496
URL: https://svnweb.freebsd.org/changeset/base/343496

Log:
  pcf(4): fix parentheses in if condition

  PR:		210709
  Submitted by:	David Binderman <dcb314@hotmail.com>
  MFC after:	5 days

Changes:
  head/sys/dev/pcf/pcf_isa.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-02-01 03:26:50 UTC
A commit references this bug:

Author: avos
Date: Fri Feb  1 03:26:11 UTC 2019
New revision: 343643
URL: https://svnweb.freebsd.org/changeset/base/343643

Log:
  MFC r343496:
  pcf(4): fix parentheses in if condition

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

Changes:
_U  stable/10/
  stable/10/sys/dev/pcf/pcf_isa.c
_U  stable/11/
  stable/11/sys/dev/pcf/pcf_isa.c
_U  stable/12/
  stable/12/sys/dev/pcf/pcf_isa.c