Skip to contentSkip to conversation

input.agent bits parse bug

PATCH Fumitoshi UKAI 2 participants 3 messages Mar 13, 2004 – Mar 27, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

Recent version of input.agent has some problems parsing modules.inputmap. From module-init-tools's code, modules.inputmap will have the following format

name number of unsigned int

 evBits	  1
 keyBits  16
 relBits  1
 absBits  2
 mscBits  1
 ledBits  1
 sndBits  1
 ffBits   4

for each unsigned int value, it is printed by using format string "%lx" concatinated by ':'

So, keyBits, absBits and ffBits can't be parsed as $(($<n>)) since it is not simple integer. And other bits parameter should be parsed as $((0x$<n>)) instead of $(($<n>)) because it is not decimal, but hex value.

I think input.agent should be fixed as follows:

etc/hotplug/input.agent +8 -8
diff -ruN hotplug-2004_03_11.orig/etc/hotplug/input.agent hotplug-2004_03_11/etc/hotplug/input.agent
@@ -167,16 +167,16 @@
 	product=$(($5))
 	version=$(($6))
 
-	evBits=$(($7))
-	keyBits=$(($8))
-	relBits=$(($9))
+	evBits=$((0x$7))
+	keyBits="$8"
+	relBits=$((0x$9))
 
 	shift 9
-	absBits=$(($1))
-	cbsBits=$(($2))
-	ledBits=$(($3))
-	sndBits=$(($4))
-	ffBits=$(($5))
+	absBits="$1"
+	mscBits=$((0x$2))
+	ledBits="$3"
+	sndBits=$((0x$4))
+	ffBits="$5"
 	driverInfo=$(($6))
 
 	: checkmatch $module

Anyway, I wonder all these bits are parsed as *Bits="$<n>" and use input_match_bits. Why only ledBits that is only 1 unsigned int value uses input_match_bits?

Thanks,
Fumitoshi UKAI

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 17 lines · Fumitoshi UKAI

Hi,

Recent version of input.agent has some problems parsing modules.inputmap. From module-init-tools's code, modules.inputmap will have the following format

name number of unsigned int

 evBits	  1
 keyBits  16
 relBits  1
 absBits  2
 mscBits  1
 ledBits  1
 sndBits  1
 ffBits   4
Quoted 8 lines

for each unsigned int value, it is printed by using format string "%lx" concatinated by ':'

So, keyBits, absBits and ffBits can't be parsed as $(($<n>)) since it is not simple integer. And other bits parameter should be parsed as $((0x$<n>)) instead of $(($<n>)) because it is not decimal, but hex value.

I think input.agent should be fixed as follows:

You already fixed this in cvs, by using input_match_bits(), right?

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Fumitoshi UKAI

At Fri, 26 Mar 2004 15:11:05 -0800,

Quoted 22 lines · Greg KH
Quoted 20 lines · Fumitoshi UKAI

Hi,

Recent version of input.agent has some problems parsing modules.inputmap. From module-init-tools's code, modules.inputmap will have the following format

name number of unsigned int

 evBits	  1
 keyBits  16
 relBits  1
 absBits  2
 mscBits  1
 ledBits  1
 sndBits  1
 ffBits   4

for each unsigned int value, it is printed by using format string "%lx" concatinated by ':'

Quoted 7 lines
Quoted 5 lines

So, keyBits, absBits and ffBits can't be parsed as $(($<n>)) since it is not simple integer. And other bits parameter should be parsed as $((0x$<n>)) instead of $(($<n>)) because it is not decimal, but hex value.

I think input.agent should be fixed as follows:

You already fixed this in cvs, by using input_match_bits(), right?

Yes

regards,
Fumitoshi UKAI

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel