From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Date: Fri, 30 Jan 2015 08:34:01 +0000 Subject: Re: [patch] iio: imu: adis16400: Fix sign extension Message-Id: <54CB41F9.1060800@metafoo.de> List-Id: References: <20150130083058.GD21357@mwanda> In-Reply-To: <20150130083058.GD21357@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, Rasmus Villemoes 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-060.synserver.de ([212.40.185.60]:1063 "EHLO smtp-out-060.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbbA3IeH (ORCPT ); Fri, 30 Jan 2015 03:34:07 -0500 Message-ID: <54CB41F9.1060800@metafoo.de> Date: Fri, 30 Jan 2015 09:34:01 +0100 From: Lars-Peter Clausen MIME-Version: 1.0 To: Dan Carpenter CC: Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, Rasmus Villemoes Subject: Re: [patch] iio: imu: adis16400: Fix sign extension References: <20150130083058.GD21357@mwanda> In-Reply-To: <20150130083058.GD21357@mwanda> Content-Type: text/plain; charset=windows-1252; format=flowed Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org 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 > --- > 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