Module Name:    src
Committed By:   christos
Date:           Mon Feb 29 18:24:31 UTC 2016

Modified Files:
        src/sys/arch/evbmips/loongson/dev: stvii.c

Log Message:
PR/50869: David Binderman: Use logical and instead of arithmetic


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/loongson/dev/stvii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/loongson/dev/stvii.c
diff -u src/sys/arch/evbmips/loongson/dev/stvii.c:1.4 src/sys/arch/evbmips/loongson/dev/stvii.c:1.5
--- src/sys/arch/evbmips/loongson/dev/stvii.c:1.4	Thu Feb 28 08:21:15 2013
+++ src/sys/arch/evbmips/loongson/dev/stvii.c	Mon Feb 29 13:24:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: stvii.c,v 1.4 2013/02/28 13:21:15 macallan Exp $	*/
+/*	$NetBSD: stvii.c,v 1.5 2016/02/29 18:24:31 christos Exp $	*/
 
 /*-
  * Copyright (C) 2011 Michael Lorenz.
@@ -30,7 +30,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stvii.c,v 1.4 2013/02/28 13:21:15 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stvii.c,v 1.5 2016/02/29 18:24:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -303,10 +303,10 @@ stvii_worker(void *cookie)
 			nctrl = sc->sc_control & ~(STC_TRICKLE | STC_CHARGE_ENABLE);
 			bl = stvii_battery_level(sc);
 			sc->sc_bat_level = bl;
-			if (charging & (bl > BAT_FULL)) {
+			if (charging && (bl > BAT_FULL)) {
 				/* stop charging, we're full */
 				charging = 0;
-			} else if (!charging & (bl < BAT_LOW)) {
+			} else if (!charging && (bl < BAT_LOW)) {
 				charging = 1;
 			}
 			if (st & STS_AC_AVAILABLE) {

Reply via email to