Skip to contentSkip to conversation

Fix compilation problem with 2.6.0-test2 on PPC

PATCH In review Jocelyn Mayer 2 participants 2 messages Aug 5, 2003 – Aug 24, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation problem with 2.6.0-test2 on PPC

Hi,

There is a compilation issue in driver/input/evdev.c due to the fact a "complex" expression is used as an argument for an inline assembly construction (get_user)
The fix I done is to use a temporary variable to get the argument and then use this variable for get_user.

--
Jocelyn Mayer <[email protected]>

evdev.c renamed from evdev.c.orig +3 -2
@@ -208,7 +208,7 @@
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
 	struct input_absinfo abs;
-	int i, t, u;
+	int i, t, u, v;
 
 	if (!evdev->exist) return -ENODEV;
 
@@ -240,7 +240,8 @@
 			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
 			u = INPUT_KEYCODE(dev, t);
-			if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
+                        v = INPUT_KEYCODE(dev, t);
+			if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
 
 			for (i = 0; i < dev->keycodemax; i++)
 				if(INPUT_KEYCODE(dev, t) == u) break;
#1 lore raw
Quoted 23 lines · Jocelyn Mayer

Hi,

There is a compilation issue in driver/input/evdev.c due to the fact a "complex" expression is used as an argument for an inline assembly construction (get_user)
The fix I done is to use a temporary variable to get the argument and then use this variable for get_user.

--
Jocelyn Mayer <[email protected]>

evdev.c renamed from evdev.c.orig +1 -1
@@ -208,7 +208,7 @@
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
 	struct input_absinfo abs;
-	int i, t, u;
+	int i, t, u, v;
 
 	if (!evdev->exist) return -ENODEV;
 

evdev.c line 247

Quoted 9 lines
evdev.c renamed from evdev.c.orig +2 -1
@@ -240,7 +240,8 @@
 			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
 			u = INPUT_KEYCODE(dev, t);
-			if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
+                        v = INPUT_KEYCODE(dev, t);
+			if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
 
 			for (i = 0; i < dev->keycodemax; i++)
 				if(INPUT_KEYCODE(dev, t) == u) break;

Thanks, similar patch applied.

--
Vojtech Pavlik
SuSE Labs, SuSE CR

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/