aboutsummaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
AgeCommit message (Collapse)Author
2012-01-10checkpatch: ensure cast type is unique in the context parserAndy Whitcroft
Ensure the cast type is unique in the context parser, we do not want them to detect as a comma ','. Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: fix complex macros handling of square bracketsAndy Whitcroft
Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: fix 'return is not a function' square bracket handlingAndy Whitcroft
We are incorrectly matching square brackets '[' and ']' leading to false positives on more complex functions as below: return (dt3155_fbuffer[m]->ready_head - dt3155_fbuffer[m]->ready_len + dt3155_fbuffer[m]->nbuffers)% (dt3155_fbuffer[m]->nbuffers); Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: complex macro should allow the empty do while loopAndy Whitcroft
It is common to stub out a function as below, this is triggering a complex macro format incorrectly. Sort this out: #define cma_early_regions_reserve(reserve) do { } while (0) Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: fix EXPORT_SYMBOL handling following a functionAndy Whitcroft
The following fragment defeats the DEVICE_ATTR style handing, check for and ignore the close brace '}' in this context: int foo() { } DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR, ata_scsi_lpm_show, ata_scsi_lpm_put); EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy); Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: only apply kconfig help checks for options which promptAndy Whitcroft
The intent of this check is to catch the options which the user will see and ensure they are properly described. It is also common for internal only options to have a brief description. Allow this form. Reported-by: Steven Rostedt <rostedt@goodmis.org> Tested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: optimise statement scanner when mid-statementAndy Whitcroft
In the middle of a long definition or similar, there is no possibility of finding a smaller sub-statement. Optimise this case by skipping statement aquirey where there are no starts of statement (open brace '{' or semi-colon ';'). We are likely to scan slightly more than needed still but this is safest. Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: ## is not a valid modifierAndy Whitcroft
Inserting a # into the modifiers list will incorrectly add the null string to the modifiers list, leading to an infinite loop. As neither of these is a valid modifier form simply ignore them. Signed-off-by: Andy Whitcroft <apw@canonical.com> Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: improve memset and min/max with cast checkingJoe Perches
Improve the checking of arguments to memset and min/max tests. Move the checking of min/max to statement blocks instead of single line. Change $Constant to allow any case type 0x initiator and trailing ul specifier. Add $FuncArg type as any function argument with or without a cast. Print the whole statement when showing memset or min/max messages. Improve the memset with 0 as 3rd argument error message. There are still weaknesses in the $FuncArg and $Constant code as arbitrary parentheses and negative signs are not generically supported. [akpm@linux-foundation.org: fix per Andy] Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: check for common memset parameter issues against statmentsAndy Whitcroft
Move the memset checks over to work against the statement. Also add checks for 0 and 1 used as lengths. Generally these indicate badly ordered parameters. Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: correctly track the end of preprocessor commands in contextAndy Whitcroft
When looking for a statement we currently run on through preprocessor commands. This means that a header file with just definitions is parsed over and over again combining all of the lines from the current line to the end of file leading to severe performance issues. Fix up context accumulation to track preprocessor commands and stop when reaching the end of them. At the same time vastly simplify the #define handling. Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: prefer __printf over __attribute__((format(printf,...)))Joe Perches
Add a warn for not using __printf. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10checkpatch: update signature "might be better as" warningJoe Perches
email header lines can look like signature tags. It's valid to have multiple email recipients on a single line but not valid to have multiple signatures on a single line. Validate signatures only when not in the email headers. Clear the $in_commit_log flag when the patch filename appears. Add '-' to the valid chars in a message header for headers like "Message-Id:" and "In-Reply-To:". Signed-off-by: Joe Perches <joe@perches.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-06Merge branch 'misc' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: script/checkpatch.pl: warn about deprecated use of EXTRA_{A,C,CPP,LD}FLAGS tags, powerpc: Update tags.sh to support _GLOBAL symbols scripts: add extract-vmlinux
2011-10-31checkpatch: add a --strict check for utf-8 in commit logsJoe Perches
Some find using utf-8 in commit logs inappropriate. Some patch commit logs contain unintended utf-8 characters when doing things like copy/pasting compilation output. Look for the start of any commit log by skipping initial lines that look like email headers and "From: " lines. Stop looking for utf-8 at the first signature line. Signed-off-by: Joe Perches <joe@perches.com> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31kernel.h/checkpatch: mark strict_strto<foo> and simple_strto<foo> as obsoleteJoe Perches
Mark obsolete/deprecated strict_strto<foo> and simple_strto<foo> functions and macros as obsolete. Update checkpatch to warn about their use. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-15Merge branch 'master' into for-nextJiri Kosina
Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.
2011-09-15treewide: remove extra semicolons from various parts of the kernelJustin P. Mattock
This is a resend from the original, changing the title from PATCH to RFC(since this is a review for commit, and I should have put that the first go around). and also removing some of the commit's with ia64 and bash since it is significant. let me know if I might have missed anything etc.. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-08-31script/checkpatch.pl: warn about deprecated use of EXTRA_{A,C,CPP,LD}FLAGSArnaud Lacombe
Usage of these flags has been deprecated for nearly 4 years by: commit f77bf01425b11947eeb3b5b54685212c302741b8 Author: Sam Ravnborg <sam@neptun.(none)> Date: Mon Oct 15 22:25:06 2007 +0200 kbuild: introduce ccflags-y, asflags-y and ldflags-y Moreover, these flags (at least EXTRA_CFLAGS) have been documented for command line use. By default, gmake(1) do not override command line setting, so this is likely to result in build failure or unexpected behavior. Warn about their introduction in Makefile or Kbuild files. Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-08-25checkpatch: add missing WARN argument for min_t and max_t testsHui Zhu
The test for bad usage of min_t() and max_t() is missing the --ignore type. Add it. Signed-off-by: Hui Zhu <teawater@gmail.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch.pl: update $logFunctionsJoe Perches
Previous behavior allowed only alphabetic prefixes like pr_info to exceed the 80 column line length limit. ath6kl wants to add a digit into the prefix, so allow numbers as well as digits in the <prefix>_<level> printks. <prefix>_<level>_ratelimited and <prefix>_<level>_once and WARN_RATELIMIT and WARN_ONCE may now exceed 80 cols. Add missing <prefix>_printk type for completeness. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch: make utf-8 test --strictJoe Perches
Some patches are sent in using ISO-8859 or even Windows codepage 1252. Make checkpatch accept these by default and only emit the "Invalid UTF-8" message when using --strict. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch.pl: add ability to ignore various messagesJoe Perches
Some users would like the ability to not emit some of the messages that checkpatch produces. This can make it easier to use checkpatch in other projects and integrate into scm hook scripts. Add command line option to "--ignore" various message types. Add option --show-types to emit the "type" of each message. Categorize all ERROR, WARN and CHK messages with types. Add optional .checkpatch.conf file to store default options. 3 paths are searched for .checkpatch.conf . customized per-tree configurations $HOME user global configuration when per-tree configs don't exist ./scripts lk defaults to override script The .conf file can contain any valid command-line argument and the contents are prepended to any additional command line arguments. Multiple lines may be used, blank lines are ignored, # is a comment. Update "false positive" output for readability. Update version to 0.32 Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch: add a "prefer __aligned" checkJoe Perches
Prefer the use of __aligned(size) over __attribute__((__aligned___(size))) Link: http://lkml.kernel.org/r/20110609094526.1571774c.akpm@linux-foundation.org Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch: validate signature styles and To: and Cc: linesJoe Perches
Signatures have many forms and can sometimes cause problems if not in the correct format when using git send-email or quilt. Try to verify the signature tags and email addresses to use the generally accepted "Signed-off-by: Full Name <email@domain.tld>" form. Original idea by Anish Kumar <anish198519851985@gmail.com> Signed-off-by: Joe Perches <joe@perches.com> Cc: Anish Kumar <anish198519851985@gmail.com> Cc: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch: add __rcu as a sparse modifierSven Eckelmann
Fix "need consistent spacing around '*'" error after a __rcu sparse annotation which was caused by the missing __rcu entry in the checkpatch.pl internal list of sparse keywords. Signed-off-by: Sven Eckelmann <sven@narfation.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25checkpatch: suggest using min_t or max_tJoe Perches
A common issue with min() or max() is using a cast on one or both of the arguments when using min_t/max_t could be better. Add cast detection to uses of min/max and suggest an appropriate use of min_t or max_t instead. Caveat: This only works for min() or max() on a single line. It does not find min() or max() split across multiple lines. This does find: min((u32)foo, bar); But it does not find: max((unsigned long)foo, bar); Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-15checkpatch: add warning for uses of printk_ratelimitJoe Perches
Warn about uses of printk_ratelimit() because it uses a global state and can hide subsequent useful messages. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25checkpatch: fix defect in printk(KERN_<LEVEL> 80 column exceptionsJoe Perches
Currently, printk lines with a only KERN_PREFIX and a quoted string without a comma or close paren that exceed 80 columns are flagged with a warning. ie: printk(KERN_WARNING "some long string that extends beond 80 cols..." "and is continued on another line\n"); Allow this form instead of emitting a warning. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25checkpatch: add <foo>_<level> and MODULE_<BAR> to 80 column exceptionsJoe Perches
Many module or file local logging functions use specific prefixes other than pr|dev|netdev. Allow all forms like foo_printk and foo_err to be longer than 80 columns. Also allow MODULE_<BAR> declarations to be longer than 80 columns. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25checkpatch: add check for line continuations in quoted stringsJoe Perches
Add a warning for unterminated quoted strings with line continuations as these frequently add unwanted whitespace. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-22checkpatch: warn about memset with swapped argumentsDave Jones
Because the second and third arguments of memset have the same type, it turns out to be really easy to mix them up. This bug comes up time after time, so checkpatch should really be checking for it at patch submission time. Signed-off-by: Dave Jones <davej@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22scripts/checkpatch.pl: reset rpt_cleaners warningsMike Frysinger
If you run checkpatch against multiple patches, and one of them has a whitespace issue which can be helped via a script (rpt_cleaners), you will see the same NOTE over and over for all subsequent patches. It makes it seem like those patches also have whitespace problems when in reality, there's only one or two bad apples. So reset rpt_cleaners back to 0 after we've issued the note so that it only shows up near the patch with the actual problems. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22kstrto*: converting strings to integers done (hopefully) rightAlexey Dobriyan
1. simple_strto*() do not contain overflow checks and crufty, libc way to indicate failure. 2. strict_strto*() also do not have overflow checks but the name and comments pretend they do. 3. Both families have only "long long" and "long" variants, but users want strtou8() 4. Both "simple" and "strict" prefixes are wrong: Simple doesn't exactly say what's so simple, strict should not exist because conversion should be strict by default. The solution is to use "k" prefix and add convertors for more types. Enter kstrtoull() kstrtoll() kstrtoul() kstrtol() kstrtouint() kstrtoint() kstrtou64() kstrtos64() kstrtou32() kstrtos32() kstrtou16() kstrtos16() kstrtou8() kstrtos8() Include runtime testsuite (somewhat incomplete) as well. strict_strto*() become deprecated, stubbed to kstrto*() and eventually will be removed altogether. Use kstrto*() in code today! Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if they'll be unused at runtime. This is temporarily solution, because I don't want to hardcode list of archs where these functions aren't needed. Current solution with sizeof() and __alignof__ at least always works. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-27locking: Remove deprecated lock initializersThomas Gleixner
Last users are gone. Remove the left overs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-01-13checkpatch.pl: add "prefer __packed" checkJoe Perches
There's a __packed #define for __attribute__((packed)). Add a checkpatch to tell people about it. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13checkpatch: check for world-writeable sysfs/debugfs filesDave Jones
Exporting world writable sysfs/debugfs files is usually a bad thing. Warn about it. Signed-off-by: Dave Jones <davej@redhat.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13checkpatch.pl: fix CAST detectionFlorian Mickler
We should only claim that something is a cast if we did not encouter a token before, that did set av_pending. This fixes the operator * in the line below to be detected as binary (vs unary). kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL); Reported-by: Audun Hoem <audun.hoem@gmail.com> Signed-off-by: Florian Mickler <florian@mickler.org> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13scripts/checkpatch.pl: add check for multiple terminating semicolons and ↵Joe Perches
casts of vmalloc Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-30semaphore: Remove mutex emulationThomas Gleixner
Semaphores used as mutexes have been deprecated for years. Now that all users are either converted to real semaphores or to mutexes remove the cruft. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> LKML-Reference: <20100907125057.562399240@linutronix.de>
2010-10-26scripts/checkpatch.pl: add check for declaration of pci_device_idJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26scripts/checkpatch.pl: add warnings for static char that could be static ↵Joe Perches
const char Add warnings for possible missing const uses of static char foo[] = "bar" that could be static const char foo[] = "bar" and static const char *foo[] = {"bar", "baz"} that could be static const char * const foo[] = {"bar", "baz"} Signed-off-by: Joe Perches <joe@perches.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: version 0.31Andy Whitcroft
Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: statement/block context analyser should look at sanitised linesAndy Whitcroft
When tracking context to find a block or statement we need to use the sanitised lines, else perentheses '(' & ')' and braces '{' & '}' can throw the scanner out. Also fix up a couple of error outputs which include those sanitised lines incorrectly. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similarAndy Whitcroft
Handly definitions similar to below. The definition macro spits out a symbol with a prefix. Add matching of any identifier prefix: DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR, ata_scsi_lpm_show, ata_scsi_lpm_put); EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy); Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: clean up structure definition macro handlineAndy Whitcroft
Handle definitions such as the following correctly, it is not a complex statement: #define PREALLOC(NAME, START, END, FLAGS) { \ .name = (NAME), \ .start = (START), \ .end = (END), \ .flags = (FLAGS) \ }, Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: update copyright datesAndy Whitcroft
Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: Add additional attribute #definesJoe Perches
On Wed, 2010-08-11 at 12:35 -0400, Dave Jones wrote: > I just got this from a patch I merged.. > > ERROR: need consistent spacing around '*' (ctx:WxV) > #121: FILE: arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c:113: > +static struct pcc_cpu __percpu *pcc_cpu_info; > ^ > which doesn't seem right. Perhaps these need to be added to checkpatch. [apw@canonical.com: added tests] Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: check for incorrect permissionsRabin Vincent
Throw an error when a source file has been given execute permissions using the mode change line present in git diffs. Also alow the filename matching to use the "diff" line in addition to the "+++" line, since the mode change lines appear before any "+++" lines. [apw@canonical.com: simplified filename logic slightly, added tests] Cc: Andy Whitcroft <apw@canonical.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>