diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.fwinst | 4 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 2 | ||||
-rw-r--r-- | scripts/coccinelle/api/memdup_user.cocci | 4 | ||||
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 50 | ||||
-rw-r--r-- | scripts/recordmcount.h | 4 | ||||
-rw-r--r-- | scripts/sortextable.c | 10 |
6 files changed, 37 insertions, 37 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index c3f69ae2..4d908d1 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst @@ -27,7 +27,7 @@ endif installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) -installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. +installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs @@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) $(installed-fw-dirs): $(call cmd,mkdir) -$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%) +$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) $(call cmd,install) PHONY += __fw_install __fw_modinst FORCE diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index d24810f..fd8fa9a 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh @@ -200,7 +200,7 @@ EOF syscall_list() { grep '^[0-9]' "$1" | sort -n | ( while read nr abi name entry ; do - echo <<EOF + cat <<EOF #if !defined(__NR_${name}) && !defined(__IGNORE_${name}) #warning syscall ${name} not implemented #endif diff --git a/scripts/coccinelle/api/memdup_user.cocci b/scripts/coccinelle/api/memdup_user.cocci index 2efac28..2b131a8 100644 --- a/scripts/coccinelle/api/memdup_user.cocci +++ b/scripts/coccinelle/api/memdup_user.cocci @@ -51,10 +51,10 @@ statement S1,S2; p << r.p; @@ -coccilib.org.print_todo(p[0], "WARNING opportunity for memdep_user") +coccilib.org.print_todo(p[0], "WARNING opportunity for memdup_user") @script:python depends on report@ p << r.p; @@ -coccilib.report.print_report(p[0], "WARNING opportunity for memdep_user") +coccilib.report.print_report(p[0], "WARNING opportunity for memdup_user") diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 2fbbbc1..3368939 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -100,7 +100,7 @@ my @searchconfigs = ( }, ); -sub find_config { +sub read_config { foreach my $conf (@searchconfigs) { my $file = $conf->{"file"}; @@ -115,17 +115,15 @@ sub find_config { print STDERR "using config: '$file'\n"; - open(CIN, "$exec $file |") || die "Failed to run $exec $file"; - return; + open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file"; + my @x = <$infile>; + close $infile; + return @x; } die "No config file found"; } -find_config; - -# Read in the entire config file into config_file -my @config_file = <CIN>; -close CIN; +my @config_file = read_config; # Parse options my $localmodconfig = 0; @@ -135,7 +133,7 @@ GetOptions("localmodconfig" => \$localmodconfig, "localyesconfig" => \$localyesconfig); # Get the build source and top level Kconfig file (passed in) -my $ksource = $ARGV[0]; +my $ksource = ($ARGV[0] ? $ARGV[0] : '.'); my $kconfig = $ARGV[1]; my $lsmod_file = $ENV{'LSMOD'}; @@ -173,8 +171,8 @@ sub read_kconfig { $source =~ s/\$$env/$ENV{$env}/; } - open(KIN, "$source") || die "Can't open $kconfig"; - while (<KIN>) { + open(my $kinfile, '<', $source) || die "Can't open $kconfig"; + while (<$kinfile>) { chomp; # Make sure that lines ending with \ continue @@ -251,10 +249,10 @@ sub read_kconfig { $state = "NONE"; } } - close(KIN); + close($kinfile); # read in any configs that were found. - foreach $kconfig (@kconfigs) { + foreach my $kconfig (@kconfigs) { if (!defined($read_kconfigs{$kconfig})) { $read_kconfigs{$kconfig} = 1; read_kconfig($kconfig); @@ -295,8 +293,8 @@ foreach my $makefile (@makefiles) { my $line = ""; my %make_vars; - open(MIN,$makefile) || die "Can't open $makefile"; - while (<MIN>) { + open(my $infile, '<', $makefile) || die "Can't open $makefile"; + while (<$infile>) { # if this line ends with a backslash, continue chomp; if (/^(.*)\\$/) { @@ -343,10 +341,11 @@ foreach my $makefile (@makefiles) { } } } - close(MIN); + close($infile); } my %modules; +my $linfile; if (defined($lsmod_file)) { if ( ! -f $lsmod_file) { @@ -356,13 +355,10 @@ if (defined($lsmod_file)) { die "$lsmod_file not found"; } } - if ( -x $lsmod_file) { - # the file is executable, run it - open(LIN, "$lsmod_file|"); - } else { - # Just read the contents - open(LIN, "$lsmod_file"); - } + + my $otype = ( -x $lsmod_file) ? '-|' : '<'; + open($linfile, $otype, $lsmod_file); + } else { # see what modules are loaded on this system @@ -379,16 +375,16 @@ if (defined($lsmod_file)) { $lsmod = "lsmod"; } - open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod"; + open($linfile, '-|', $lsmod) || die "Can not call lsmod with $lsmod"; } -while (<LIN>) { +while (<$linfile>) { next if (/^Module/); # Skip the first line. if (/^(\S+)/) { $modules{$1} = 1; } } -close (LIN); +close ($linfile); # add to the configs hash all configs that are needed to enable # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o @@ -605,6 +601,8 @@ foreach my $line (@config_file) { if (defined($configs{$1})) { if ($localyesconfig) { $setconfigs{$1} = 'y'; + print "$1=y\n"; + next; } else { $setconfigs{$1} = $2; } diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 54e35c1..9d1421e 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h @@ -261,11 +261,13 @@ static unsigned get_mcountsym(Elf_Sym const *const sym0, &sym0[Elf_r_sym(relp)]; char const *symname = &str0[w(symp->st_name)]; char const *mcount = gpfx == '_' ? "_mcount" : "mcount"; + char const *fentry = "__fentry__"; if (symname[0] == '.') ++symname; /* ppc64 hack */ if (strcmp(mcount, symname) == 0 || - (altmcount && strcmp(altmcount, symname) == 0)) + (altmcount && strcmp(altmcount, symname) == 0) || + (strcmp(fentry, symname) == 0)) mcountsym = Elf_r_sym(relp); return mcountsym; diff --git a/scripts/sortextable.c b/scripts/sortextable.c index 6acf834..f19ddc4 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c @@ -161,7 +161,7 @@ typedef void (*table_sort_t)(char *, int); #define SORTEXTABLE_64 #include "sortextable.h" -static int compare_x86_table(const void *a, const void *b) +static int compare_relative_table(const void *a, const void *b) { int32_t av = (int32_t)r(a); int32_t bv = (int32_t)r(b); @@ -173,7 +173,7 @@ static int compare_x86_table(const void *a, const void *b) return 0; } -static void sort_x86_table(char *extab_image, int image_size) +static void sort_relative_table(char *extab_image, int image_size) { int i; @@ -188,7 +188,7 @@ static void sort_x86_table(char *extab_image, int image_size) i += 4; } - qsort(extab_image, image_size / 8, 8, compare_x86_table); + qsort(extab_image, image_size / 8, 8, compare_relative_table); /* Now denormalize. */ i = 0; @@ -245,9 +245,9 @@ do_file(char const *const fname) break; case EM_386: case EM_X86_64: - custom_sort = sort_x86_table; - break; case EM_S390: + custom_sort = sort_relative_table; + break; case EM_MIPS: break; } /* end switch */ |