NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-evbmips/50869: src/sys/arch/evbmips/loongson/dev/stvii.c:309: weird coding ?
>Number: 50869
>Category: port-evbmips
>Synopsis: src/sys/arch/evbmips/loongson/dev/stvii.c:309: weird coding ?
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-evbmips-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 29 17:40:00 +0000 2016
>Originator: David Binderman
>Release: cvs dated 20160229
>Organization:
>Environment:
>Description:
src/sys/arch/evbmips/loongson/dev/stvii.c:309]: (style) Boolean result is used in bitwise operation. Clarify expression with parentheses.
Source code is
if (charging & (bl > BAT_FULL)) {
/* stop charging, we're full */
charging = 0;
} else if (!charging & (bl < BAT_LOW)) {
charging = 1;
}
Looks weird. Did someone muxup & and && ?
>How-To-Repeat:
>Fix:
Home |
Main Index |
Thread Index |
Old Index