linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ADXL34X orientation definition
@ 2013-12-07  9:53 Dmitry Torokhov
  2013-12-09  8:11 ` Michael Hennerich
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2013-12-07  9:53 UTC (permalink / raw)
  To: Michael Hennerich; +Cc: linux-input

Hi Michael,

I was going though Coverity reports and it looks like definition of

#define ADXL346_2D_ORIENT(x)            (((x) & 0x3) >> 4)

is not correct as it will always evaluate to 0. Should the mask be 0x30
instead?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ADXL34X orientation definition
  2013-12-07  9:53 ADXL34X orientation definition Dmitry Torokhov
@ 2013-12-09  8:11 ` Michael Hennerich
  2013-12-09 11:18   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Hennerich @ 2013-12-09  8:11 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input@vger.kernel.org

On 12/07/2013 10:53 AM, Dmitry Torokhov wrote:
> Hi Michael,
>
> I was going though Coverity reports and it looks like definition of
>
> #define ADXL346_2D_ORIENT(x)            (((x) & 0x3) >> 4)
>
> is not correct as it will always evaluate to 0. Should the mask be 0x30
> instead?
>
> Thanks.
>
Hi Dmitry,

Good catch!

Yes, of course  - the mask should be 0x30.
Shall I send a patch?

-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ADXL34X orientation definition
  2013-12-09  8:11 ` Michael Hennerich
@ 2013-12-09 11:18   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2013-12-09 11:18 UTC (permalink / raw)
  To: michael.hennerich; +Cc: linux-input@vger.kernel.org

On Monday, December 09, 2013 09:11:38 AM Michael Hennerich wrote:
> On 12/07/2013 10:53 AM, Dmitry Torokhov wrote:
> > Hi Michael,
> > 
> > I was going though Coverity reports and it looks like definition of
> > 
> > #define ADXL346_2D_ORIENT(x)            (((x) & 0x3) >> 4)
> > 
> > is not correct as it will always evaluate to 0. Should the mask be 0x30
> > instead?
> > 
> > Thanks.
> 
> Hi Dmitry,
> 
> Good catch!
> 
> Yes, of course  - the mask should be 0x30.
> Shall I send a patch?

That would be great.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-09 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-07  9:53 ADXL34X orientation definition Dmitry Torokhov
2013-12-09  8:11 ` Michael Hennerich
2013-12-09 11:18   ` Dmitry Torokhov

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).