All of lore.kernel.org
 help / color / mirror / Atom feed
From: dcb314@hotmail.com (David Binderman)
To: linux-arm-kernel@lists.infradead.org
Subject: linux-4.4-rc8/arch/arm64/kernel/module.c:78: 32/64 bit problem ?
Date: Mon, 4 Jan 2016 08:25:30 +0000	[thread overview]
Message-ID: <DUB128-W158A3195DB26F149DD52E59CF20@phx.gbl> (raw)

Hello there,

[linux-4.4-rc8/arch/arm64/kernel/module.c:78] -> [linux-4.4-rc8/arch/arm64/kernel/module.c:88]: (warning) Shifting 32-bit value by 64 bits is undefined behaviour. See condition at line 88.

Source code is

??? u64 imm_mask = (1 << len) - 1;
??? s64 sval = do_reloc(op, place, val);

??? switch (len) {
??? case 16:
??????? *(s16 *)place = sval;
??????? break;
??? case 32:
??????? *(s32 *)place = sval;
??????? break;
??? case 64:

So it seems that len can be 64. Suggest new code

??? u64 imm_mask = (1UL << len) - 1;
??? s64 sval = do_reloc(op, place, val);

??? switch (len) {
??? case 16:
??????? *(s16 *)place = sval;
??????? break;
??? case 32:
??????? *(s32 *)place = sval;
??????? break;
??? case 64:

Regards

David Binderman

 		 	   		  

             reply	other threads:[~2016-01-04  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  8:25 David Binderman [this message]
2016-01-04 14:16 ` linux-4.4-rc8/arch/arm64/kernel/module.c:78: 32/64 bit problem ? Will Deacon
2016-01-04 14:32   ` Ard Biesheuvel
2016-01-04 15:24     ` Ard Biesheuvel
2016-01-04 15:28       ` Will Deacon
2016-01-04 15:30         ` Will Deacon
2016-01-04 15:14   ` David Binderman

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=DUB128-W158A3195DB26F149DD52E59CF20@phx.gbl \
    --to=dcb314@hotmail.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.