From: David Laight <David.Laight@ACULAB.COM>
To: 'Joe Perches' <joe@perches.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Bernard Metzler <bmt@zurich.ibm.com>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma <linux-rdma@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse
Date: Wed, 28 Aug 2019 08:27:45 +0000 [thread overview]
Message-ID: <ab04933a7dea42049d20597cb65d84f1@AcuMS.aculab.com> (raw)
In-Reply-To: <b0fe444622e32af6c34f3326e5dce3513adf5113.camel@perches.com>
From: Joe Perches
> Sent: 27 August 2019 19:33
> On Tue, 2019-08-27 at 19:59 +0200, Geert Uytterhoeven wrote:
> > On Tue, Aug 27, 2019 at 7:46 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> > > On Tue, Aug 27, 2019 at 07:29:52PM +0200, Geert Uytterhoeven wrote:
> > > > On Tue, Aug 27, 2019 at 4:17 PM David Laight <David.Laight@aculab.com> wrote:
> > > > > From: Geert Uytterhoeven
> > > > > > Sent: 19 August 2019 18:15
> > > > > ...
> > > > > > > I think a cast to unsigned long is rather more common.
> > > > > > >
> > > > > > > uintptr_t is used ~1300 times in the kernel.
> > > > > > > I believe a cast to unsigned long is much more common.
>
> btw: apparently that's not true.
>
> This grep may be incomplete but it seems there are fewer
> kernel uses of a cast to unsigned long then pointer:
>
> $ git grep -P '\(\s*\w+(\s+\w+){0,3}(\s*\*)+\s*\)\s*\(\s*unsigned\s+long\s*\)'|wc -l
> 423
>
> Maybe add a cast_to_ptr macro like
>
> #define cast_to_ptr(type, val) ((type)(uintptr_t)(val))
>
> though that may not save any horizontal space
And it is another bit of pointless obfuscation....
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2019-08-28 8:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 10:05 [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse Geert Uytterhoeven
2019-08-19 12:24 ` Jason Gunthorpe
2019-08-19 13:36 ` Bernard Metzler
2019-08-19 13:52 ` Jason Gunthorpe
2019-08-19 14:15 ` Bernard Metzler
2019-08-19 14:18 ` Jason Gunthorpe
2019-08-19 14:52 ` Bernard Metzler
2019-08-19 15:07 ` Jason Gunthorpe
2019-08-19 15:54 ` Bernard Metzler
2019-08-19 16:05 ` Jason Gunthorpe
2019-08-19 16:29 ` Bernard Metzler
2019-08-19 16:35 ` Jason Gunthorpe
2019-08-19 17:39 ` Bernard Metzler
2019-08-19 18:00 ` Jason Gunthorpe
2019-08-19 21:40 ` Bernard Metzler
2019-08-19 22:22 ` Jason Gunthorpe
2019-08-19 16:56 ` Joe Perches
2019-08-19 17:14 ` Geert Uytterhoeven
2019-08-19 17:26 ` Bernard Metzler
2019-08-27 14:17 ` David Laight
2019-08-27 17:29 ` Geert Uytterhoeven
2019-08-27 17:46 ` Al Viro
2019-08-27 17:59 ` Geert Uytterhoeven
2019-08-27 18:33 ` Joe Perches
2019-08-28 8:27 ` David Laight [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=ab04933a7dea42049d20597cb65d84f1@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=bmt@zurich.ibm.com \
--cc=dledford@redhat.com \
--cc=geert@linux-m68k.org \
--cc=jgg@ziepe.ca \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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