Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Reduce always true comparison in malo_cmd_set_txp...



details:   https://anonhg.NetBSD.org/src/rev/c44a0bdf956f
branches:  trunk
changeset: 454575:c44a0bdf956f
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun Sep 22 09:03:07 2019 +0000

description:
Reduce always true comparison in malo_cmd_set_txpower()

powerlevel is already checked for >=30 in the previous condition.

Found by the lgtm bot.

diffstat:

 sys/dev/ic/malo.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 294bf6709cbc -r c44a0bdf956f sys/dev/ic/malo.c
--- a/sys/dev/ic/malo.c Sun Sep 22 08:21:35 2019 +0000
+++ b/sys/dev/ic/malo.c Sun Sep 22 09:03:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: malo.c,v 1.15 2018/12/14 21:23:43 jakllsch Exp $ */
+/*     $NetBSD: malo.c,v 1.16 2019/09/22 09:03:07 kamil Exp $ */
 /*     $OpenBSD: malo.c,v 1.92 2010/08/27 17:08:00 jsg Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: malo.c,v 1.15 2018/12/14 21:23:43 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: malo.c,v 1.16 2019/09/22 09:03:07 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -2156,7 +2156,7 @@
        body->action = htole16(1);
        if (powerlevel < 30)
                body->supportpowerlvl = htole16(5);     /* LOW */
-       else if (powerlevel >= 30 && powerlevel < 60)
+       else if (powerlevel < 60)
                body->supportpowerlvl = htole16(10);    /* MEDIUM */
        else
                body->supportpowerlvl = htole16(15);    /* HIGH */



Home | Main Index | Thread Index | Old Index