All of lore.kernel.org
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64: sysreg: fix sparse warnings
Date: Mon, 19 Nov 2018 14:08:23 +0000	[thread overview]
Message-ID: <20181119140823.GE8361@arrakis.emea.arm.com> (raw)
In-Reply-To: <20181119125719.bgdp6bwnhceyvjnp@ltop.local>

On Mon, Nov 19, 2018 at 01:57:20PM +0100, Luc Van Oostenryck wrote:
> On Mon, Nov 19, 2018 at 12:35:32PM +0000, Will Deacon wrote:
> > On Mon, Nov 19, 2018 at 12:25:11PM +0000, Catalin Marinas wrote:
> > > On Fri, Nov 16, 2018 at 09:21:30PM +0300, Sergey Matyukevich wrote:
> > > > Specify correct type for the constants to avoid
> > > > the following sparse complaints:
> > > > 
> > > > ./arch/arm64/include/asm/sysreg.h:471:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
> > > > ./arch/arm64/include/asm/sysreg.h:512:42: warning: constant 0xffffffffffffffff is so big it is unsigned long
> > > > 
> > > > Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
> > > 
> > > I queued the patch for 4.20-rc4 and also changed the constant to ~0UL as
> > > per Luc's suggestion. Thanks.
> > 
> > My vague worry with using ~0UL is that the preprocessor says:
> > 
> >  It carries out all calculations in the widest integer type known to the
> >  compiler; on most machines supported by GCC this is 64 bits.
> > 
> > which implies to me that if we ever got a 128-bit integer type, then this
> > would break.
> 
> True, indeed.
> 
> Note: since C99, the standard says:
> 	(in the context of #if and #elif) "... all signed integer
> 	types and all unsigned integer types act as if they have
> 	the same representation as, respectively, the types intmax_t
> 	and uintmax_t defined in the header <stdint.h>."
>    Which doesn't really change your concern.

OK, I'll stick to the original patch.

-- 
Catalin

      reply	other threads:[~2018-11-19 14:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 18:21 [PATCH v2] arm64: sysreg: fix sparse warnings Sergey Matyukevich
2018-11-16 22:44 ` Luc Van Oostenryck
2018-11-17  2:27 ` Will Deacon
2018-11-17  2:55   ` Olof Johansson
2018-11-19 12:25 ` Catalin Marinas
2018-11-19 12:35   ` Will Deacon
2018-11-19 12:57     ` Luc Van Oostenryck
2018-11-19 14:08       ` Catalin Marinas [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=20181119140823.GE8361@arrakis.emea.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.