From: Thomas Huth <thuth@redhat.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Eric Farman <farman@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
cohuck@redhat.com, Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH] pc-bios/s390-ccw: Get rid of the the __u* types
Date: Wed, 28 Jun 2023 10:32:38 +0200 [thread overview]
Message-ID: <563ee2d5-ce64-de5f-02fc-8eb08be68854@redhat.com> (raw)
In-Reply-To: <585834bf-33a0-2a64-0bba-f1f47df41275@linux.ibm.com>
On 27/06/2023 14.19, Christian Borntraeger wrote:
>
>
> Am 27.06.23 um 13:41 schrieb Thomas Huth:
>> Using types starting with double underscores should be avoided since these
>> names are marked as reserved by the C standard. The corresponding Linux
>
> In general I think this change is fine, but this is kind of interesting, as
> /usr/include/linux/types.h does have __u64 and friends. In fact there is
> __u64 but not u64 in /usr/include.
>
> And yes a google search for double underscore has
>
> The use of two underscores (` __ ') in identifiers is reserved for the
> compiler's internal use according to the ANSI-C standard. Underscores
> (` _ ') are often used in names of library functions (such as " _main
> " and " _exit "). In order to avoid collisions, do not begin an
> identifier with an underscore.
>
>> kernel header file has also been changed accordingly a long time ago:
>>
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/drivers/s390/cio/cio.h?id=cd6b4f27b9bb2a
>
> but IIRC from a kernel perspective u64 is for kernel internal uint64_t
> and __u64 is for uapi, e.g. see
> https://lkml.indiana.edu/hypermail/linux/kernel/1401.2/02851.html
>
> So in essence we (QEMU/s390-ccw) have to decide what to use for our
> internal purposes. And yes, u64 and this patch is certainly ok. But
> we might need to change the patch description
Ok, agreed, the patch description could be better. Maybe just something like
this:
"
The types starting with double underscores have likely been introduced into
the s390-ccw bios to be able to re-use structs from the Linux kernel in the
past, but the corresponding structs in cio.h have been changed there a long
time ago already to not use the variants with the double underscores anymore:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/drivers/s390/cio/cio.h?id=cd6b4f27b9bb2a
So it would be good to replace these in the s390-ccw bios now, too.
"
?
Thomas
next prev parent reply other threads:[~2023-06-28 8:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 11:41 [PATCH] pc-bios/s390-ccw: Get rid of the the __u* types Thomas Huth
2023-06-27 11:58 ` Claudio Imbrenda
2023-06-27 12:03 ` Eric Farman
2023-06-27 12:03 ` Juan Quintela
2023-06-27 12:19 ` Christian Borntraeger
2023-06-28 8:32 ` Thomas Huth [this message]
2023-06-28 8:35 ` Christian Borntraeger
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=563ee2d5-ce64-de5f-02fc-8eb08be68854@redhat.com \
--to=thuth@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=quintela@redhat.com \
/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).