Skip to contentSkip to conversation

modules: hid id->bus needs TO_NATIVE() in scripts/mod/file2alias.c

PATCH New Nye Liu 1 participant 1 message Feb 17, 2009 Kbuild

lore
Share & tools
lore

Nye Liu

author
#0 lore raw

PATCH 1/1 modules: hid id->bus needs TO_NATIVE() in scripts/mod/file2alias.c

From: Nye Liu <[email protected]>

When building a module alias, the bus identifier must be converted to native endianness. The hid bus id entries were not being properly swapped in little endian systems.

For example:

    # modinfo hid_dell
    filename:
    /lib/modules/2.6.28-1-amd64/kernel/drivers/hid/hid-dell.ko
    license: GPL
    alias: hid:b0300v000013BAp00000017
    alias: hid:b0300v0000413Cp00002105
    alias: hid:b0300v0000413Cp00002005
    depends: hid,usbhid

b0300 should read b0003

scripts/mod/file2alias.c +1 -0
index 491b8b1..4eea60b 100644
@@ -210,6 +210,7 @@ static void do_usb_table(void *symval, unsigned long size,
 static int do_hid_entry(const char *filename,
                             struct hid_device_id *id, char *alias)
 {
+       id->bus = TO_NATIVE(id->bus);
        id->vendor = TO_NATIVE(id->vendor);
        id->product = TO_NATIVE(id->product);
 
Signature · 7 lines
Nye Liu
[email protected]
(818) 772-6235x248
(818) 772-0576 fax

"Who would be stupid enough to quote a fictitious character?"
	-- Don Quixote