Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons wsdisplay(4): KNF: return foo, not return (foo)
details: https://anonhg.NetBSD.org/src/rev/008ab7381a6a
branches: trunk
changeset: 368525:008ab7381a6a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Jul 17 11:43:39 2022 +0000
description:
wsdisplay(4): KNF: return foo, not return (foo)
No functional change intended.
diffstat:
sys/dev/wscons/wsdisplay.c | 316 +++++++++++++++++++-------------------
sys/dev/wscons/wsdisplay_vcons.c | 12 +-
2 files changed, 164 insertions(+), 164 deletions(-)
diffs (truncated from 1077 to 300 lines):
diff -r 6d3101f939b0 -r 008ab7381a6a sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c Sun Jul 17 11:43:11 2022 +0000
+++ b/sys/dev/wscons/wsdisplay.c Sun Jul 17 11:43:39 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.165 2022/07/17 11:43:39 riastradh Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.165 2022/07/17 11:43:39 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_wsdisplay_compat.h"
@@ -339,7 +339,7 @@
if (dconf->wsemul == NULL) {
free(dconf, M_DEVBUF);
free(scr, M_DEVBUF);
- return (NULL);
+ return NULL;
}
dconf->wsemulcookie =
(*dconf->wsemul->attach)(0, type, cookie,
@@ -370,7 +370,7 @@
if (console)
callout_schedule(&scr->scr_getc_ch, mstohz(10));
#endif
- return (scr);
+ return scr;
}
static void
@@ -405,15 +405,15 @@
KASSERT(scrdata->nscreens > 0);
if (name == NULL)
- return (scrdata->screens[0]);
+ return scrdata->screens[0];
for (i = 0; i < scrdata->nscreens; i++) {
scr = scrdata->screens[i];
if (!strcmp(name, scr->name))
- return (scr);
+ return scr;
}
- return (0);
+ return 0;
}
/*
@@ -447,12 +447,12 @@
int s;
if (idx < 0 || idx >= WSDISPLAY_MAXSCREEN)
- return (EINVAL);
+ return EINVAL;
if (sc->sc_scr[idx] != NULL)
- return (EBUSY);
+ return EBUSY;
scrdesc = wsdisplay_screentype_pick(sc->sc_scrdata, screentype);
if (!scrdesc)
- return (ENXIO);
+ return ENXIO;
/*
* if this screen can resize we need to copy the descr so each screen
@@ -469,14 +469,14 @@
error = (*sc->sc_accessops->alloc_screen)(sc->sc_accesscookie,
scrdesc, &cookie, &ccol, &crow, &defattr);
if (error)
- return (error);
+ return error;
scr = wsscreen_attach(sc, 0, emul, scrdesc,
cookie, ccol, crow, defattr);
if (scr == NULL) {
(*sc->sc_accessops->free_screen)(sc->sc_accesscookie,
cookie);
- return (ENXIO);
+ return ENXIO;
}
sc->sc_scr[idx] = scr;
@@ -491,7 +491,7 @@
sc->sc_focus = scr;
}
splx(s);
- return (0);
+ return 0;
}
static void
@@ -560,14 +560,14 @@
void *cookie;
if (idx < 0 || idx >= WSDISPLAY_MAXSCREEN)
- return (EINVAL);
+ return EINVAL;
if ((scr = sc->sc_scr[idx]) == NULL)
- return (ENXIO);
+ return ENXIO;
if (scr->scr_dconf == &wsdisplay_console_conf ||
scr->scr_syncops ||
((scr->scr_flags & SCR_OPEN) && !(flags & WSDISPLAY_DELSCR_FORCE)))
- return(EBUSY);
+ return EBUSY;
wsdisplay_closescreen(sc, scr);
@@ -602,7 +602,7 @@
cookie);
aprint_verbose_dev(sc->sc_dev, "screen %d deleted\n", idx);
- return (0);
+ return 0;
}
/*
@@ -621,13 +621,13 @@
*/
if (match->cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] != 0 &&
ap->console != 0)
- return (10);
+ return 10;
else
- return (0);
+ return 0;
}
/* If console-ness unspecified, it wins. */
- return (1);
+ return 1;
}
void
@@ -671,7 +671,7 @@
aprint_normal(" console %d", ap->console);
#endif
- return (UNCONF);
+ return UNCONF;
}
int
@@ -701,7 +701,7 @@
#endif
/* Always match. */
- return (1);
+ return 1;
}
void
@@ -756,11 +756,11 @@
cv_wait_sig(&sc->sc_flagscv, &sc->sc_flagsmtx);
mutex_exit(&sc->sc_flagsmtx);
if (sc->sc_flags & SC_SWITCHERROR)
- return (EIO); /* XXX pass real error */
+ return EIO; /* XXX pass real error */
} else {
sc->sc_flags &= ~SC_SWITCHPENDING;
if (res)
- return (res);
+ return res;
}
if (attach)
sc->sc_flags |= SC_XATTACHED;
@@ -781,9 +781,9 @@
continue;
res = wsdisplay_dosync(device_private(dv), resume);
if (res)
- return (res);
+ return res;
}
- return (0);
+ return 0;
}
static bool
@@ -811,7 +811,7 @@
wsdisplay_dosync(sc, 0);
}
#endif
- return (!(sc->sc_flags & SC_XATTACHED));
+ return !(sc->sc_flags & SC_XATTACHED);
}
/* Print function (for parent devices). */
@@ -825,7 +825,7 @@
if (pnp)
aprint_normal("wsdisplay at %s", pnp);
- return (UNCONF);
+ return UNCONF;
}
static void
@@ -1003,20 +1003,20 @@
sc = device_lookup_private(&wsdisplay_cd, WSDISPLAYUNIT(dev));
if (sc == NULL) /* make sure it was attached */
- return (ENXIO);
+ return ENXIO;
if (ISWSDISPLAYSTAT(dev)) {
wsevent_init(&sc->evar, l->l_proc);
- return (0);
+ return 0;
}
if (ISWSDISPLAYCTL(dev))
- return (0);
+ return 0;
if (WSDISPLAYSCREEN(dev) >= WSDISPLAY_MAXSCREEN)
- return (ENXIO);
+ return ENXIO;
if ((scr = sc->sc_scr[WSDISPLAYSCREEN(dev)]) == NULL)
- return (ENXIO);
+ return ENXIO;
if (WSSCREEN_HAS_TTY(scr)) {
tp = scr->scr_tty;
@@ -1027,7 +1027,7 @@
if (kauth_authorize_device_tty(l->l_cred,
KAUTH_DEVICE_TTY_OPEN, tp))
- return (EBUSY);
+ return EBUSY;
if (newopen) {
ttychars(tp);
@@ -1043,7 +1043,7 @@
error = ((*tp->t_linesw->l_open)(dev, tp));
if (error)
- return (error);
+ return error;
if (newopen && WSSCREEN_HAS_EMULATOR(scr)) {
/* set window sizes as appropriate, and reset
@@ -1056,7 +1056,7 @@
}
scr->scr_flags |= SCR_OPEN;
- return (0);
+ return 0;
}
int
@@ -1072,14 +1072,14 @@
if (ISWSDISPLAYSTAT(dev)) {
wsevent_fini(&sc->evar);
- return (0);
+ return 0;
}
if (ISWSDISPLAYCTL(dev))
- return (0);
+ return 0;
if ((scr = sc->sc_scr[WSDISPLAYSCREEN(dev)]) == NULL)
- return (0);
+ return 0;
if (WSSCREEN_HAS_TTY(scr)) {
if (scr->scr_hold_screen) {
@@ -1118,7 +1118,7 @@
scr->scr_flags &= ~SCR_OPEN;
- return (0);
+ return 0;
}
int
@@ -1133,20 +1133,20 @@
if (ISWSDISPLAYSTAT(dev)) {
error = wsevent_read(&sc->evar, uio, flag);
- return (error);
+ return error;
}
if (ISWSDISPLAYCTL(dev))
- return (0);
+ return 0;
if ((scr = sc->sc_scr[WSDISPLAYSCREEN(dev)]) == NULL)
- return (ENXIO);
+ return ENXIO;
if (!WSSCREEN_HAS_TTY(scr))
Home |
Main Index |
Thread Index |
Old Index