Commit 10ea18f0 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
  kconfig-language.txt: remove bogus hint
  kconfig: fix MAC OS X warnings in menuconfig
  modpost: i2c aliases need no trailing wildcard
parents eb28062f 2cb1e125
...@@ -377,27 +377,3 @@ config FOO ...@@ -377,27 +377,3 @@ config FOO
limits FOO to module (=m) or disabled (=n). limits FOO to module (=m) or disabled (=n).
Build limited by a third config symbol which may be =y or =m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A common idiom that we see (and sometimes have problems with) is this:
When option C in B (module or subsystem) uses interfaces from A (module
or subsystem), and both A and B are tristate (could be =y or =m if they
were independent of each other, but they aren't), then we need to limit
C such that it cannot be built statically if A is built as a loadable
module. (C already depends on B, so there is no dependency issue to
take care of here.)
If A is linked statically into the kernel image, C can be built
statically or as loadable module(s). However, if A is built as loadable
module(s), then C must be restricted to loadable module(s) also. This
can be expressed in kconfig language as:
config C
depends on A = y || A = B
or for real examples, use this command in a kernel tree:
$ find . -name Kconfig\* | xargs grep -ns "depends on.*=.*||.*=" | grep -v orig
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#ifndef KBUILD_NO_NLS #ifndef KBUILD_NO_NLS
# include <libintl.h> # include <libintl.h>
#else #else
# define gettext(Msgid) ((const char *) (Msgid)) static inline const char *gettext(const char *txt) { return txt; }
# define textdomain(Domainname) ((const char *) (Domainname)) static inline void textdomain(const char *domainname) {}
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) static inline void bindtextdomain(const char *name, const char *dir) {}
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -773,7 +773,7 @@ static void conf_string(struct menu *menu) ...@@ -773,7 +773,7 @@ static void conf_string(struct menu *menu)
while (1) { while (1) {
int res; int res;
char *heading; const char *heading;
switch (sym_get_type(menu->sym)) { switch (sym_get_type(menu->sym)) {
case S_INT: case S_INT:
...@@ -925,3 +925,4 @@ int main(int ac, char **av) ...@@ -925,3 +925,4 @@ int main(int ac, char **av)
return 0; return 0;
} }
...@@ -51,6 +51,15 @@ do { \ ...@@ -51,6 +51,15 @@ do { \
sprintf(str + strlen(str), "*"); \ sprintf(str + strlen(str), "*"); \
} while(0) } while(0)
/* Always end in a wildcard, for future extension */
static inline void add_wildcard(char *str)
{
int len = strlen(str);
if (str[len - 1] != '*')
strcat(str + len, "*");
}
unsigned int cross_build = 0; unsigned int cross_build = 0;
/** /**
* Check that sizeof(device_id type) are consistent with size of section * Check that sizeof(device_id type) are consistent with size of section
...@@ -133,9 +142,7 @@ static void do_usb_entry(struct usb_device_id *id, ...@@ -133,9 +142,7 @@ static void do_usb_entry(struct usb_device_id *id,
id->match_flags&USB_DEVICE_ID_MATCH_INT_PROTOCOL, id->match_flags&USB_DEVICE_ID_MATCH_INT_PROTOCOL,
id->bInterfaceProtocol); id->bInterfaceProtocol);
/* Always end in a wildcard, for future extension */ add_wildcard(alias);
if (alias[strlen(alias)-1] != '*')
strcat(alias, "*");
buf_printf(&mod->dev_table_buf, buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"%s\");\n", alias); "MODULE_ALIAS(\"%s\");\n", alias);
} }
...@@ -219,6 +226,7 @@ static int do_ieee1394_entry(const char *filename, ...@@ -219,6 +226,7 @@ static int do_ieee1394_entry(const char *filename,
ADD(alias, "ver", id->match_flags & IEEE1394_MATCH_VERSION, ADD(alias, "ver", id->match_flags & IEEE1394_MATCH_VERSION,
id->version); id->version);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -261,6 +269,7 @@ static int do_pci_entry(const char *filename, ...@@ -261,6 +269,7 @@ static int do_pci_entry(const char *filename,
ADD(alias, "bc", baseclass_mask == 0xFF, baseclass); ADD(alias, "bc", baseclass_mask == 0xFF, baseclass);
ADD(alias, "sc", subclass_mask == 0xFF, subclass); ADD(alias, "sc", subclass_mask == 0xFF, subclass);
ADD(alias, "i", interface_mask == 0xFF, interface); ADD(alias, "i", interface_mask == 0xFF, interface);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -283,6 +292,7 @@ static int do_ccw_entry(const char *filename, ...@@ -283,6 +292,7 @@ static int do_ccw_entry(const char *filename,
id->dev_type); id->dev_type);
ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL, ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL,
id->dev_model); id->dev_model);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -290,7 +300,7 @@ static int do_ccw_entry(const char *filename, ...@@ -290,7 +300,7 @@ static int do_ccw_entry(const char *filename,
static int do_ap_entry(const char *filename, static int do_ap_entry(const char *filename,
struct ap_device_id *id, char *alias) struct ap_device_id *id, char *alias)
{ {
sprintf(alias, "ap:t%02X", id->dev_type); sprintf(alias, "ap:t%02X*", id->dev_type);
return 1; return 1;
} }
...@@ -309,6 +319,7 @@ static int do_serio_entry(const char *filename, ...@@ -309,6 +319,7 @@ static int do_serio_entry(const char *filename,
ADD(alias, "id", id->id != SERIO_ANY, id->id); ADD(alias, "id", id->id != SERIO_ANY, id->id);
ADD(alias, "ex", id->extra != SERIO_ANY, id->extra); ADD(alias, "ex", id->extra != SERIO_ANY, id->extra);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -316,7 +327,7 @@ static int do_serio_entry(const char *filename, ...@@ -316,7 +327,7 @@ static int do_serio_entry(const char *filename,
static int do_acpi_entry(const char *filename, static int do_acpi_entry(const char *filename,
struct acpi_device_id *id, char *alias) struct acpi_device_id *id, char *alias)
{ {
sprintf(alias, "acpi*:%s:", id->id); sprintf(alias, "acpi*:%s:*", id->id);
return 1; return 1;
} }
...@@ -324,7 +335,7 @@ static int do_acpi_entry(const char *filename, ...@@ -324,7 +335,7 @@ static int do_acpi_entry(const char *filename,
static int do_pnp_entry(const char *filename, static int do_pnp_entry(const char *filename,
struct pnp_device_id *id, char *alias) struct pnp_device_id *id, char *alias)
{ {
sprintf(alias, "pnp:d%s", id->id); sprintf(alias, "pnp:d%s*", id->id);
return 1; return 1;
} }
...@@ -409,6 +420,7 @@ static int do_pcmcia_entry(const char *filename, ...@@ -409,6 +420,7 @@ static int do_pcmcia_entry(const char *filename,
ADD(alias, "pc", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3, id->prod_id_hash[2]); ADD(alias, "pc", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3, id->prod_id_hash[2]);
ADD(alias, "pd", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4, id->prod_id_hash[3]); ADD(alias, "pd", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4, id->prod_id_hash[3]);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -432,6 +444,7 @@ static int do_of_entry (const char *filename, struct of_device_id *of, char *ali ...@@ -432,6 +444,7 @@ static int do_of_entry (const char *filename, struct of_device_id *of, char *ali
if (isspace (*tmp)) if (isspace (*tmp))
*tmp = '_'; *tmp = '_';
add_wildcard(alias);
return 1; return 1;
} }
...@@ -448,6 +461,7 @@ static int do_vio_entry(const char *filename, struct vio_device_id *vio, ...@@ -448,6 +461,7 @@ static int do_vio_entry(const char *filename, struct vio_device_id *vio,
if (isspace (*tmp)) if (isspace (*tmp))
*tmp = '_'; *tmp = '_';
add_wildcard(alias);
return 1; return 1;
} }
...@@ -511,6 +525,8 @@ static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, ...@@ -511,6 +525,8 @@ static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa,
{ {
if (eisa->sig[0]) if (eisa->sig[0])
sprintf(alias, EISA_DEVICE_MODALIAS_FMT "*", eisa->sig); sprintf(alias, EISA_DEVICE_MODALIAS_FMT "*", eisa->sig);
else
strcat(alias, "*");
return 1; return 1;
} }
...@@ -529,6 +545,7 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id, ...@@ -529,6 +545,7 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id,
ADD(alias, "rev", id->hversion_rev != PA_HVERSION_REV_ANY_ID, id->hversion_rev); ADD(alias, "rev", id->hversion_rev != PA_HVERSION_REV_ANY_ID, id->hversion_rev);
ADD(alias, "sv", id->sversion != PA_SVERSION_ANY_ID, id->sversion); ADD(alias, "sv", id->sversion != PA_SVERSION_ANY_ID, id->sversion);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -544,6 +561,7 @@ static int do_sdio_entry(const char *filename, ...@@ -544,6 +561,7 @@ static int do_sdio_entry(const char *filename,
ADD(alias, "c", id->class != (__u8)SDIO_ANY_ID, id->class); ADD(alias, "c", id->class != (__u8)SDIO_ANY_ID, id->class);
ADD(alias, "v", id->vendor != (__u16)SDIO_ANY_ID, id->vendor); ADD(alias, "v", id->vendor != (__u16)SDIO_ANY_ID, id->vendor);
ADD(alias, "d", id->device != (__u16)SDIO_ANY_ID, id->device); ADD(alias, "d", id->device != (__u16)SDIO_ANY_ID, id->device);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -559,6 +577,7 @@ static int do_ssb_entry(const char *filename, ...@@ -559,6 +577,7 @@ static int do_ssb_entry(const char *filename,
ADD(alias, "v", id->vendor != SSB_ANY_VENDOR, id->vendor); ADD(alias, "v", id->vendor != SSB_ANY_VENDOR, id->vendor);
ADD(alias, "id", id->coreid != SSB_ANY_ID, id->coreid); ADD(alias, "id", id->coreid != SSB_ANY_ID, id->coreid);
ADD(alias, "rev", id->revision != SSB_ANY_REV, id->revision); ADD(alias, "rev", id->revision != SSB_ANY_REV, id->revision);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -573,6 +592,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id, ...@@ -573,6 +592,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
ADD(alias, "d", 1, id->device); ADD(alias, "d", 1, id->device);
ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor); ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor);
add_wildcard(alias);
return 1; return 1;
} }
...@@ -612,9 +632,6 @@ static void do_table(void *symval, unsigned long size, ...@@ -612,9 +632,6 @@ static void do_table(void *symval, unsigned long size,
for (i = 0; i < size; i += id_size) { for (i = 0; i < size; i += id_size) {
if (do_entry(mod->name, symval+i, alias)) { if (do_entry(mod->name, symval+i, alias)) {
/* Always end in a wildcard, for future extension */
if (alias[strlen(alias)-1] != '*')
strcat(alias, "*");
buf_printf(&mod->dev_table_buf, buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"%s\");\n", alias); "MODULE_ALIAS(\"%s\");\n", alias);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment