Skip to contentSkip to conversation

Fix input modalias sysfs attribute return size

PATCH Applied Richard Purdie 2 participants 2 messages Jun 21, 2006 – Jun 26, 2006 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix input modalias sysfs attribute return size

When writing some udev rules using the input system's modalias attribute, udevinfo showed it as being ignored. Debugging revealed the 52 character string was over 128 bytes long according to udev (and hence ignored).

The problem appears to be in the kernel where a max_t in input.c should really be a min_t.

drivers/input/input.c +1 -1
Index: linux-2.6.17/drivers/input/input.c
===================================================================
@@ -629,7 +629,7 @@
 
 	len = input_print_modalias(buf, PAGE_SIZE, id, 1);
 
-	return max_t(int, len, PAGE_SIZE);
+	return min_t(int, len, PAGE_SIZE);
 }
 static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
 
maintainer Applied
#1 lore raw
Quoted 8 lines · Richard Purdie

When writing some udev rules using the input system's modalias attribute, udevinfo showed it as being ignored. Debugging revealed the 52 character string was over 128 bytes long according to udev (and hence ignored).

The problem appears to be in the kernel where a max_t in input.c should really be a min_t.

Applied to my tree, Linus should pull shortly. Thank you Richard.

Signature · 1 line
Dmitry