Skip to contentSkip to conversation

drivers/input/misc/adxl34x: Fix bug in definition of ADXL346_2D_ORIENT

PATCH Applied [email protected] 2 participants 2 messages Dec 9, 2013 – Dec 10, 2013

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 drivers/input/misc/adxl34x: Fix bug in definition of ADXL346_2D_ORIENT

From: Michael Hennerich <[email protected]>

Coverity report pointet out by Dmitry

---
 drivers/input/misc/adxl34x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/adxl34x.c +1 -1
index 0735de3..1cb1da2 100644
@@ -158,7 +158,7 @@
 
 /* ORIENT ADXL346 only */
 #define ADXL346_2D_VALID		(1 << 6)
-#define ADXL346_2D_ORIENT(x)		(((x) & 0x3) >> 4)
+#define ADXL346_2D_ORIENT(x)		(((x) & 0x30) >> 4)
 #define ADXL346_3D_VALID		(1 << 3)
 #define ADXL346_3D_ORIENT(x)		((x) & 0x7)
 #define ADXL346_2D_PORTRAIT_POS		0	/* +X */
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 6 lines · On Mon, Dec 09, 2013 at 12:35:10PM +0100, [email protected] wrote:

From: Michael Hennerich <[email protected]>

Coverity report pointet out by Dmitry

Applied, thank you.

Quoted 21 lines
---
 drivers/input/misc/adxl34x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/adxl34x.c +1 -1
index 0735de3..1cb1da2 100644
@@ -158,7 +158,7 @@
 
 /* ORIENT ADXL346 only */
 #define ADXL346_2D_VALID		(1 << 6)
-#define ADXL346_2D_ORIENT(x)		(((x) & 0x3) >> 4)
+#define ADXL346_2D_ORIENT(x)		(((x) & 0x30) >> 4)
 #define ADXL346_3D_VALID		(1 << 3)
 #define ADXL346_3D_ORIENT(x)		((x) & 0x7)
 #define ADXL346_2D_PORTRAIT_POS		0	/* +X */
Signature · 1 line
1.7.9.5
Signature · 1 line
Dmitry