Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb simplify.



details:   https://anonhg.NetBSD.org/src/rev/de16dfa60726
branches:  trunk
changeset: 364614:de16dfa60726
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 31 17:43:50 2022 +0000

description:
simplify.

diffstat:

 sys/dev/usb/uhid.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (46 lines):

diff -r 09b3a7786b6a -r de16dfa60726 sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c        Thu Mar 31 07:59:05 2022 +0000
+++ b/sys/dev/usb/uhid.c        Thu Mar 31 17:43:50 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhid.c,v 1.124 2022/03/29 06:59:19 riastradh Exp $     */
+/*     $NetBSD: uhid.c,v 1.125 2022/03/31 17:43:50 christos Exp $      */
 
 /*
  * Copyright (c) 1998, 2004, 2008, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.124 2022/03/29 06:59:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.125 2022/03/31 17:43:50 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -753,7 +753,6 @@
 uhidkqfilter(dev_t dev, struct knote *kn)
 {
        struct uhid_softc *sc = device_lookup_private(&uhid_cd, UHIDUNIT(dev));
-       int error = 0;
 
        switch (kn->kn_filter) {
        case EVFILT_READ:
@@ -762,16 +761,13 @@
                mutex_enter(&sc->sc_lock);
                selrecord_knote(&sc->sc_rsel, kn);
                mutex_exit(&sc->sc_lock);
-               break;
+               return 0;
 
        case EVFILT_WRITE:
                kn->kn_fop = &seltrue_filtops;
-               break;
+               return 0;
 
        default:
-               error = EINVAL;
-               break;
+               return EINVAL;
        }
-
-       return error;
 }



Home | Main Index | Thread Index | Old Index