diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-05-25 02:38:26 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-25 02:38:26 -0400 |
commit | b1e50ebcf24668e57f058deb48b0704b5391ed0f (patch) | |
tree | 17e1b69b249d0738317b732186340c9dd053f1a1 /scripts | |
parent | 0c2a2ae32793e3500a15a449612485f5d17dd431 (diff) | |
parent | 7e125f7b9cbfce4101191b8076d606c517a73066 (diff) |
Merge remote branch 'origin' into secretlab/next-spi
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.lib | 4 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 11 | ||||
-rw-r--r-- | scripts/kconfig/util.c | 2 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 57 | ||||
-rwxr-xr-x | scripts/package/mkspec | 2 | ||||
-rw-r--r-- | scripts/selinux/genheaders/genheaders.c | 2 |
6 files changed, 75 insertions, 3 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f9bdf264473d..cbcd654215e6 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -245,3 +245,7 @@ quiet_cmd_lzo = LZO $@ | |||
245 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ | 245 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ |
246 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | 246 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ |
247 | (rm -f $@ ; false) | 247 | (rm -f $@ ; false) |
248 | |||
249 | # misc stuff | ||
250 | # --------------------------------------------------------------------------- | ||
251 | quote:=" | ||
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a4d74344d805..f2bbea900700 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2656,6 +2656,7 @@ sub process { | |||
2656 | # check for semaphores used as mutexes | 2656 | # check for semaphores used as mutexes |
2657 | if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { | 2657 | if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { |
2658 | WARN("consider using a completion\n" . $herecurr); | 2658 | WARN("consider using a completion\n" . $herecurr); |
2659 | |||
2659 | } | 2660 | } |
2660 | # recommend strict_strto* over simple_strto* | 2661 | # recommend strict_strto* over simple_strto* |
2661 | if ($line =~ /\bsimple_(strto.*?)\s*\(/) { | 2662 | if ($line =~ /\bsimple_(strto.*?)\s*\(/) { |
@@ -2740,6 +2741,16 @@ sub process { | |||
2740 | WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); | 2741 | WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); |
2741 | } | 2742 | } |
2742 | } | 2743 | } |
2744 | |||
2745 | # check for lockdep_set_novalidate_class | ||
2746 | if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || | ||
2747 | $line =~ /__lockdep_no_validate__\s*\)/ ) { | ||
2748 | if ($realfile !~ m@^kernel/lockdep@ && | ||
2749 | $realfile !~ m@^include/linux/lockdep@ && | ||
2750 | $realfile !~ m@^drivers/base/core@) { | ||
2751 | ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr); | ||
2752 | } | ||
2753 | } | ||
2743 | } | 2754 | } |
2744 | 2755 | ||
2745 | # If we have no input at all, then there is nothing to report on | 2756 | # If we have no input at all, then there is nothing to report on |
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index b6b2a46af14c..25d1ec4ca28a 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -72,7 +72,7 @@ int file_write_dep(const char *name) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
75 | /* Allocate initial growable sting */ | 75 | /* Allocate initial growable string */ |
76 | struct gstr str_new(void) | 76 | struct gstr str_new(void) |
77 | { | 77 | { |
78 | struct gstr gs; | 78 | struct gstr gs; |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 220213e603db..5758aab0d8bb 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -796,6 +796,51 @@ static int do_platform_entry(const char *filename, | |||
796 | return 1; | 796 | return 1; |
797 | } | 797 | } |
798 | 798 | ||
799 | static int do_mdio_entry(const char *filename, | ||
800 | struct mdio_device_id *id, char *alias) | ||
801 | { | ||
802 | int i; | ||
803 | |||
804 | alias += sprintf(alias, MDIO_MODULE_PREFIX); | ||
805 | |||
806 | for (i = 0; i < 32; i++) { | ||
807 | if (!((id->phy_id_mask >> (31-i)) & 1)) | ||
808 | *(alias++) = '?'; | ||
809 | else if ((id->phy_id >> (31-i)) & 1) | ||
810 | *(alias++) = '1'; | ||
811 | else | ||
812 | *(alias++) = '0'; | ||
813 | } | ||
814 | |||
815 | /* Terminate the string */ | ||
816 | *alias = 0; | ||
817 | |||
818 | return 1; | ||
819 | } | ||
820 | |||
821 | /* Looks like: zorro:iN. */ | ||
822 | static int do_zorro_entry(const char *filename, struct zorro_device_id *id, | ||
823 | char *alias) | ||
824 | { | ||
825 | id->id = TO_NATIVE(id->id); | ||
826 | strcpy(alias, "zorro:"); | ||
827 | ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id); | ||
828 | return 1; | ||
829 | } | ||
830 | |||
831 | /* looks like: "pnp:dD" */ | ||
832 | static int do_isapnp_entry(const char *filename, | ||
833 | struct isapnp_device_id *id, char *alias) | ||
834 | { | ||
835 | sprintf(alias, "pnp:d%c%c%c%x%x%x%x*", | ||
836 | 'A' + ((id->vendor >> 2) & 0x3f) - 1, | ||
837 | 'A' + (((id->vendor & 3) << 3) | ((id->vendor >> 13) & 7)) - 1, | ||
838 | 'A' + ((id->vendor >> 8) & 0x1f) - 1, | ||
839 | (id->function >> 4) & 0x0f, id->function & 0x0f, | ||
840 | (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f); | ||
841 | return 1; | ||
842 | } | ||
843 | |||
799 | /* Ignore any prefix, eg. some architectures prepend _ */ | 844 | /* Ignore any prefix, eg. some architectures prepend _ */ |
800 | static inline int sym_is(const char *symbol, const char *name) | 845 | static inline int sym_is(const char *symbol, const char *name) |
801 | { | 846 | { |
@@ -943,6 +988,18 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
943 | do_table(symval, sym->st_size, | 988 | do_table(symval, sym->st_size, |
944 | sizeof(struct platform_device_id), "platform", | 989 | sizeof(struct platform_device_id), "platform", |
945 | do_platform_entry, mod); | 990 | do_platform_entry, mod); |
991 | else if (sym_is(symname, "__mod_mdio_device_table")) | ||
992 | do_table(symval, sym->st_size, | ||
993 | sizeof(struct mdio_device_id), "mdio", | ||
994 | do_mdio_entry, mod); | ||
995 | else if (sym_is(symname, "__mod_zorro_device_table")) | ||
996 | do_table(symval, sym->st_size, | ||
997 | sizeof(struct zorro_device_id), "zorro", | ||
998 | do_zorro_entry, mod); | ||
999 | else if (sym_is(symname, "__mod_isapnp_device_table")) | ||
1000 | do_table(symval, sym->st_size, | ||
1001 | sizeof(struct isapnp_device_id), "isa", | ||
1002 | do_isapnp_entry, mod); | ||
946 | free(zeros); | 1003 | free(zeros); |
947 | } | 1004 | } |
948 | 1005 | ||
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 47bdd2f99b78..fa27f3dac769 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Output a simple RPM spec file that uses no fancy features requring | 3 | # Output a simple RPM spec file that uses no fancy features requiring |
4 | # RPM v4. This is intended to work with any RPM distro. | 4 | # RPM v4. This is intended to work with any RPM distro. |
5 | # | 5 | # |
6 | # The only gothic bit here is redefining install_post to avoid | 6 | # The only gothic bit here is redefining install_post to avoid |
diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c index 24626968055d..58a12c278706 100644 --- a/scripts/selinux/genheaders/genheaders.c +++ b/scripts/selinux/genheaders/genheaders.c | |||
@@ -81,7 +81,7 @@ int main(int argc, char *argv[]) | |||
81 | fprintf(fout, "\n"); | 81 | fprintf(fout, "\n"); |
82 | 82 | ||
83 | for (i = 1; i < isids_len; i++) { | 83 | for (i = 1; i < isids_len; i++) { |
84 | char *s = initial_sid_to_string[i]; | 84 | const char *s = initial_sid_to_string[i]; |
85 | fprintf(fout, "#define SECINITSID_%s", s); | 85 | fprintf(fout, "#define SECINITSID_%s", s); |
86 | for (j = 0; j < max(1, 40 - strlen(s)); j++) | 86 | for (j = 0; j < max(1, 40 - strlen(s)); j++) |
87 | fprintf(fout, " "); | 87 | fprintf(fout, " "); |