Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Use correct type with CTLTYPE_BOOL.



details:   https://anonhg.NetBSD.org/src/rev/9db6f81755c7
branches:  trunk
changeset: 828936:9db6f81755c7
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Jan 10 15:58:40 2018 +0000

description:
Use correct type with CTLTYPE_BOOL.

Fixes this sysctl on big endian.

diffstat:

 sys/dev/led.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 49bf1f148396 -r 9db6f81755c7 sys/dev/led.c
--- a/sys/dev/led.c     Wed Jan 10 12:18:22 2018 +0000
+++ b/sys/dev/led.c     Wed Jan 10 15:58:40 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: led.c,v 1.2 2017/07/08 19:25:37 jmcneill Exp $ */
+/* $NetBSD: led.c,v 1.3 2018/01/10 15:58:40 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.2 2017/07/08 19:25:37 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.3 2018/01/10 15:58:40 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -100,7 +100,8 @@
 {
        struct sysctlnode node;
        struct led_device *led;
-       int error, state;
+       int error;
+       bool state;
 
        mutex_enter(&led_lock);
 
@@ -114,11 +115,6 @@
                return error;
        }
 
-       if (state < LED_STATE_OFF || state > LED_STATE_ON) {
-               mutex_exit(&led_lock);
-               return EINVAL;
-       }
-
        led->setstate(led->priv, state);
 
        mutex_exit(&led_lock);



Home | Main Index | Thread Index | Old Index