From: Alexey Dobriyan <adobriyan@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: [PATCH] Fixup MODULE_DEVICE_TABLE(dmi, ...)
Date: Fri, 21 Nov 2008 04:55:59 +0300 [thread overview]
Message-ID: <20081121015559.GA4478@x200.localdomain> (raw)
In-Reply-To: <1226747692.3687.285.camel@macbook.infradead.org>
On Sat, Nov 15, 2008 at 11:14:52AM +0000, David Woodhouse wrote:
> On Sat, 2008-11-15 at 02:41 +0300, Alexey Dobriyan wrote:
> > How can this work, given that MODULE_DEVICE_TABLE line expands into
> >
> > extern const struct dmi_device_id __mod_dmi_device_table
> > __attribute__ ((unused, alias("mbp_device_table")));
> > ^^^^^^
> > but there is no struct dmi_device_id, there is struct dmi_system_id?
>
> Interesting question ;)
>
> It actually looks like this...
>
> static struct dmi_system_id __initdata mbp_device_table[] = {
> ...
> };
>
> extern const struct dmi_device_id __mod_dmi_device_table \
> __attribute__ ((unused, alias("mbp_device_table")));
>
> So 'struct dmi_device_id' isn't ever really used -- it's just like a
> forward declaration of a struct, and the compiler doesn't care because
> it never needs to know anything more about that struct.
>
> Not ideal though -- we should probably see if we can fix it. I suspect
> it's not worth a global change of dmi_system_id to dmi_device_id
> though... got any better ideas?
>
> Maybe we could change MODULE_GENERIC_TABLE to be more agnostic about the
> datatype -- just call it and 'extern char'. After all, it's only for the
> linker.
Let's do it the most staightforward way :-)
[PATCH] Fixup MODULE_DEVICE_TABLE(dmi, ...)
drivers/video/backlight/mbp_nvidia_bl.c:114: error: storage size of '__mod_dmi_device_table' isn't known
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
include/linux/mod_devicetable.h | 1 +
1 file changed, 1 insertion(+)
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -443,6 +443,7 @@ struct dmi_system_id {
struct dmi_strmatch matches[4];
void *driver_data;
};
+#define dmi_device_id dmi_system_id /* fixup MODULE_DEVICE_TABLE(dmi,...); */
#endif
#define DMI_MATCH(a, b) { a, b }
next prev parent reply other threads:[~2008-11-21 1:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-14 23:41 drivers/video/backlight/mbp_nvidia_bl.c:114: error: storage size of '__mod_dmi_device_table' isn't known Alexey Dobriyan
2008-11-15 11:14 ` David Woodhouse
2008-11-21 1:55 ` Alexey Dobriyan [this message]
2008-12-03 8:41 ` [PATCH] Fixup MODULE_DEVICE_TABLE(dmi, ...) Andrew Morton
2008-12-03 9:03 ` David Woodhouse
2008-12-03 22:56 ` Alexey Dobriyan
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=20081121015559.GA4478@x200.localdomain \
--to=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®