aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/.gitignore1
-rw-r--r--scripts/mod/file2alias.c42
-rw-r--r--scripts/mod/mk_elfconfig.c1
-rw-r--r--scripts/mod/modpost.c30
-rw-r--r--scripts/mod/sumversion.c4
5 files changed, 37 insertions, 41 deletions
diff --git a/scripts/mod/.gitignore b/scripts/mod/.gitignore
index 33bae0df4de5..3bd11b603173 100644
--- a/scripts/mod/.gitignore
+++ b/scripts/mod/.gitignore
@@ -2,4 +2,3 @@ elfconfig.h
2mk_elfconfig 2mk_elfconfig
3modpost 3modpost
4devicetable-offsets.h 4devicetable-offsets.h
5
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 1924990a737f..e614ef689eee 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -644,28 +644,26 @@ ADD_TO_DEVTABLE("pcmcia", pcmcia_device_id, do_pcmcia_entry);
644 644
645static int do_of_entry (const char *filename, void *symval, char *alias) 645static int do_of_entry (const char *filename, void *symval, char *alias)
646{ 646{
647 int len; 647 int len;
648 char *tmp; 648 char *tmp;
649 DEF_FIELD_ADDR(symval, of_device_id, name); 649 DEF_FIELD_ADDR(symval, of_device_id, name);
650 DEF_FIELD_ADDR(symval, of_device_id, type); 650 DEF_FIELD_ADDR(symval, of_device_id, type);
651 DEF_FIELD_ADDR(symval, of_device_id, compatible); 651 DEF_FIELD_ADDR(symval, of_device_id, compatible);
652 652
653 len = sprintf (alias, "of:N%sT%s", 653 len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
654 (*name)[0] ? *name : "*", 654 (*type)[0] ? *type : "*");
655 (*type)[0] ? *type : "*"); 655
656 656 if (compatible[0])
657 if (compatible[0]) 657 sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
658 sprintf (&alias[len], "%sC%s", 658 *compatible);
659 (*type)[0] ? "*" : "", 659
660 *compatible); 660 /* Replace all whitespace with underscores */
661 661 for (tmp = alias; tmp && *tmp; tmp++)
662 /* Replace all whitespace with underscores */ 662 if (isspace (*tmp))
663 for (tmp = alias; tmp && *tmp; tmp++) 663 *tmp = '_';
664 if (isspace (*tmp)) 664
665 *tmp = '_'; 665 add_wildcard(alias);
666 666 return 1;
667 add_wildcard(alias);
668 return 1;
669} 667}
670ADD_TO_DEVTABLE("of", of_device_id, do_of_entry); 668ADD_TO_DEVTABLE("of", of_device_id, do_of_entry);
671 669
diff --git a/scripts/mod/mk_elfconfig.c b/scripts/mod/mk_elfconfig.c
index 639bca7ba559..a4fd71d71d65 100644
--- a/scripts/mod/mk_elfconfig.c
+++ b/scripts/mod/mk_elfconfig.c
@@ -54,4 +54,3 @@ main(int argc, char **argv)
54 54
55 return 0; 55 return 0;
56} 56}
57
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 026543ba8d86..9d9c5b905b35 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -862,7 +862,7 @@ static const char *section_white_list[] =
862 * without "ax" / "aw". 862 * without "ax" / "aw".
863 */ 863 */
864static void check_section(const char *modname, struct elf_info *elf, 864static void check_section(const char *modname, struct elf_info *elf,
865 Elf_Shdr *sechdr) 865 Elf_Shdr *sechdr)
866{ 866{
867 const char *sec = sech_name(elf, sechdr); 867 const char *sec = sech_name(elf, sechdr);
868 868
@@ -1296,12 +1296,12 @@ static void print_section_list(const char * const list[20])
1296 */ 1296 */
1297static void report_sec_mismatch(const char *modname, 1297static void report_sec_mismatch(const char *modname,
1298 const struct sectioncheck *mismatch, 1298 const struct sectioncheck *mismatch,
1299 const char *fromsec, 1299 const char *fromsec,
1300 unsigned long long fromaddr, 1300 unsigned long long fromaddr,
1301 const char *fromsym, 1301 const char *fromsym,
1302 int from_is_func, 1302 int from_is_func,
1303 const char *tosec, const char *tosym, 1303 const char *tosec, const char *tosym,
1304 int to_is_func) 1304 int to_is_func)
1305{ 1305{
1306 const char *from, *from_p; 1306 const char *from, *from_p;
1307 const char *to, *to_p; 1307 const char *to, *to_p;
@@ -1441,7 +1441,7 @@ static void report_sec_mismatch(const char *modname,
1441} 1441}
1442 1442
1443static void check_section_mismatch(const char *modname, struct elf_info *elf, 1443static void check_section_mismatch(const char *modname, struct elf_info *elf,
1444 Elf_Rela *r, Elf_Sym *sym, const char *fromsec) 1444 Elf_Rela *r, Elf_Sym *sym, const char *fromsec)
1445{ 1445{
1446 const char *tosec; 1446 const char *tosec;
1447 const struct sectioncheck *mismatch; 1447 const struct sectioncheck *mismatch;
@@ -1528,7 +1528,7 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1528 case R_ARM_ABS32: 1528 case R_ARM_ABS32:
1529 /* From ARM ABI: (S + A) | T */ 1529 /* From ARM ABI: (S + A) | T */
1530 r->r_addend = (int)(long) 1530 r->r_addend = (int)(long)
1531 (elf->symtab_start + ELF_R_SYM(r->r_info)); 1531 (elf->symtab_start + ELF_R_SYM(r->r_info));
1532 break; 1532 break;
1533 case R_ARM_PC24: 1533 case R_ARM_PC24:
1534 case R_ARM_CALL: 1534 case R_ARM_CALL:
@@ -1538,8 +1538,8 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1538 case R_ARM_THM_JUMP19: 1538 case R_ARM_THM_JUMP19:
1539 /* From ARM ABI: ((S + A) | T) - P */ 1539 /* From ARM ABI: ((S + A) | T) - P */
1540 r->r_addend = (int)(long)(elf->hdr + 1540 r->r_addend = (int)(long)(elf->hdr +
1541 sechdr->sh_offset + 1541 sechdr->sh_offset +
1542 (r->r_offset - sechdr->sh_addr)); 1542 (r->r_offset - sechdr->sh_addr));
1543 break; 1543 break;
1544 default: 1544 default:
1545 return 1; 1545 return 1;
@@ -1571,7 +1571,7 @@ static int addend_mips_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1571} 1571}
1572 1572
1573static void section_rela(const char *modname, struct elf_info *elf, 1573static void section_rela(const char *modname, struct elf_info *elf,
1574 Elf_Shdr *sechdr) 1574 Elf_Shdr *sechdr)
1575{ 1575{
1576 Elf_Sym *sym; 1576 Elf_Sym *sym;
1577 Elf_Rela *rela; 1577 Elf_Rela *rela;
@@ -1615,7 +1615,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
1615} 1615}
1616 1616
1617static void section_rel(const char *modname, struct elf_info *elf, 1617static void section_rel(const char *modname, struct elf_info *elf,
1618 Elf_Shdr *sechdr) 1618 Elf_Shdr *sechdr)
1619{ 1619{
1620 Elf_Sym *sym; 1620 Elf_Sym *sym;
1621 Elf_Rel *rel; 1621 Elf_Rel *rel;
@@ -1685,7 +1685,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
1685 * be discarded and warns about it. 1685 * be discarded and warns about it.
1686 **/ 1686 **/
1687static void check_sec_ref(struct module *mod, const char *modname, 1687static void check_sec_ref(struct module *mod, const char *modname,
1688 struct elf_info *elf) 1688 struct elf_info *elf)
1689{ 1689{
1690 int i; 1690 int i;
1691 Elf_Shdr *sechdrs = elf->sechdrs; 1691 Elf_Shdr *sechdrs = elf->sechdrs;
@@ -1945,7 +1945,7 @@ static int add_versions(struct buffer *b, struct module *mod)
1945 s->name, mod->name); 1945 s->name, mod->name);
1946 } else { 1946 } else {
1947 merror("\"%s\" [%s.ko] undefined!\n", 1947 merror("\"%s\" [%s.ko] undefined!\n",
1948 s->name, mod->name); 1948 s->name, mod->name);
1949 err = 1; 1949 err = 1;
1950 } 1950 }
1951 } 1951 }
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index deb2994b04c4..944418da9fe3 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -214,7 +214,7 @@ static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len)
214 mctx->block[14] = mctx->byte_count << 3; 214 mctx->block[14] = mctx->byte_count << 3;
215 mctx->block[15] = mctx->byte_count >> 29; 215 mctx->block[15] = mctx->byte_count >> 29;
216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - 216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
217 sizeof(uint64_t)) / sizeof(uint32_t)); 217 sizeof(uint64_t)) / sizeof(uint32_t));
218 md4_transform(mctx->hash, mctx->block); 218 md4_transform(mctx->hash, mctx->block);
219 cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t)); 219 cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t));
220 220
@@ -367,7 +367,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
367 break; 367 break;
368 /* Terminate line at first space, to get rid of final ' \' */ 368 /* Terminate line at first space, to get rid of final ' \' */
369 while (*p) { 369 while (*p) {
370 if (isspace(*p)) { 370 if (isspace(*p)) {
371 *p = '\0'; 371 *p = '\0';
372 break; 372 break;
373 } 373 }