Date: Sun, 18 Apr 2021 17:24:50 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: f1f987066837 - main - Minor style cleanup Message-ID: <202104181724.13IHOo6b034089@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f1f9870668374f4c4605b6c6ed343408f9d48084 commit f1f9870668374f4c4605b6c6ed343408f9d48084 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-04-18 17:10:59 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-04-18 17:14:17 +0000 Minor style cleanup We prefer 'while (0)' to 'while(0)' according to grep and stlye(9)'s space after keyword rule. Remove a few stragglers of the latter. Many of these usages were inconsistent within the file. MFC After: 3 days Sponsored by: Netflix --- sys/kern/kern_event.c | 4 ++-- sys/kern/kern_linker.c | 2 +- sys/kern/kern_sx.c | 2 +- sys/kern/sys_process.c | 2 +- sys/kern/tty_outq.c | 2 +- sys/sys/event.h | 7 ++++--- sys/sys/eventhandler.h | 4 ++-- sys/sys/ktr.h | 2 +- sys/sys/pcpu.h | 2 +- sys/sys/qmath.h | 6 +++--- sys/sys/signalvar.h | 4 ++-- sys/sys/stack.h | 2 +- 12 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 45d505fca757..33a6cdcda486 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -222,7 +222,7 @@ SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW, knote_enqueue((kn)); \ if (!(islock)) \ KQ_UNLOCK((kn)->kn_kq); \ -} while(0) +} while (0) #define KQ_LOCK(kq) do { \ mtx_lock(&(kq)->kq_lock); \ } while (0) @@ -312,7 +312,7 @@ kn_leave_flux(struct knote *kn) knl->kl_assert_lock((knl)->kl_lockarg, LA_UNLOCKED); \ } while (0) #else /* !INVARIANTS */ -#define KNL_ASSERT_LOCKED(knl) do {} while(0) +#define KNL_ASSERT_LOCKED(knl) do {} while (0) #define KNL_ASSERT_UNLOCKED(knl) do {} while (0) #endif /* INVARIANTS */ diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index e54546eec7b4..d30db0fb2dba 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -131,7 +131,7 @@ retry: \ } \ } \ (a) = next_file_id; \ -} while(0) +} while (0) /* XXX wrong name; we're looking at version provision tags here, not modules */ typedef TAILQ_HEAD(, modlist) modlisthead_t; diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 0d914375ec87..3296bf50a290 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -558,7 +558,7 @@ sx_drop_critical(uintptr_t x, bool *in_critical, int *extra_work) } } #else -#define sx_drop_critical(x, in_critical, extra_work) do { } while(0) +#define sx_drop_critical(x, in_critical, extra_work) do { } while (0) #endif /* diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index c4dfc2def72a..27a690e65638 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$"); else \ error = (action); \ return (error); \ -} while(0) +} while (0) int proc_read_regs(struct thread *td, struct reg *regs) diff --git a/sys/kern/tty_outq.c b/sys/kern/tty_outq.c index 70d6be3062b2..580a3656aca1 100644 --- a/sys/kern/tty_outq.c +++ b/sys/kern/tty_outq.c @@ -81,7 +81,7 @@ static uma_zone_t ttyoutq_zone; uma_zfree(ttyoutq_zone, tob); \ else \ TTYOUTQ_INSERT_TAIL(to, tob); \ -} while(0) +} while (0) void ttyoutq_flush(struct ttyoutq *to) diff --git a/sys/sys/event.h b/sys/sys/event.h index b3106e6fa874..cf7db43475fd 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -60,9 +60,10 @@ .udata = (f), \ .ext = {0}, \ }; \ -} while(0) +} while (0) #else /* Pre-C99 or not STDC (e.g., C++) */ -/* The definition of the local variable kevp could possibly conflict +/* + * The definition of the local variable kevp could possibly conflict * with a user-defined value passed in parameters a-f. */ #define EV_SET(kevp_, a, b, c, d, e, f) do { \ @@ -77,7 +78,7 @@ (kevp)->ext[1] = 0; \ (kevp)->ext[2] = 0; \ (kevp)->ext[3] = 0; \ -} while(0) +} while (0) #endif struct kevent { diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 9ce68353bd9e..864d6c7a3b8e 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -147,7 +147,7 @@ do { \ \ if ((_el = eventhandler_find_list(#name)) != NULL) \ eventhandler_deregister(_el, tag); \ -} while(0) +} while (0) #define EVENTHANDLER_DEREGISTER_NOWAIT(name, tag) \ do { \ @@ -155,7 +155,7 @@ do { \ \ if ((_el = eventhandler_find_list(#name)) != NULL) \ eventhandler_deregister_nowait(_el, tag); \ -} while(0) +} while (0) eventhandler_tag eventhandler_register(struct eventhandler_list *list, const char *name, void *func, void *arg, int priority); diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h index d9bd2bf6e089..dc06be9fa9cb 100644 --- a/sys/sys/ktr.h +++ b/sys/sys/ktr.h @@ -82,7 +82,7 @@ void ktr_tracepoint(uint64_t mask, const char *file, int line, ktr_tracepoint((m), __FILE__, __LINE__, format, \ (u_long)(p1), (u_long)(p2), (u_long)(p3), \ (u_long)(p4), (u_long)(p5), (u_long)(p6)); \ - } while(0) + } while (0) #define CTR0(m, format) CTR6(m, format, 0, 0, 0, 0, 0, 0) #define CTR1(m, format, p1) CTR6(m, format, p1, 0, 0, 0, 0, 0) #define CTR2(m, format, p1, p2) CTR6(m, format, p1, p2, 0, 0, 0, 0) diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index cfc8a215707c..14bef5cf690e 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -164,7 +164,7 @@ extern uintptr_t dpcpu_off[]; CPU_FOREACH(_i) { \ bzero(DPCPU_ID_PTR(_i, n), sizeof(*DPCPU_PTR(n))); \ } \ -} while(0) +} while (0) #endif /* _KERNEL */ diff --git a/sys/sys/qmath.h b/sys/sys/qmath.h index d4f015c1efc3..1b718f7edebf 100644 --- a/sys/sys/qmath.h +++ b/sys/sys/qmath.h @@ -501,7 +501,7 @@ typedef u64q_t umaxq_t; #define Q_QADDSUBQ(a, b, eop) \ ({ \ int _aserr; \ - if ((_aserr = Q_NORMPREC(a, b))) while(0); /* NOP */ \ + if ((_aserr = Q_NORMPREC(a, b))) while (0); /* NOP */ \ else if ((eop) == '+') { \ if (Q_IFMAXVAL(*(a)) - Q_GIFABSVAL(b) < Q_GIFVAL(*(a))) \ _aserr = EOVERFLOW; /* [+/-a + +b] > max(a) */ \ @@ -523,7 +523,7 @@ typedef u64q_t umaxq_t; #define Q_QDIVQ(a, b) \ ({ \ int _err; \ - if ((_err = Q_NORMPREC(a, b))) while(0); /* NOP */ \ + if ((_err = Q_NORMPREC(a, b))) while (0); /* NOP */ \ else if (Q_GIFABSVAL(b) == 0 || (!Q_SIGNED(*(a)) && Q_LTZ(b))) \ _err = EINVAL; /* Divide by zero or cannot represent. */\ /* XXXLAS: Handle overflow. */ \ @@ -539,7 +539,7 @@ typedef u64q_t umaxq_t; #define Q_QMULQ(a, b) \ ({ \ int _mulerr; \ - if ((_mulerr = Q_NORMPREC(a, b))) while(0); /* NOP */ \ + if ((_mulerr = Q_NORMPREC(a, b))) while (0); /* NOP */ \ else if (!Q_SIGNED(*(a)) && Q_LTZ(b)) \ _mulerr = EINVAL; \ else if (Q_GIFABSVAL(b) != 0 && \ diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index df761a1e1a5d..a7fe174b40bf 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -301,14 +301,14 @@ sigsetmasked(sigset_t *set, sigset_t *mask) #define ksiginfo_init(ksi) \ do { \ bzero(ksi, sizeof(ksiginfo_t)); \ -} while(0) +} while (0) #define ksiginfo_init_trap(ksi) \ do { \ ksiginfo_t *kp = ksi; \ bzero(kp, sizeof(ksiginfo_t)); \ kp->ksi_flags |= KSI_TRAP; \ -} while(0) +} while (0) static __inline void ksiginfo_copy(ksiginfo_t *src, ksiginfo_t *dst) diff --git a/sys/sys/stack.h b/sys/sys/stack.h index acaa2f36bc00..15ee178d63a6 100644 --- a/sys/sys/stack.h +++ b/sys/sys/stack.h @@ -65,7 +65,7 @@ void stack_ktr(u_int, const char *, int, const struct stack *, #define CTRSTACK(m, st, depth) do { \ if (KTR_COMPILE & (m)) \ stack_ktr((m), __FILE__, __LINE__, st, depth); \ - } while(0) + } while (0) #else #define CTRSTACK(m, st, depth) #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104181724.13IHOo6b034089>