aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl8
-rw-r--r--scripts/kconfig/symbol.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 90b54d4697fd..e3c7fc0dca38 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2794,12 +2794,8 @@ sub process {
2794 WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); 2794 WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
2795 } 2795 }
2796 2796
2797# check for semaphores used as mutexes 2797# check for semaphores initialized locked
2798 if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) { 2798 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
2799 WARN("mutexes are preferred for single holder semaphores\n" . $herecurr);
2800 }
2801# check for semaphores used as mutexes
2802 if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) {
2803 WARN("consider using a completion\n" . $herecurr); 2799 WARN("consider using a completion\n" . $herecurr);
2804 2800
2805 } 2801 }
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index c0efe102d655..af6e9f3de950 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -875,7 +875,7 @@ const char *sym_expand_string_value(const char *in)
875 symval = sym_get_string_value(sym); 875 symval = sym_get_string_value(sym);
876 } 876 }
877 877
878 newlen = strlen(res) + strlen(symval) + strlen(src); 878 newlen = strlen(res) + strlen(symval) + strlen(src) + 1;
879 if (newlen > reslen) { 879 if (newlen > reslen) {
880 reslen = newlen; 880 reslen = newlen;
881 res = realloc(res, reslen); 881 res = realloc(res, reslen);