Date: Fri, 12 Sep 2025 08:52:09 -0600 From: Warner Losh <imp@bsdimp.com> To: Zhenlei Huang <zlei@freebsd.org> Cc: Konstantin Belousov <kostikbel@gmail.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 22238759c57d - main - sys/bus.h: Some style(9) fixes Message-ID: <CANCZdfqnyk-=3L8GfDr%2BoQAVP%2BO0D5cRFAOfq2rF=oun-fJVVw@mail.gmail.com> In-Reply-To: <A64E9961-8358-4BD2-BC1B-2B0C4169C1B2@FreeBSD.org> References: <202509120456.58C4uwVD027045@gitrepo.freebsd.org> <aMQLLOgeeIhtUgM9@kib.kiev.ua> <A64E9961-8358-4BD2-BC1B-2B0C4169C1B2@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000082530063e9bcdf4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 12, 2025 at 8:47=E2=80=AFAM Zhenlei Huang <zlei@freebsd.org> wr= ote: > > > > On Sep 12, 2025, at 7:59 PM, Konstantin Belousov <kostikbel@gmail.com> > wrote: > > > > On Fri, Sep 12, 2025 at 04:56:58AM +0000, Zhenlei Huang wrote: > >> The branch main has been updated by zlei: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D22238759c57d942865cf9d1a355a0d0= 4819eb621 > >> > >> commit 22238759c57d942865cf9d1a355a0d04819eb621 > >> Author: Zhenlei Huang <zlei@FreeBSD.org> > >> AuthorDate: 2025-09-12 04:55:14 +0000 > >> Commit: Zhenlei Huang <zlei@FreeBSD.org> > >> CommitDate: 2025-09-12 04:55:14 +0000 > >> > >> sys/bus.h: Some style(9) fixes > >> > >> and whitespace cleanup. > >> > >> MFC after: 3 days > >> --- > >> sys/sys/bus.h | 38 ++++++++++++++++++++------------------ > >> 1 file changed, 20 insertions(+), 18 deletions(-) > >> > >> diff --git a/sys/sys/bus.h b/sys/sys/bus.h > >> index dda27f4737b2..e7ce152160f8 100644 > >> --- a/sys/sys/bus.h > >> +++ b/sys/sys/bus.h > >> @@ -78,7 +78,7 @@ typedef enum device_property_type { > >> * The strings are placed one after the other, separated by NUL > characters. > >> * Fields should be added after the last one and order maintained for > compatibility > >> */ > >> -#define BUS_USER_BUFFER (3*1024) > >> +#define BUS_USER_BUFFER (3 * 1024) > >> struct u_device { > >> uintptr_t dv_handle; > >> uintptr_t dv_parent; > >> @@ -247,8 +247,8 @@ typedef struct devclass *devclass_t; > >> * and may use regular mutexes. However, it is prohibited from > >> * sleeping on a sleep queue. > >> */ > >> -typedef int driver_filter_t(void*); > >> -typedef void driver_intr_t(void*); > >> +typedef int driver_filter_t(void *); > >> +typedef void driver_intr_t(void *); > > What are the fixes there, specifically? > > > > One space is required between the type and *. > > >> > >> /** > >> * @brief Interrupt type bits. > >> @@ -476,18 +476,18 @@ int bus_generic_resume(device_t dev); > >> int bus_generic_resume_child(device_t dev, device_t child); > >> int bus_generic_setup_intr(device_t dev, device_t child, > >> struct resource *irq, int flags, > >> - driver_filter_t *filter, driver_intr_t > *intr, > >> + driver_filter_t *filter, driver_intr_t > *intr, > >> void *arg, void **cookiep); > > And there? > > > > The continuation indent is completely wrong from the style(9) guide, > > and the change just kept it, there and everywhere. > > Yes you're right, the fix is not complete. tools/build/checkstyle.pl does > not > complain about the indent so I kept them the same style. > Don't blindly believe checkstyle.pl. It's at best a hack that's designed to catch the worst offenders for github submissions. It has many false positives and misses many other things. But it was quick and easy to deploy and helps guide reviewers to style problems by making potential ones more visible. Warner --000000000000082530063e9bcdf4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Sep 12,= 2025 at 8:47=E2=80=AFAM Zhenlei Huang <<a href=3D"mailto:zlei@freebsd.o= rg">zlei@freebsd.org</a>> wrote:<br></div><blockquote class=3D"gmail_quo= te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204= );padding-left:1ex"><br> <br> > On Sep 12, 2025, at 7:59 PM, Konstantin Belousov <<a href=3D"mailto= :kostikbel@gmail.com" target=3D"_blank">kostikbel@gmail.com</a>> wrote:<= br> > <br> > On Fri, Sep 12, 2025 at 04:56:58AM +0000, Zhenlei Huang wrote:<br> >> The branch main has been updated by zlei:<br> >> <br> >> URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D22238759= c57d942865cf9d1a355a0d04819eb621" rel=3D"noreferrer" target=3D"_blank">http= s://cgit.FreeBSD.org/src/commit/?id=3D22238759c57d942865cf9d1a355a0d04819eb= 621</a><br> >> <br> >> commit 22238759c57d942865cf9d1a355a0d04819eb621<br> >> Author:=C2=A0 =C2=A0 =C2=A0Zhenlei Huang <zlei@FreeBSD.org><= br> >> AuthorDate: 2025-09-12 04:55:14 +0000<br> >> Commit:=C2=A0 =C2=A0 =C2=A0Zhenlei Huang <zlei@FreeBSD.org><= br> >> CommitDate: 2025-09-12 04:55:14 +0000<br> >> <br> >>=C2=A0 =C2=A0 sys/bus.h: Some style(9) fixes<br> >> <br> >>=C2=A0 =C2=A0 and whitespace cleanup.<br> >> <br> >>=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 3 days<br> >> ---<br> >> sys/sys/bus.h | 38 ++++++++++++++++++++------------------<br> >> 1 file changed, 20 insertions(+), 18 deletions(-)<br> >> <br> >> diff --git a/sys/sys/bus.h b/sys/sys/bus.h<br> >> index dda27f4737b2..e7ce152160f8 100644<br> >> --- a/sys/sys/bus.h<br> >> +++ b/sys/sys/bus.h<br> >> @@ -78,7 +78,7 @@ typedef enum device_property_type {<br> >>=C2=A0 * The strings are placed one after the other, separated by N= UL characters.<br> >>=C2=A0 * Fields should be added after the last one and order mainta= ined for compatibility<br> >>=C2=A0 */<br> >> -#define BUS_USER_BUFFER=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(3*1024)<br> >> +#define BUS_USER_BUFFER=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(3 * 1024)<br> >> struct u_device {<br> >>=C2=A0 =C2=A0 =C2=A0 uintptr_t=C2=A0 =C2=A0 =C2=A0 =C2=A0dv_handle;= <br> >>=C2=A0 =C2=A0 =C2=A0 uintptr_t=C2=A0 =C2=A0 =C2=A0 =C2=A0dv_parent;= <br> >> @@ -247,8 +247,8 @@ typedef struct devclass=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 *devclass_t;<br> >>=C2=A0 * and may use regular mutexes.=C2=A0 However, it is prohibit= ed from<br> >>=C2=A0 * sleeping on a sleep queue.<br> >>=C2=A0 */<br> >> -typedef int driver_filter_t(void*);<br> >> -typedef void driver_intr_t(void*);<br> >> +typedef int driver_filter_t(void *);<br> >> +typedef void driver_intr_t(void *);<br> > What are the fixes there, specifically?<br> > <br> <br> One space is required between the type and *.<br> <br> >> <br> >> /**<br> >>=C2=A0 * @brief Interrupt type bits.<br> >> @@ -476,18 +476,18 @@ int=C2=A0 =C2=A0 bus_generic_resume(device_t= dev);<br> >> int=C2=A0 bus_generic_resume_child(device_t dev, device_t child);<= br> >> int=C2=A0 bus_generic_setup_intr(device_t dev, device_t child,<br> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct resource *irq, int flags,<br> >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0driver_filter_t *filter, driver_intr_t *i= ntr, <br> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0driver_filter_t *filter, driver_intr_t *i= ntr,<br> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0void *arg, void **cookiep);<br> > And there?<br> > <br> > The continuation indent is completely wrong from the style(9) guide,<b= r> > and the change just kept it, there and everywhere.<br> <br> Yes you're right, the fix is not complete. tools/build/<a href=3D"http:= //checkstyle.pl" rel=3D"noreferrer" target=3D"_blank">checkstyle.pl</a> doe= s not<br> complain about the indent so I kept them the same style.<br></blockquote><d= iv><br></div><div>Don't blindly believe <a href=3D"http://checkstyle.pl= ">checkstyle.pl</a>. It's at best a hack that's designed to catch t= he worst offenders for github submissions. It has many false positives and = misses many other things. But it was quick and easy to deploy and helps gui= de reviewers to style problems by making potential ones more visible.</div>= <div><br></div><div>Warner=C2=A0</div></div></div> --000000000000082530063e9bcdf4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqnyk-=3L8GfDr%2BoQAVP%2BO0D5cRFAOfq2rF=oun-fJVVw>