> -----Original Message----- > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> > Sent: Thursday, November 11, 2021 1:49 PM > To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx> > Cc: linux-iio <linux-iio@xxxxxxxxxxxxxxx>; Jonathan Cameron > <jic23@xxxxxxxxxx>; Hennerich, Michael > <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter Clausen > <lars@xxxxxxxxxx>; Nishant Malpani <nish.malpani25@xxxxxxxxx>; > Jimenez, Kister <Kister.Jimenez@xxxxxxxxxx> > Subject: Re: [PATCH] iio: adxrs290: fix data signedness > > [External] > > On Thu, Nov 11, 2021 at 2:19 PM Nuno Sá <nuno.sa@xxxxxxxxxx> > wrote: > > > > From: Kister Genesis Jimenez <kister.jimenez@xxxxxxxxxx> > > > > Properly sign-extend the rate and temperature data. > > ... > > > /* extract lower 12 bits temperature reading */ > > - *val = temp & 0x0FFF; > > + *val = sign_extend32(temp & 0x0FFF, 11); > > What role does the ' & 0x0FFF' part play now? > Isn't it simply a dup (redundant) piece? Oops, you're right. It serves no purpose as we shift out the bits that we do not care. My fault, I just acted as a bot... - Nuno Sá