Skip to contentSkip to conversation

Properly assign return value of clamp() macro.

PATCH Applied Hans Petter Selasky 2 participants 2 messages May 23, 2011 – May 25, 2011 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Properly assign return value of clamp() macro.

Quoted 1 line

From 2b7fc579e802357b7b0742bf6bbbabdaf9e40c1e Mon Sep 17 00:00:00 2001

From: Hans Petter Selasky <[email protected]>
Date: Mon, 23 May 2011 21:54:42 +0200
Subject: [PATCH] Properly assign return value of clamp() macro.

---
 drivers/input/input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/input.c +0 -0
index ebbceed..e3c88fc 100644
@@ -1757,7 +1757,7 @@ static unsigned int 

input_estimate_events_per_packet(struct input_dev *dev)
} else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) {
mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum -
dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1,
- clamp(mt_slots, 2, 32);
+ mt_slots = clamp(mt_slots, 2, 32);
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
mt_slots = 2;
} else {

Signature · 1 line
1.7.1.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Hans Petter Selasky

From 2b7fc579e802357b7b0742bf6bbbabdaf9e40c1e Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <[email protected]>
Date: Mon, 23 May 2011 21:54:42 +0200
Subject: [PATCH] Properly assign return value of clamp() macro.

Applied, thanks Hans Peter. I am not sure why I thought clamp() was modifying its argument... I added similar change to mousedev as well.

Quoted 18 lines
---
 drivers/input/input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/input.c +1 -1
index ebbceed..e3c88fc 100644
@@ -1757,7 +1757,7 @@ static unsigned int 
 input_estimate_events_per_packet(struct input_dev *dev)
 	} else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) {
 		mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum -
 			   dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1,
-		clamp(mt_slots, 2, 32);
+		mt_slots = clamp(mt_slots, 2, 32);
 	} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
 		mt_slots = 2;

} else {

Signature · 1 line
Dmitry