mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Doug Thompson <norsk5@yahoo.com>
To: dougthompson@xmission.com, mchehab@redhat.com,
	linux-kernel@vger.kernel.org, Alan Cox <alan@linux.intel.com>
Subject: Re: [PATCH] edac: i7core_edac produces undefined behaviour on 32bit
Date: Wed, 28 Oct 2009 10:10:47 -0700 (PDT)	[thread overview]
Message-ID: <829334.85094.qm@web50110.mail.re2.yahoo.com> (raw)
In-Reply-To: <20091028105200.6097.58279.stgit@localhost.localdomain>



--- On Wed, 10/28/09, Alan Cox <alan@linux.intel.com> wrote:

> From: Alan Cox <alan@linux.intel.com>
> Subject: [PATCH] edac: i7core_edac produces undefined behaviour on 32bit
> To: dougthompson@xmission.com, mchehab@redhat.com, linux-kernel@vger.kernel.org
> Date: Wednesday, October 28, 2009, 4:52 AM
> Fix the shifts up
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>

Acked-by: Doug Thompson <dougthompson@xmission.com>


> ---
> 
>  drivers/edac/i7core_edac.c |   24
> ++++++++++++------------
>  1 files changed, 12 insertions(+), 12 deletions(-)
> 
> 
> diff --git a/drivers/edac/i7core_edac.c
> b/drivers/edac/i7core_edac.c
> index b6fce2e..bd7c727 100644
> --- a/drivers/edac/i7core_edac.c
> +++ b/drivers/edac/i7core_edac.c
> @@ -916,41 +916,41 @@ static ssize_t
> i7core_inject_enable_store(struct mem_ctl_info *mci,
>  
>      /* Sets pvt->inject.dimm mask */
>      if (pvt->inject.dimm < 0)
> -        mask |= 1L <<
> 41;
> +        mask |= 1LL <<
> 41;
>      else {
>          if
> (pvt->channel[pvt->inject.channel].dimms > 2)
> -           
> mask |= (pvt->inject.dimm & 0x3L) << 35;
> +           
> mask |= (pvt->inject.dimm & 0x3LL) << 35;
>          else
> -           
> mask |= (pvt->inject.dimm & 0x1L) << 36;
> +           
> mask |= (pvt->inject.dimm & 0x1LL) << 36;
>      }
>  
>      /* Sets pvt->inject.rank mask */
>      if (pvt->inject.rank < 0)
> -        mask |= 1L <<
> 40;
> +        mask |= 1LL <<
> 40;
>      else {
>          if
> (pvt->channel[pvt->inject.channel].dimms > 2)
> -           
> mask |= (pvt->inject.rank & 0x1L) << 34;
> +           
> mask |= (pvt->inject.rank & 0x1LL) << 34;
>          else
> -           
> mask |= (pvt->inject.rank & 0x3L) << 34;
> +           
> mask |= (pvt->inject.rank & 0x3LL) << 34;
>      }
>  
>      /* Sets pvt->inject.bank mask */
>      if (pvt->inject.bank < 0)
> -        mask |= 1L <<
> 39;
> +        mask |= 1LL <<
> 39;
>      else
> -        mask |=
> (pvt->inject.bank & 0x15L) << 30;
> +        mask |=
> (pvt->inject.bank & 0x15LL) << 30;
>  
>      /* Sets pvt->inject.page mask */
>      if (pvt->inject.page < 0)
> -        mask |= 1L <<
> 38;
> +        mask |= 1LL <<
> 38;
>      else
> -        mask |=
> (pvt->inject.page & 0xffffL) << 14;
> +        mask |=
> (pvt->inject.page & 0xffff) << 14;
>  
>      /* Sets pvt->inject.column mask */
>      if (pvt->inject.col < 0)
> -        mask |= 1L <<
> 37;
> +        mask |= 1LL <<
> 37;
>      else
> -        mask |=
> (pvt->inject.col & 0x3fffL);
> +        mask |=
> (pvt->inject.col & 0x3fff);
>  
>      /*
>       * bit    0:
> REPEAT_EN
> 
> 

      reply	other threads:[~2009-10-28 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28 10:52 Alan Cox
2009-10-28 17:10 ` Doug Thompson [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=829334.85094.qm@web50110.mail.re2.yahoo.com \
    --to=norsk5@yahoo.com \
    --cc=alan@linux.intel.com \
    --cc=dougthompson@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@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

all inboxes | Powered by JetHome®