From f5a82137a53f4dbb61a1739c750c7cc22a4983e9 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Wed, 23 Oct 2013 15:08:44 +0200 Subject: [PATCH 1/5] scripts/tags.sh: Increase identifier list Add __maybe_unused __always_unused __cacheline_aligned __cacheline_aligned_in_smp ACPI_EXPORT_SYMBOL to the list. Signed-off-by: Kirill Tkhai Signed-off-by: Andrew Morton Signed-off-by: Michal Marek --- scripts/tags.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index 74f02e4dddd2..f1bcfc11cc72 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -151,13 +151,14 @@ exuberant() all_target_sources | xargs $1 -a \ -I __initdata,__exitdata,__initconst,__devinitdata \ -I __devinitconst,__cpuinitdata,__initdata_memblock \ - -I __refdata,__attribute \ + -I __refdata,__attribute,__maybe_unused,__always_unused \ -I __acquires,__releases,__deprecated \ -I __read_mostly,__aligned,____cacheline_aligned \ -I ____cacheline_aligned_in_smp \ + -I __cacheline_aligned,__cacheline_aligned_in_smp \ -I ____cacheline_internodealigned_in_smp \ -I __used,__packed,__packed2__,__must_check,__must_hold \ - -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ + -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \ -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ -I static,const \ --extra=+f --c-kinds=+px \ From a690876385f29c740798cb99aa2511217ecd9954 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 15 Aug 2013 12:30:25 +0200 Subject: [PATCH 2/5] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci Use of this function is discouraged in favour of devm_ioremap_resource(). Don't advertise it. Signed-off-by: Wolfram Sang Acked-by: Julia Lawall Signed-off-by: Michal Marek --- .../api/devm_request_and_ioremap.cocci | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 scripts/coccinelle/api/devm_request_and_ioremap.cocci diff --git a/scripts/coccinelle/api/devm_request_and_ioremap.cocci b/scripts/coccinelle/api/devm_request_and_ioremap.cocci deleted file mode 100644 index 562ec88b6352..000000000000 --- a/scripts/coccinelle/api/devm_request_and_ioremap.cocci +++ /dev/null @@ -1,105 +0,0 @@ -/// Reimplement a call to devm_request_mem_region followed by a call to ioremap -/// or ioremap_nocache by a call to devm_request_and_ioremap. -/// Devm_request_and_ioremap was introduced in -/// 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0. It makes the code much more -/// concise. -/// -/// -// Confidence: High -// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Comments: -// Options: --no-includes --include-headers - -virtual patch -virtual org -virtual report -virtual context - -@nm@ -expression myname; -identifier i; -@@ - -struct platform_driver i = { .driver = { .name = myname } }; - -@depends on patch@ -expression dev,res,size; -@@ - --if (!devm_request_mem_region(dev, res->start, size, -- \(res->name\|dev_name(dev)\))) { -- ... -- return ...; --} -... when != res->start -( --devm_ioremap(dev,res->start,size) -+devm_request_and_ioremap(dev,res) -| --devm_ioremap_nocache(dev,res->start,size) -+devm_request_and_ioremap(dev,res) -) -... when any - when != res->start - -// this rule is separate from the previous one, because a single file can -// have multiple values of myname -@depends on patch@ -expression dev,res,size; -expression nm.myname; -@@ - --if (!devm_request_mem_region(dev, res->start, size,myname)) { -- ... -- return ...; --} -... when != res->start -( --devm_ioremap(dev,res->start,size) -+devm_request_and_ioremap(dev,res) -| --devm_ioremap_nocache(dev,res->start,size) -+devm_request_and_ioremap(dev,res) -) -... when any - when != res->start - - -@pb depends on org || report || context@ -expression dev,res,size; -expression nm.myname; -position p1,p2; -@@ - -*if - (!devm_request_mem_region@p1(dev, res->start, size, - \(res->name\|dev_name(dev)\|myname\))) { - ... - return ...; -} -... when != res->start -( -*devm_ioremap@p2(dev,res->start,size) -| -*devm_ioremap_nocache@p2(dev,res->start,size) -) -... when any - when != res->start - -@script:python depends on org@ -p1 << pb.p1; -p2 << pb.p2; -@@ - -cocci.print_main("INFO: replace by devm_request_and_ioremap",p1) -cocci.print_secs("",p2) - -@script:python depends on report@ -p1 << pb.p1; -p2 << pb.p2; -@@ - -msg = "INFO: devm_request_mem_region followed by ioremap on line %s can be replaced by devm_request_and_ioremap" % (p2[0].line) -coccilib.report.print_report(p1[0],msg) From f29b5f3e6fc0a8b7a1c3f626d09bfa17ccb61f99 Mon Sep 17 00:00:00 2001 From: Mike Pagano Date: Wed, 9 Oct 2013 10:36:42 -0400 Subject: [PATCH 3/5] show_delta: Update script to support python versions 2.5 through 3.3 Support past and active versions of python while maintaining backward compatibility. Script has been tested on python versions from 2.5.x up to and including 3.3.x. Signed-off-by: Mike Pagano Signed-off-by: Michal Marek --- scripts/show_delta | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/show_delta b/scripts/show_delta index 17df3051747a..e25732b5d701 100755 --- a/scripts/show_delta +++ b/scripts/show_delta @@ -13,7 +13,7 @@ import sys import string def usage(): - print """usage: show_delta [] + print ("""usage: show_delta [] This program parses the output from a set of printk message lines which have time data prefixed because the CONFIG_PRINTK_TIME option is set, or @@ -35,7 +35,7 @@ ex: $ dmesg >timefile will show times relative to the line in the kernel output starting with "NET4". -""" +""") sys.exit(1) # returns a tuple containing the seconds and text for each message line @@ -94,11 +94,11 @@ def main(): try: lines = open(filein,"r").readlines() except: - print "Problem opening file: %s" % filein + print ("Problem opening file: %s" % filein) sys.exit(1) if base_str: - print 'base= "%s"' % base_str + print ('base= "%s"' % base_str) # assume a numeric base. If that fails, try searching # for a matching line. try: @@ -117,13 +117,13 @@ def main(): # stop at first match break if not found: - print 'Couldn\'t find line matching base pattern "%s"' % base_str + print ('Couldn\'t find line matching base pattern "%s"' % base_str) sys.exit(1) else: base_time = 0.0 for line in lines: - print convert_line(line, base_time), + print (convert_line(line, base_time),) main() From 9645ae84ef52d61bc48732a25e57554fc1a9754a Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 17 Oct 2013 16:32:01 -0700 Subject: [PATCH 4/5] scripts/kernel-doc: make unknown function prototype a Warning instead of an Error When scripts/kernel-doc cannot understand a function prototype, it had been generating a fatal error and stopping immediately. Make this a Warning instead of an Error and keep going. Note that this can happen if the kernel-doc notation that is being parsed is not actually a function prototype; maybe it's a struct or something else, so I added "function" to the warning message to try to make it clearer that scripts/kernel-doc is looking for a function prototype here. Signed-off-by: Randy Dunlap Cc: Mark Brown Signed-off-by: Michal Marek --- scripts/kernel-doc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4305b2f2ec5e..16e8b50c8fcb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2125,8 +2125,7 @@ sub dump_function($$) { create_parameterlist($args, ',', $file); } else { - print STDERR "Error(${file}:$.): cannot understand prototype: '$prototype'\n"; - ++$errors; + print STDERR "Warning(${file}:$.): cannot understand function prototype: '$prototype'\n"; return; } From 6cf3a6eff77273a55b996a5a43f342b150cfba09 Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Thu, 7 Nov 2013 12:09:51 +1100 Subject: [PATCH 5/5] scripts/tags.sh: remove obsolete __devinit[const|data] This removes the use of __devinitconst and __devinitdata in scripts/tags.sh, which were removed in 3.8. Signed-off-by: Michael Opdenacker Cc: Michal Marek Signed-off-by: Andrew Morton Signed-off-by: Michal Marek --- scripts/tags.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index f1bcfc11cc72..58c455929091 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -149,8 +149,8 @@ dogtags() exuberant() { all_target_sources | xargs $1 -a \ - -I __initdata,__exitdata,__initconst,__devinitdata \ - -I __devinitconst,__cpuinitdata,__initdata_memblock \ + -I __initdata,__exitdata,__initconst, \ + -I __cpuinitdata,__initdata_memblock \ -I __refdata,__attribute,__maybe_unused,__always_unused \ -I __acquires,__releases,__deprecated \ -I __read_mostly,__aligned,____cacheline_aligned \