From: Josh Triplett <josh@joshtriplett.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "leonro@mellanox.com" <leonro@mellanox.com>,
"ksummit-discuss@lists.linuxfoundation.org"
<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] How to encourage driver authors to annotate integer endianness properly
Date: Wed, 25 Oct 2017 09:16:56 -0700 [thread overview]
Message-ID: <20171025161655.psufkrr6u62ivmba@jtriplet-mobl2.jf.intel.com> (raw)
In-Reply-To: <1508937108.29215.4.camel@infradead.org>
On Wed, Oct 25, 2017 at 03:11:48PM +0200, David Woodhouse wrote:
> On Wed, 2017-10-25 at 14:40 +0200, Alexey Dobriyan wrote:
> > On 10/25/17, Bart Van Assche <Bart.VanAssche@wdc.com> wrote:
> > >
> > > I think we need a way to encourage driver authors
> > > to pay attention to endianness annotations,
> > typedef struct {
> > uint32_t _;
> > } __le32;
>
> I actually did that in JFFS2 years ago; before sparse could do it. It
> was very useful.
>
> I'd really like to have proper compiler support for big-endian and
> little-endian integers too. We're half-way there now with
> __builtin_bswap32() et al, and compilers can optimise things properly
> (instead of the opaque inline asm we had before I cleaned that up).
>
> But being able to just mark a given integer storage as big- or little-
> endian and have all loads and stores *automatically* do the right thing
> would be extremely useful in many cases.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59852 for a proposal to
implement Sparse's __attribute__((bitwise)) in GCC. The GCC developers
are amenable, if someone's willing to write a patch.
next prev parent reply other threads:[~2017-10-25 16:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-25 9:47 Bart Van Assche
2017-10-25 9:54 ` Greg KH
2017-10-25 10:06 ` Bart Van Assche
2017-10-25 10:13 ` greg
2017-10-25 10:16 ` Mark Brown
2017-10-25 12:56 ` Theodore Ts'o
2017-10-25 10:24 ` Leon Romanovsky
2017-10-25 10:38 ` greg
2017-10-25 12:11 ` Bart Van Assche
2017-10-25 10:18 ` Leon Romanovsky
2017-10-25 12:40 ` Alexey Dobriyan
2017-10-25 13:11 ` David Woodhouse
2017-10-25 16:16 ` Josh Triplett [this message]
2017-10-29 2:05 ` Bart Van Assche
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=20171025161655.psufkrr6u62ivmba@jtriplet-mobl2.jf.intel.com \
--to=josh@joshtriplett.org \
--cc=dwmw2@infradead.org \
--cc=ksummit-discuss@lists.linuxfoundation.org \
--cc=leonro@mellanox.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