From 4f9879f6c6454f255cb81b7a34dd35e355679f4b Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Wed, 10 Jul 2013 23:33:38 +0530 Subject: scripts: remove unused function in sortextable.c Signed-off-by: Ramkumar Ramachandra Acked-by: David Daney Signed-off-by: Michal Marek --- scripts/sortextable.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'scripts') diff --git a/scripts/sortextable.c b/scripts/sortextable.c index f9ce1160419b..7c2310c5b996 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c @@ -64,14 +64,6 @@ fail_file(void) longjmp(jmpenv, SJ_FAIL); } -static void __attribute__((noreturn)) -succeed_file(void) -{ - cleanup(); - longjmp(jmpenv, SJ_SUCCEED); -} - - /* * Get the whole file as a programming convenience in order to avoid * malloc+lseek+read+free of many pieces. If successful, then mmap -- cgit v1.2.3 From 46b5c9b856e8bcb44d8570cc55c46d19ca2428ff Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Sun, 11 Aug 2013 21:05:12 +0000 Subject: coccinelle: replace 0/1 with false/true in functions returning bool This semantic patch replaces "return {0,1};" with "return {false,true};" in functions returning bool. Signed-off-by: Rasmus Villemoes Acked-by: Julia Lawall Signed-off-by: Michal Marek --- scripts/coccinelle/misc/boolreturn.cocci | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 scripts/coccinelle/misc/boolreturn.cocci (limited to 'scripts') diff --git a/scripts/coccinelle/misc/boolreturn.cocci b/scripts/coccinelle/misc/boolreturn.cocci new file mode 100644 index 000000000000..a43c7b0c36ef --- /dev/null +++ b/scripts/coccinelle/misc/boolreturn.cocci @@ -0,0 +1,58 @@ +/// Return statements in functions returning bool should use +/// true/false instead of 1/0. +// +// Confidence: High +// Options: --no-includes --include-headers + +virtual patch +virtual report +virtual context + +@r1 depends on patch@ +identifier fn; +typedef bool; +symbol false; +symbol true; +@@ + +bool fn ( ... ) +{ +<... +return +( +- 0 ++ false +| +- 1 ++ true +) + ; +...> +} + +@r2 depends on report || context@ +identifier fn; +position p; +@@ + +bool fn ( ... ) +{ +<... +return +( +* 0@p +| +* 1@p +) + ; +...> +} + + +@script:python depends on report@ +p << r2.p; +fn << r2.fn; +@@ + +msg = "WARNING: return of 0/1 in function '%s' with return type bool" % fn +coccilib.report.print_report(p[0], msg) -- cgit v1.2.3