NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/54812: src/sys/dev/i2c/cx24227.c: 2 * Suspicious condition



>Number:         54812
>Category:       kern
>Synopsis:       src/sys/dev/i2c/cx24227.c: 2 * Suspicious condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 31 08:35:00 +0000 2019
>Originator:     David Binderman
>Release:        cvs-20191230
>Organization:
>Environment:
>Description:

1.

src/sys/dev/i2c/cx24227.c:111:5: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition]

Source code is

    if ((error = iic_acquire_bus(sc->tag, 0) != 0))
        return error;

Maybe better source code

    if ((error = iic_acquire_bus(sc->tag, 0)) != 0)
        return error;


2.    

src/sys/dev/i2c/cx24227.c:133:5: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition]

Duplicate.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index