07 Nov, 2011
1 commit
-
* '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
01 Nov, 2011
2 commits
-
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
Suggested-by: Andrew Morton
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Mark obsolete/deprecated strict_strto and simple_strto functions
and macros as obsolete.Update checkpatch to warn about their use.
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Sep, 2011
2 commits
-
Fast-forward merge with Linus to be able to merge patches
based on more recent version of the tree. -
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
Signed-off-by: Jiri Kosina
31 Aug, 2011
1 commit
-
Usage of these flags has been deprecated for nearly 4 years by:
commit f77bf01425b11947eeb3b5b54685212c302741b8
Author: Sam Ravnborg
Date: Mon Oct 15 22:25:06 2007 +0200kbuild: 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
Cc: Andy Whitcroft
Signed-off-by: Arnaud Lacombe
Signed-off-by: Michal Marek
26 Aug, 2011
1 commit
-
The test for bad usage of min_t() and max_t() is missing the --ignore
type. Add it.Signed-off-by: Hui Zhu
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Jul, 2011
7 commits
-
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 _ printks.__ratelimited and __once and WARN_RATELIMIT
and WARN_ONCE may now exceed 80 cols.Add missing _printk type for completeness.
Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Cc: Kalle Valo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Acked-by: Mike Frysinger
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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 " form.Original idea by Anish Kumar
Signed-off-by: Joe Perches
Cc: Anish Kumar
Cc: Nick Bowler
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Cc: Andy Whitcroft
Cc: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Jun, 2011
1 commit
-
Warn about uses of printk_ratelimit() because it uses a global state and
can hide subsequent useful messages.Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Cc: Richard Weinberger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 May, 2011
3 commits
-
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
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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_ declarations to be longer than 80 columns.
Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add a warning for unterminated quoted strings with line continuations as
these frequently add unwanted whitespace.Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
23 Mar, 2011
3 commits
-
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
Cc: Steven Rostedt
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
27 Jan, 2011
1 commit
-
Last users are gone. Remove the left overs.
Signed-off-by: Thomas Gleixner
14 Jan, 2011
4 commits
-
There's a __packed #define for __attribute__((packed)). Add a checkpatch
to tell people about it.Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Exporting world writable sysfs/debugfs files is usually a bad thing. Warn
about it.Signed-off-by: Dave Jones
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Florian Mickler
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Oct, 2010
1 commit
-
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
Cc: Peter Zijlstra
Cc: Christoph Hellwig
LKML-Reference:
27 Oct, 2010
12 commits
-
Signed-off-by: Joe Perches
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Cc: Mike Frysinger
Cc: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Signed-off-by: Andy Whitcroft
Cc: Dave Jones
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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
Acked-by: Linus Walleij
Signed-off-by: Rabin Vincent
Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
When checking the length of the help we need to be sure we are seeing the
whole story before erroring. Firstly we only want to check when adding
the help in the first place. Second we need to be sure that we are seeing
the end of the entry, nominally when there is no context below or that
context shows the start of the next entry.Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Commonise the code for missing spaces after struct, union, and enum such
that they share the same code. Ensure we cover all the common cases in
each case. Check against the sanitised line to ensure we do not report on
comments and strings.Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add spacing checks for struct, union, and enum definitions. Check the
spacing after type and before the equals (=) and open brace ({).Based on a patch by Joe Perches.
Cc: Joe Perches
Signed-off-by: Andy Whitcroft
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds