linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [patch] iio: imu: adis16400: Fix sign extension
Date: Fri, 30 Jan 2015 12:22:50 +0300	[thread overview]
Message-ID: <20150130092250.GK6507@mwanda> (raw)
In-Reply-To: <54CB41F9.1060800@metafoo.de>

On Fri, Jan 30, 2015 at 09:34:01AM +0100, Lars-Peter Clausen wrote:
> On 01/30/2015 09:30 AM, Dan Carpenter wrote:
> >Because of C's type promotion rules, the code shifts in
> >"((val16 & 0xFFF) << 4) >> 4;" cancel each other out and they're a
> >no-op.
> >
> >The intention here was to sign-extend then 11th bit so we can use the
> >sign_extend32() function.
> >
> >Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >---
> >Please review this carefully.  I'm pretty sure it's correct but this is
> >the first time I've ever used the sign_extend32() function.
> 
> Hi,
> 
> Rasmus already fixed this a couple of days ago.
> 
> Thanks,
> - Lars

Oh.  Good.  I was CC'd on the other one that he fixed so I went looking
for other bugs and I found this one.

Rasmus, are you using a static checker?  Which one?

regards,
dan carpenter

  reply	other threads:[~2015-01-30  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30  8:30 [patch] iio: imu: adis16400: Fix sign extension Dan Carpenter
2015-01-30  8:34 ` Lars-Peter Clausen
2015-01-30  9:22   ` Dan Carpenter [this message]
2015-01-30  9:31     ` Rasmus Villemoes
2015-01-30 10:23       ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2015-01-22 23:34 [PATCH] " Rasmus Villemoes
2015-01-23  8:56 ` Lars-Peter Clausen
2015-01-26 21:07   ` Jonathan Cameron

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=20150130092250.GK6507@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).