From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [RFC] [PATCH] rtc-cmos PNPBIOS module autoload broken
Date: Tue, 23 Dec 2008 04:11:01 +0000 [thread overview]
Message-ID: <1230005461.4114.7.camel@nga> (raw)
In-Reply-To: <494ED6EB.7000301@kadzban.is-a-geek.net>
On Sun, 2008-12-21 at 22:05 -0800, Bryan Kadzban wrote:
> Kay Sievers wrote:
> > I'm pretty sure, that these values are always uppercase. Not sure why
> > the pnp bus uses tolower() for char 4-7 of the 8 byte array, that
> > looks pretty broken.
>
> Hmm. Sounds like pnp might need a fix then? Or whatever.
We should not change it, it might confuse existing stuff. The pnp bus
has no proper modalias anyway, so we do not really care with the ACPI
stuff working properly.
> > That looks like the right fix. Maybe you could use strdup()?
>
> I could (and that was what I did at first). Then I figured, since I'm
> going through every byte anyway, why not copy and uppercase at the same
> time.
Ah, I see, missed that detail. We can drop the whole allocation, as the
string length is known, and always 8 bytes long.
> > Care to send it to lkml and Cc: Greg, so he can pick it up?
>
> I can, but it will be a while. (I'm about to take ~2 weeks off starting
> Tuesday and fly back across a continent for the upcoming holidays. It
> will be hard to keep up on something like that while I'm out, so I'll
> probably just wait until I get back.)
Here is an updated patch. Thanks a lot for the fix.
Kay
Subject: pnp: fix broken pnp lowercasing for acpi module aliases
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
file2alias.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index d4dc222..491b8b1 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -366,11 +366,17 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
for (i = 0; i < count; i++) {
const char *id = (char *)devs[i].id;
+ char acpi_id[sizeof(devs[0].id)];
+ int j;
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);
+
+ /* fix broken pnp bus lowercasing */
+ for (j = 0; j < sizeof(acpi_id); j++)
+ acpi_id[j] = toupper(id[j]);
buf_printf(&mod->dev_table_buf,
- "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
+ "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}
@@ -416,10 +422,17 @@ static void do_pnp_card_entries(void *symval, unsigned long size,
/* add an individual alias for every device entry */
if (!dup) {
+ char acpi_id[sizeof(card->devs[0].id)];
+ int k;
+
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);
+
+ /* fix broken pnp bus lowercasing */
+ for (k = 0; k < sizeof(acpi_id); k++)
+ acpi_id[k] = toupper(id[k]);
buf_printf(&mod->dev_table_buf,
- "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
+ "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}
}
prev parent reply other threads:[~2008-12-23 4:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-21 23:53 [RFC] [PATCH] rtc-cmos PNPBIOS module autoload broken Bryan Kadzban
2008-12-22 2:29 ` Kay Sievers
2008-12-22 6:05 ` Bryan Kadzban
2008-12-22 8:38 ` Matthias Schwarzott
2008-12-22 17:16 ` Bryan Kadzban
2008-12-23 4:11 ` Kay Sievers [this message]
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=1230005461.4114.7.camel@nga \
--to=kay.sievers@vrfy.org \
--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 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).