From f9242eb1ae6e140e125cc147025d071d729adb29 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 25 Mar 2014 16:29:07 +0000 Subject: [PATCH] scripts: Merge r5177:5337 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@5373 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/blockdev-perftest | 12 +++++----- scripts/generate-kernel-patch | 16 ++++++++++---- scripts/kernel-functions | 41 +++++++++++++++++++++++++++++++++++ scripts/list-source-files | 8 ++++++- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/scripts/blockdev-perftest b/scripts/blockdev-perftest index 4b1db9a1b..db240ef36 100755 --- a/scripts/blockdev-perftest +++ b/scripts/blockdev-perftest @@ -76,11 +76,11 @@ set_frequency_scaling() { if [ ! -e $syscpu/cpufreq ]; then return fi - local governor=$(<$syscpu/cpu0/cpufreq/scaling_governor) - local cpuinfo_min_freq=$(<$syscpu/cpu0/cpufreq/cpuinfo_min_freq) - local cpuinfo_max_freq=$(<$syscpu/cpu0/cpufreq/cpuinfo_max_freq) - local scaling_min_freq=$(<$syscpu/cpu0/cpufreq/scaling_min_freq) - local scaling_max_freq=$(<$syscpu/cpu0/cpufreq/scaling_max_freq) + local governor=$(cat $syscpu/cpu0/cpufreq/scaling_governor) + local cpuinfo_min_freq=$(cat $syscpu/cpu0/cpufreq/cpuinfo_min_freq) + local cpuinfo_max_freq=$(cat $syscpu/cpu0/cpufreq/cpuinfo_max_freq) + local scaling_min_freq=$(cat $syscpu/cpu0/cpufreq/scaling_min_freq) + local scaling_max_freq=$(cat $syscpu/cpu0/cpufreq/scaling_max_freq) if [ -w $syscpu/cpu0/cpufreq/scaling_governor ]; then for d in $syscpu/cpu*/cpufreq do @@ -210,7 +210,7 @@ if [ "${perform_write_test}" = "true" -a ! -w "${device}" ]; then fi if [ "${perform_read_test}" = "true" -a \ - "$(($(" "3.7.10" ]; - then echo iscsi-scst/kernel/patches/*-3.7.10.patch; - else echo iscsi-scst/kernel/patches/*-${kver}.patch; fi) + $(if [ ${kver} = 3.7 ] && [ "${1#3.7.}" -ge 10 ]; then + echo iscsi-scst/kernel/patches/*-3.7.10.patch; + elif [ ${kver} = 3.10 ] && [ "${1#3.10.}" -ge 30 ]; then + echo iscsi-scst/kernel/patches/*-3.10.30.patch; + elif [ ${kver} = 3.12 ] && [ "${1#3.12.}" -ge 11 ]; then + echo iscsi-scst/kernel/patches/*-3.12.11.patch; + elif [ ${kver} = 3.13 ] && [ "${1#3.13.}" -ge 3 ]; then + echo iscsi-scst/kernel/patches/*-3.13.3.patch; + else + echo iscsi-scst/kernel/patches/*-${kver}.patch; + fi) do # Exclude the put_page_callback patch when command-line option -u has been # specified since the current approach is not considered acceptable for diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 7bfdf7133..58751563f 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -174,6 +174,47 @@ Get rid of sparse errors on sk_buff.protocol. #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) EOF fi + if [ "${1#3.13}" != "$1" ]; then + if [ "$1" = "3.13" ] || [ "${1#3.13.}" -lt 6 ]; then + patch -f -s -p1 <<'EOF' +From 7b4ec8dd7d4ac467e9eee4d49f2c9574d773efbb Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 16 Jan 2014 10:18:48 +1030 +Subject: [PATCH] export: declare ksymtab symbols + +sparse complains about any __ksymtab symbols with the following: + + warning: symbol '__ksymtab_...' was not declared. Should it be static? + +due to Andi's patch making it non-static. + +Mollify sparse by declaring the symbol extern, otherwise we get +drowned in sparse warnings for anything that uses EXPORT_SYMBOL +in the sources, making it easy to miss real warnings. + +Fixes: e0f244c63fc9 ("asmlinkage, module: Make ksymtab [...] __visible") +Signed-off-by: Johannes Berg +Acked-by: Andi Kleen +Signed-off-by: Rusty Russell +--- + include/linux/export.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/linux/export.h b/include/linux/export.h +index 3f2793d..96e45ea 100644 +--- a/include/linux/export.h ++++ b/include/linux/export.h +@@ -59,6 +59,7 @@ extern struct module __this_module; + static const char __kstrtab_##sym[] \ + __attribute__((section("__ksymtab_strings"), aligned(1))) \ + = VMLINUX_SYMBOL_STR(sym); \ ++ extern const struct kernel_symbol __ksymtab_##sym; \ + __visible const struct kernel_symbol __ksymtab_##sym \ + __used \ + __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ +EOF + fi + fi ) rmdir "${tmpdir}" } diff --git a/scripts/list-source-files b/scripts/list-source-files index a14307b3b..4a2eed863 100755 --- a/scripts/list-source-files +++ b/scripts/list-source-files @@ -29,7 +29,13 @@ list_source_files() { echo "Ignored directory $1" >&2 fi elif [ -e "$r/.hg" ]; then - hg manifest + subdir="${d#${r}}" + if [ -n "${subdir}" ]; then + subdir="${subdir#/}/" + hg manifest | sed -n "s|^$subdir||p" + else + hg manifest + fi else echo "Not under source control: $1 ?" >&2 fi