From nobody Fri Sep 20 10:10:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X97Ry5YlJz5VcXr; Fri, 20 Sep 2024 10:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X97Ry4w9Cz4TQ7; Fri, 20 Sep 2024 10:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfhXMcwhSw2OZVeycf/8JpBHsfc6i9AtQfUvU/lpKXI=; b=u68R/zLNApM21kF53ZSQc+wg9mAb7bFjRyJ5tgOxQpm+VUHUfF3vWGTG92gCW+vp8DqqVW ygoZx/FvgcfOGltyuFreFnD9eojzcDq/RVDyFb7c4j6eROY8ZKXb6NCYLmlAKak2+sCLFQ jtubqUmMgcnH9aq224oMa/CeOOtH8IDm7SaI4FGqcknYpwDxO6ELqpFuw+O3CoPQZTyDr2 rwkniXBSKlJBIxprmvfwAgIYh9y23q+SJMw101MEDs24NeagvSJXsempf4iWk2nrAcQxNM Z1a3up4xFRISKHGWeyu84y8BvFa3Jr2UJ4vMK6S/b68nyvuW/b6h+Pf10OWrMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726827022; a=rsa-sha256; cv=none; b=UDcduvF4ayJO9A1m8ModksHq7yIrR39s0RhAaBfAexiUbQAqXWpdN7mjVuMSjnbwgys2FP Kytz60belHyXMLydff++aueAfdRRdai262fVngqYNqaJhZuUYM5f82epMrNLej1bwE5zOi xKwa/wwHA7e8En7wqm8v9ot0JKwFMveTOWBdNG4IaOHjk27K4EoKm3xJxyrIK+BXRyHwhA UPC0yxwBsSYE64vrml74F7UrQvOVSL55nk6hS7Yxu8043azOq/pR0eznEYuOukTchDFqXn gL7CJvdXXTXAW1/TTWFNRDyk9X7DYGIQc6trogwXUef+12pKgrMFop18SghB0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726827022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfhXMcwhSw2OZVeycf/8JpBHsfc6i9AtQfUvU/lpKXI=; b=SW5h3EPHr7mIidStJ+Jw8kQtwjZ4KnIX2AbDHqwskrXJYZck1D0xd660gztO4wO5vA0Kzk aJBcKlecPoEW2BPCLT339RikpxO/m6uzRVgwiolBBGkFaOStd7Mwwbgu+c89XMYlq7hYzx FoImSlpRo3TCQdmcFPTKndJzchb7J4dcRKtt/rLQbLKaxf6aTqSYl2aTmkBjgFHInkDJ6k rVyEXccKibETRqo5xTTTWr9UhLt1m+1szvVcx56M5S7MP4WLiyqZDKek8uJkz+HjXMfGoo LLkptouMkPQfmHqIOuneNfoWlfZnVO2E1TLfIu+dcL07S788ct8h74dRiu9khQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X97Ry3b5xzlp0; Fri, 20 Sep 2024 10:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KAAMnk060304; Fri, 20 Sep 2024 10:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KAAMGQ060301; Fri, 20 Sep 2024 10:10:22 GMT (envelope-from git) Date: Fri, 20 Sep 2024 10:10:22 GMT Message-Id: <202409201010.48KAAMGQ060301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1baf6164e4d6 - main - bpf: Some style and white space cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c commit 1baf6164e4d671ca1547a3096d8ce8fe69ed4e5c Author: Zhenlei Huang AuthorDate: 2024-09-20 10:06:22 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-20 10:06:22 +0000 bpf: Some style and white space cleanup MFC after: 3 days --- sys/net/bpf.c | 14 +++++++------- sys/net/bpf.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 5dfa6fb30565..f5a2d2c0d7a2 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -172,7 +172,7 @@ struct bpf_dltlist32 { #define BIOCSETFNR32 _IOW('B', 130, struct bpf_program32) #endif -#define BPF_LOCK() sx_xlock(&bpf_sx) +#define BPF_LOCK() sx_xlock(&bpf_sx) #define BPF_UNLOCK() sx_xunlock(&bpf_sx) #define BPF_LOCK_ASSERT() sx_assert(&bpf_sx, SA_XLOCKED) /* @@ -1022,7 +1022,7 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag) d->bd_state = BPF_IDLE; while (d->bd_hbuf_in_use) { error = mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, - PRINET|PCATCH, "bd_hbuf", 0); + PRINET | PCATCH, "bd_hbuf", 0); if (error != 0) { BPFD_UNLOCK(d); return (error); @@ -1065,7 +1065,7 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag) BPFD_UNLOCK(d); return (EWOULDBLOCK); } - error = msleep(d, &d->bd_lock, PRINET|PCATCH, + error = msleep(d, &d->bd_lock, PRINET | PCATCH, "bpf", d->bd_rtout); if (error == EINTR || error == ERESTART) { BPFD_UNLOCK(d); @@ -2132,7 +2132,7 @@ bpfpoll(struct cdev *dev, int events, struct thread *td) if (devfs_get_cdevpriv((void **)&d) != 0 || d->bd_bif == NULL) return (events & - (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); + (POLLHUP | POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM)); /* * Refresh PID associated with this descriptor. @@ -3106,7 +3106,7 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvinit,NULL); +SYSINIT(bpfdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, bpf_drvinit, NULL); #else /* !DEV_BPF && !NETGRAPH_BPF */ @@ -3175,13 +3175,13 @@ bpf_peers_present_if(struct ifnet *ifp) u_int bpf_filter(const struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen) { - return -1; /* "no filter" behaviour */ + return (-1); /* "no filter" behaviour */ } int bpf_validate(const struct bpf_insn *f, int len) { - return 0; /* false */ + return (0); /* false */ } #endif /* !DEV_BPF && !NETGRAPH_BPF */ diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 2c227bb2f09d..38c5da0dcb58 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -55,7 +55,7 @@ struct ifnet; * BPF_ALIGNMENT. */ #define BPF_ALIGNMENT sizeof(long) -#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) +#define BPF_WORDALIGN(x) (((x) + (BPF_ALIGNMENT - 1)) & ~(BPF_ALIGNMENT - 1)) #define BPF_MAXINSNS 512 #define BPF_MAXBUFSIZE 0x80000 @@ -367,8 +367,8 @@ struct bpf_insn { /* * Macros for insn array initializers. */ -#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } -#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } /* * Structure to retrieve available DLTs for the interface. @@ -414,24 +414,24 @@ struct bpf_if_ext { struct bpfd_list bif_dlist; /* descriptor list */ }; -void bpf_bufheld(struct bpf_d *d); -int bpf_validate(const struct bpf_insn *, int); -void bpf_tap(struct bpf_if *, u_char *, u_int); -void bpf_tap_if(struct ifnet *, u_char *, u_int); -void bpf_mtap(struct bpf_if *, struct mbuf *); -void bpf_mtap_if(struct ifnet *, struct mbuf *); -void bpf_mtap2(struct bpf_if *, void *, u_int, struct mbuf *); -void bpf_mtap2_if(struct ifnet *, void *, u_int, struct mbuf *); -void bpfattach(struct ifnet *, u_int, u_int); -void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); -void bpfdetach(struct ifnet *); -bool bpf_peers_present_if(struct ifnet *); +void bpf_bufheld(struct bpf_d *d); +int bpf_validate(const struct bpf_insn *, int); +void bpf_tap(struct bpf_if *, u_char *, u_int); +void bpf_tap_if(struct ifnet *, u_char *, u_int); +void bpf_mtap(struct bpf_if *, struct mbuf *); +void bpf_mtap_if(struct ifnet *, struct mbuf *); +void bpf_mtap2(struct bpf_if *, void *, u_int, struct mbuf *); +void bpf_mtap2_if(struct ifnet *, void *, u_int, struct mbuf *); +void bpfattach(struct ifnet *, u_int, u_int); +void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); +void bpfdetach(struct ifnet *); +bool bpf_peers_present_if(struct ifnet *); #ifdef VIMAGE -int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); +int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); #endif -void bpfilterattach(int); -u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); +void bpfilterattach(int); +u_int bpf_filter(const struct bpf_insn *, u_char *, u_int, u_int); static __inline bool bpf_peers_present(struct bpf_if *bpf) @@ -442,11 +442,11 @@ bpf_peers_present(struct bpf_if *bpf) return (!CK_LIST_EMPTY(&ext->bif_dlist)); } -#define BPF_TAP(_ifp,_pkt,_pktlen) \ - bpf_tap_if((_ifp), (_pkt), (_pktlen)) -#define BPF_MTAP(_ifp,_m) \ +#define BPF_TAP(_ifp, _pkt, _pktlen) \ + bpf_tap_if((_ifp), (_pkt), (_pktlen)) +#define BPF_MTAP(_ifp, _m) \ bpf_mtap_if((_ifp), (_m)) -#define BPF_MTAP2(_ifp,_data,_dlen,_m) \ +#define BPF_MTAP2(_ifp, _data, _dlen, _m) \ bpf_mtap2_if((_ifp), (_data), (_dlen), (_m)) #endif /* _KERNEL */