linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][hotplug] Proper hexnum support for USB sysfs tree
@ 2004-03-17 22:46 Petr Baudis
  2004-03-26 23:03 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Baudis @ 2004-03-17 22:46 UTC (permalink / raw)
  To: linux-hotplug

  Hello,

  the hotplug's default usb.agent doesn't handle properly hex numbers in the
USB sysfs tree, the trivial patch below should fix that. Otherwise each USB
hotplug run produces few very annoying kind-of '[: 0a: integer expression
expected' errors.

--- hotplug-2004_03_11/etc/hotplug/usb.agent	Wed Mar 17 23:24:28 2004
+++ hotplug-2004_03_11+pasky/etc/hotplug/usb.agent	Wed Mar 17 23:34:36 2004
@@ -187,9 +187,9 @@
         usb_bDeviceProtocol=$3
 	IFS="$DEFAULT_IFS"
     elif [ -r $SYSFS/$DEVPATH/bDeviceClass ]; then
-	usb_bDeviceClass=$(cat $SYSFS/$DEVPATH/bDeviceClass)
-	usb_bDeviceSubClass=$(cat $SYSFS/$DEVPATH/bDeviceSubClass)
-	usb_bDeviceProtocol=$(cat $SYSFS/$DEVPATH/bDeviceProtocol)
+	usb_bDeviceClass=$((0x$(cat $SYSFS/$DEVPATH/bDeviceClass)))
+	usb_bDeviceSubClass=$((0x$(cat $SYSFS/$DEVPATH/bDeviceSubClass)))
+	usb_bDeviceProtocol=$((0x$(cat $SYSFS/$DEVPATH/bDeviceProtocol)))
     else
 	# out-of-range values
 	usb_bDeviceClass\x1000
@@ -205,9 +205,9 @@
     	usb_bInterfaceProtocol=$3
 	IFS="$DEFAULT_IFS"
     elif [ -r $SYSFS/$DEVPATH/bInterfaceClass ]; then
-	usb_bInterfaceClass=$(cat $SYSFS/$DEVPATH/bInterfaceClass)
-	usb_bInterfaceSubClass=$(cat $SYSFS/$DEVPATH/bInterfaceSubClass)
-	usb_bInterfaceProtocol=$(cat $SYSFS/$DEVPATH/bInterfaceProtocol)
+	usb_bInterfaceClass=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceClass)))
+	usb_bInterfaceSubClass=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceSubClass)))
+	usb_bInterfaceProtocol=$((0x$(cat $SYSFS/$DEVPATH/bInterfaceProtocol)))
     else
 	# out-of-range values
 	usb_bInterfaceClass\x1000

  Please apply.

  Kind regards,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw


-------------------------------------------------------
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_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][hotplug] Proper hexnum support for USB sysfs tree
  2004-03-17 22:46 [PATCH][hotplug] Proper hexnum support for USB sysfs tree Petr Baudis
@ 2004-03-26 23:03 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-03-26 23:03 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Mar 17, 2004 at 11:46:29PM +0100, Petr Baudis wrote:
>   Hello,
> 
>   the hotplug's default usb.agent doesn't handle properly hex numbers in the
> USB sysfs tree, the trivial patch below should fix that. Otherwise each USB
> hotplug run produces few very annoying kind-of '[: 0a: integer expression
> expected' errors.

Thanks, already fixed in the cvs tree.

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_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-26 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17 22:46 [PATCH][hotplug] Proper hexnum support for USB sysfs tree Petr Baudis
2004-03-26 23:03 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).