Re: [patch 00/37] PNP resource_table cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31-03-08 23:38, Rene Herman wrote:
On 31-03-08 22:51, Bjorn Helgaas wrote:

Ah, right.  Thanks for tracking that down.  I forgot to factor out
isapnp_to_pnpid() and pnpid32_to_pnpid() (and acpi_ex_eisa_id_to_string()
for that matter, though that's buried in the ACPI CA)-- they're really
doing the same thing and we should only need one copy (plus the CA
one).

I'll wait for another round then, before reviewing this further.

There's actually a hex_asc() helper in kernel.h, so before you overlook it as well, this is a somewhat nicer ID fix.

Rene.
commit cfed76bc2a76f2094338bc43dae55aa814017b5f
Author: Rene Herman <rene.herman@xxxxxxxxx>
Date:   Tue Apr 1 12:03:15 2008 +0200

    [ISAPNP] fix isapnp_to_pnpid

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index c4b95b5..9727050 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -406,11 +406,11 @@ static void isapnp_to_pnpid(unsigned short vendor, unsigned short device,
 	id[0] = 'A' + ((vendor >> 2) & 0x3f) - 1;
 	id[1] = 'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1;
 	id[2] = 'A' + ((vendor >> 8) & 0x1f) - 1;
-	id[3] = '0' + ((device >> 4) & 0x0f);
-	id[4] = '0' + (device & 0x0f);
-	id[5] = '0' + ((device >> 12) & 0x0f);
-	id[6] = '0' + ((device >> 8) & 0x0f);
-	id[7] = '\0';
+	id[3] = hex_asc((device >> 4) & 0x0f);
+	id[4] = hex_asc(device & 0x0f);
+	id[5] = hex_asc((device >> 12) & 0x0f);
+	id[6] = hex_asc((device >> 8) & 0x0f);
+	id[7] = 0;
 }
 
 /*

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux