All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] usb.agent - fix interpretation of hex values (PRODUCT and sysfs)
Date: Wed, 06 Aug 2003 19:32:23 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-106019932419546@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106019730516701@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Wednesday 06 August 2003 23:09, Andrey Borzenkov wrote:
> Both PRODUCT and all values in sysfs are passed as hex while bash attempts
> to evaluate them as decimal by default.
>

oops, it sneaked in by mistake from some unrelated experiments. PRODUCT is 
already OK of course, sorry.

updated patch attached

-andrey

[-- Attachment #2: hotplug-2003_08_05-USB_sysfs_is_hex.patch --]
[-- Type: text/x-diff, Size: 1303 bytes --]

--- hotplug-2003_08_05/etc/hotplug/usb.agent.sysfs_is_hex	2003-08-06 23:04:43.000000000 +0400
+++ hotplug-2003_08_05/etc/hotplug/usb.agent	2003-08-06 23:24:40.000000000 +0400
@@ -195,9 +195,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=1000
@@ -213,9 +213,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=1000

  reply	other threads:[~2003-08-06 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 19:09 [PATCH] usb.agent - fix interpretation of hex values (PRODUCT and sysfs) Andrey Borzenkov
2003-08-06 19:32 ` Andrey Borzenkov [this message]
2003-10-13 23:45 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-106019932419546@msgid-missing \
    --to=arvidjaar@mail.ru \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.