Module Name:    src
Committed By:   jakllsch
Date:           Wed Jan 10 15:58:40 UTC 2018

Modified Files:
        src/sys/dev: led.c

Log Message:
Use correct type with CTLTYPE_BOOL.

Fixes this sysctl on big endian.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/led.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/dev/led.c
diff -u src/sys/dev/led.c:1.2 src/sys/dev/led.c:1.3
--- src/sys/dev/led.c:1.2	Sat Jul  8 19:25:37 2017
+++ src/sys/dev/led.c	Wed Jan 10 15:58:40 2018
@@ -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 <[email protected]>
@@ -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 @@ led_sysctl_handler(SYSCTLFN_ARGS)
 {
 	struct sysctlnode node;
 	struct led_device *led;
-	int error, state;
+	int error;
+	bool state;
 
 	mutex_enter(&led_lock);
 
@@ -114,11 +115,6 @@ led_sysctl_handler(SYSCTLFN_ARGS)
 		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);

Reply via email to