Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Oct 2022 08:48:29 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        "Piotr P. Stefaniak" <pstef@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 62d42655bca1 - main - usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword.
Message-ID:  <CANCZdfrPOcf-pur0r7cymExq6R8su%2BbD_EcatdZgNDg_3JFa0A@mail.gmail.com>
In-Reply-To: <bf9cae46-5d31-e676-2640-c6b49cfdd902@selasky.org>
References:  <202210071141.297BfcjN071407@gitrepo.freebsd.org> <Y0ASC9OXKP19xkSz@freefall.freebsd.org> <d7d3b1ef-1afe-bb84-d61c-031b3dff94c2@selasky.org> <Y0AnxWRAH7detuol@freefall.freebsd.org> <bf9cae46-5d31-e676-2640-c6b49cfdd902@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000dfc7e905ea72e794
Content-Type: text/plain; charset="UTF-8"

On Fri, Oct 7, 2022 at 8:21 AM Hans Petter Selasky <hps@selasky.org> wrote:

> On 10/7/22 15:21, Piotr P. Stefaniak wrote:
> > On 2022-10-07 14:03:51, Hans Petter Selasky wrote:
> >> On 10/7/22 13:48, Piotr P. Stefaniak wrote:
> >>> On 2022-10-07 11:41:38, Hans Petter Selasky wrote:
> >>>
> >>>>    usb(4): Substitute "unsigned int" using the equivalent and shorter
> >>>> "unsigned" keyword.
> >>>
> >>> Why? Just because it's shorter?
> >>
> >> Yes, just because "int" is the redundant.
> >
> > Definitely that's true for computers. In case of humans it's debatable.
>
> Would uint32_t be more clear?
>

I don't think it would be that much clearer.

The only places I might be tempted to use uint32_t is for any of the
structs that were unsigned int that are externally defined to be 32-bit
unsigned integers, which is a tiny fraction of what you changed (I noticed
only a few structures and I didn't look further to see if they are internal
to the USB stack, or data returned from a device).

Warner

--000000000000dfc7e905ea72e794
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">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Oct 7, 2022 at 8:21 AM Hans P=
etter Selasky &lt;<a href=3D"mailto:hps@selasky.org">hps@selasky.org</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/7=
/22 15:21, Piotr P. Stefaniak wrote:<br>
&gt; On 2022-10-07 14:03:51, Hans Petter Selasky wrote:<br>
&gt;&gt; On 10/7/22 13:48, Piotr P. Stefaniak wrote:<br>
&gt;&gt;&gt; On 2022-10-07 11:41:38, Hans Petter Selasky wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; =C2=A0=C2=A0 usb(4): Substitute &quot;unsigned int&quot; u=
sing the equivalent and shorter<br>
&gt;&gt;&gt;&gt; &quot;unsigned&quot; keyword.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Why? Just because it&#39;s shorter?<br>
&gt;&gt;<br>
&gt;&gt; Yes, just because &quot;int&quot; is the redundant.<br>
&gt; <br>
&gt; Definitely that&#39;s true for computers. In case of humans it&#39;s d=
ebatable.<br>
<br>
Would uint32_t be more clear?<br></blockquote><div><br></div><div>I don&#39=
;t think it would be that much clearer.</div><div><br></div><div>The only p=
laces I might be tempted to use uint32_t is for any of the structs that wer=
e unsigned int that are externally defined to be 32-bit unsigned integers, =
which is a tiny fraction of what you changed=C2=A0(I noticed only a few str=
uctures and I didn&#39;t look further to see if they are internal to the US=
B stack, or data returned from a device).</div><div><br></div><div>Warner=
=C2=A0</div></div></div>

--000000000000dfc7e905ea72e794--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrPOcf-pur0r7cymExq6R8su%2BbD_EcatdZgNDg_3JFa0A>