From: Luigi Semenzato <semenzato@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Doug Anderson <dianders@chromium.org>,
linux-input@vger.kernel.org, Simon Glass <sjg@chromium.org>,
Vincent Palatin <vpalatin@chromium.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Input: cros_ec_keyb - switch from using uint8_t to u8
Date: Thu, 2 Jan 2014 16:13:27 -0800 [thread overview]
Message-ID: <CAA25o9Tf_wEnJ1H4tKVXbS4R3pgbh6nbEWChEyjzRRDcusYRFg@mail.gmail.com> (raw)
In-Reply-To: <20140102192745.GB2025@core.coreip.homeip.net>
Thank you, this is useful information, and it would be even more
useful if it made it in Documentation/CodingStyle :-)
On Thu, Jan 2, 2014 at 11:27 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Jan 02, 2014 at 08:12:09AM -0800, Doug Anderson wrote:
>> Dmitry,
>>
>> On Tue, Dec 31, 2013 at 11:34 AM, Dmitry Torokhov
>> <dmitry.torokhov@gmail.com> wrote:
>> > u8 is proper in-kernel type for unsigned byte data.
>>
>> I won't say that I keep up with all the latest trends here, but this
>> surprised me so I did some research. My findings don't agree with
>> your statement. Perhaps there are different standards that are used
>> for the input subsystem?
>>
>> Specifically looking at
>> <https://www.kernel.org/doc/Documentation/CodingStyle>, I see:
>>
>> Therefore, the Linux-specific 'u8/u16/u32/u64' types and their
>> signed equivalents which are identical to standard types are
>> permitted -- although they are not mandatory in new code of your
>> own.
>>
>> When editing existing code which already uses one or the other set
>> of types, you should conform to the existing choices in that code.
>>
>> That makes it sound like the author of that document would prefer
>> uint8_t but will accept u8. It also seems like if code is consistent
>> about using a given type (as this code is) that it shouldn't be
>> changed.
>>
>> I'm always happy to be enlightened, though!
>
> I prefer uXX in kernel because it matches __uXX that we publish in UAPI.
> Also here is Linus's response form the discussion that introduced that
> particular wording in CodingStyle [1]:
>
> "The problem with uint32_t is that it's ugly, it used to be unportable,
> and you can't use it in header files _anyway_.
>
> In other words, there's no _point_ to the "standard type".
>
> I really object to this whole thing. The fact is, "u8" and friends _are_
> the standard types as far as the kernel is concerned. Claiming that
> they aren't is just silly.
>
> It's the "uint32_t" kind of thing that isn't standard within the kernel.
> You can't use that thing in public header files anyway due to name
> scoping rules, so they have basically no redeeming features."
>
> Thanks.
>
> --
> Dmitry
>
> [1] http://marc.info/?l=linux-kernel&m=114659539715468&w=2
prev parent reply other threads:[~2014-01-03 0:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-31 19:34 [PATCH] Input: cros_ec_keyb - switch from using uint8_t to u8 Dmitry Torokhov
2014-01-02 16:12 ` Doug Anderson
2014-01-02 19:27 ` Dmitry Torokhov
2014-01-03 0:13 ` Luigi Semenzato [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAA25o9Tf_wEnJ1H4tKVXbS4R3pgbh6nbEWChEyjzRRDcusYRFg@mail.gmail.com \
--to=semenzato@chromium.org \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sjg@chromium.org \
--cc=vpalatin@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).