Commit graph

2106 commits

Author SHA1 Message Date
Gregory Bean
55bb2c050a checkpatch: forbid implied-barrier I/O functions.
Forbid read[bwl], write[bwl], in[bwl], and out[bwl], as they
contain a 'stealth barrier' which can harm performance.
Developers are expected to call appropriate __raw_* or *_relaxed
APIs and manage barriers explicitly.

Change-Id: Ie4da221c91a0505917199db9e2fdb704c3e47d44
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 032fd4ba09e195d9913c08f460130da9905936ef)
2013-02-20 02:49:59 -08:00
Gregory Bean
20a44b003b checkpatch: Merge continuation-header handling from .38.
This commit is a cherry pick and squash of commits:
85c2ee62d37c19456c6dc83db262123956f010ac
4bc7c6001daba7d4037f54f67bae7fa90f759402

  checkpatch: Handle continuation headers.

  Continuation headers baffle checkpatch, as it can only operate
  on one line of context at a time.  When continuation headers are found,
  put them up with the header they're continuing so the whole thing
  can be parsed in a single line of context.

  checkpatch: Don't treat diffs as patches.

  The patch-header cleanup code assumed that it would only ever
  see patches, which was of course hogwash.  This lead to crazy
  results as it tried to wrap what it thought were continuation
  lines at the beginnings of raw diffs.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 57d50ae730a057ee1099a94a397475bfd147d97b)

Conflicts:

	scripts/checkpatch.pl

Change-Id: I60b2d914ada9a8690b89ffb8c1e32a8b81a5e715
2013-02-20 02:49:59 -08:00
Gregory Bean
5bc97df95b checkpatch: forbid filesystem accesses from within the kernel.
Use of the sys_open/close/read/write system calls from within
kernel code is inappropriate, and now triggers errors.

Change-Id: I98e20513c257d0664684b7144585853f617d771a
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit ee62f2afcac1bcb180b2f0dddf2c8f5cda54bc5b)
2013-02-20 02:49:58 -08:00
David Brown
d0d4b63246 Revert "checkpatch: reject unrelaxed readl/writel."
This reverts commit 66b2a3733e7219e5291c633eb5778bec6500b74d.

Possibly can happen after necessary code changes are in place.

Change-Id: I04e092158dda2b5f5ca029378d1e7dc863de6001
Signed-off-by: David Brown <davidb@codeaurora.org>
(cherry picked from commit 4235f0aeb789321b36eb01f29ffb329fc9d2169c)
2013-02-20 02:49:57 -08:00
Gregory Bean
31fbea03d9 checkpatch: reject unrelaxed readl/writel.
Change-Id: I9490245ba24df51f1b4a69e2bb46b27da13a333a
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 66b2a3733e7219e5291c633eb5778bec6500b74d)
2013-02-20 02:49:57 -08:00
Gregory Bean
b4bea2d7a9 Don't complain about MIME headers.
When patches contain extended character sets, patches will contain
MIME headers after the subject line, which should not be confused
for a too-long summary line.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
Change-Id: If17d17cc7513eb644d75f486b9cdea3a09ba0dbe
(cherry picked from commit 8e6b9d3790595198a34320f1c3f4504cd258fed1)
2013-02-20 02:49:56 -08:00
Bryan Huntsman
fa3e178ef5 Revert "checkpatch: add check for too short Kconfig descriptions"
This reverts commit 3354957a4f.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
(cherry picked from commit 6839bfe7291e24589884af37de8622ff2bea31e6)
2013-02-20 02:49:56 -08:00
Matt Wagantall
cc32440107 checkpatch: Import additional rules from android-msm-2.6.32 to msm-2.6.35
Several checkpatch enhancements are imported from android-msm-2.6.32.
These include:

commit 83ec26e869ac7e967fd5382f9e1979536897d42a
Author: Matt Wagantall <mattw@codeaurora.org>
Date:   Thu Jun 3 12:28:18 2010 -0700

    checkpatch: Exceptions for CLK_* macros and some spaces in macros

    Add CLK_* macros used in MSM clock drivers to the list of exceptions
    for the "Macros with complex values should be enclosed in parenthesis"
    test.

    Also, allow spaces following open branckets for macros where the
    macro is the first token on the line, the space preceds a decimal
    number, and the line ends with ")," or ")". Such arrangements can
    be useful for aligning numerical columns of tables when the rows
    are described by macros.

    Change-Id: I7701119ada2ea8fd646e5448eae51786bbf1e8fa
    Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

commit d3ccf20187826d2cfbf41eda3f9e1a38e35b79bf
Author: Rick Adams <rgadams@codeaurora.org>
Date:   Mon Jan 4 13:06:09 2010 -0800

    checkpatch: warn on subject line not followed by blank line

    Fixed case when no warning generated for long subject line that is
    wrapped to more than one line, and all lines are less than line limit.

    New warning message added:
    "non-blank line after summary line"
    Now there are two warnings possible for the subject line, the original
    line over limit and the new one. Depending on the error(s) any
    combination of the two warnings are possible.

    Commit text requirements now:
    1) Must be less than 75 characters
    2) Must be followed by blank line.

    Change-Id: If7ee833339c5be947bb1dd2a52d5d1d9ddfe5de6
    Signed-off-by: Rick Adams <rgadams@codeaurora.org>

commit ae617dec94111b127c33ae9c979e51b5bd8b5292
Author: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Date:   Thu Oct 1 12:01:44 2009 -0700

    checkpatch: check for #if 0/#if 1

    Warn if #if 1 or #if 0 is present.

    Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

commit 168e8da627f99e421be9375ed572df6b1039854f
Author: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Date:   Thu Oct 1 12:01:44 2009 -0700

    checkpatch: check for execute permissions on non code files

    Make checkpatch.pl check execute permissions on non code files

    Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

commit be24800e1cdd44d8b0e00f212c022f34e1402eb4
Author: Steve Muckle <smuckle@codeaurora.org>
Date:   Fri Apr 3 16:19:20 2009 -0700

    checkpatch: check new files for executable permissions

    Look for executable permissions on new files as well as in mode
    changes on existing files.

    Signed-off-by: Steve Muckle <smuckle@codeaurora.org>

commit b45a236b62928e0b11fbeff1471d9b1efc508884
Author: Steve Muckle <smuckle@codeaurora.org>
Date:   Fri Mar 13 15:46:36 2009 -0700

    checkpatch: warn on long summary, commit text lines

    Warn on summary or commit text lines greater than 75 characters.
    The summary and commit text are indented and may wrap on a terminal
    if they are longer than 75 characters.

    Signed-off-by: Steve Muckle <smuckle@codeaurora.org>

Change-Id: Iae92cdc8ffecc5315761bc91e883d8ea2f4877cc
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit d17f580ee07441770498b54159e3322f8186fc3e)

Conflicts:

	scripts/checkpatch.pl
2013-02-20 02:49:55 -08:00
Patrick Pannuto
d917e71c27 Checkpatch: Backport changes from 2.6.35
Backport a series of checkpatch changes from 2.6.35; having
these checks in our tree now will help with upstreaming
efforts.

A summary of the changes:

(trivial) remove Dave Jones' email
Add initconst attribute
Switch printk exception to logFunctions
check for spaces before a quoted newline
check for space before tabs
improved check spacing on parentheses
improved conditional checking
add some exceptions to multi-statement macro exceptions
Check that the storage class is at the beginning of a declaration
check for sizeof(&)
check for various ops structs, ensure they are const.
check for lockdep_set_novalidate_class

The following commits are included:

commit dbf004d788
Author: Dave Jones <davej@redhat.com>
Date:   Tue Jan 12 16:59:52 2010 -0500

    remove my email address from checkpatch.

    Maybe this will stop people emailing me about it.

    Signed-off-by: Dave Jones <davej@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit 52131292c0
Author: Wolfram Sang <w.sang@pengutronix.de>
Date:   Fri Mar 5 13:43:51 2010 -0800

    checkpatch: fix false positive on __initconst

    checkpatch falsely complained about '__initconst' because it thought the
    'const' needed a space before.  Fix this by changing the list of
    attributes:

    - add '__initconst'
    - force plain 'init' to contain a word-boundary at the end

    Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
    Cc: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit 691e669ba8
Author: Joe Perches <joe@perches.com>
Date:   Fri Mar 5 13:43:51 2010 -0800

    checkpatch.pl: allow > 80 char lines for logging functions not just printk

    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>

commit 3354957a4f
Author: Andi Kleen <ak@linux.intel.com>
Date:   Mon May 24 14:33:29 2010 -0700

    checkpatch: add check for too short Kconfig descriptions

    I've seen various new Kconfigs with rather unhelpful one liner
    descriptions.  Add a Kconfig warning for a minimum length of the Kconfig
    help section.

    Right now I arbitarily chose 4. The exact value can be debated.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Andi Kleen <ak@linux.intel.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>

commit 5e79d96eed
Author: Joe Perches <joe@perches.com>
Date:   Fri Mar 5 13:43:55 2010 -0800

    checkpatch: warn on unnecessary spaces before quoted newlines

    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>

commit 08e4436566
Author: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Date:   Fri Mar 5 13:43:54 2010 -0800

    checkpatch.pl: warn if an adding line introduce spaces before tabs.

    Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.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>

commit 42bdf74c95
Author: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Date:   Fri Mar 5 13:43:50 2010 -0800

    checkpatch: trivial fix for trailing statements check

    In case if the statement and the conditional are in one line, the line
    appears in the report doubly.

    And items of this check have no blank line before the next item.

    This patch fixes these trivial problems, to improve readability of the
    report.

    [sample.c]
      > if (cond1
      >        && cond2
      >        && cond3) func_foo();
      >
      > if (cond4) func_bar();

    Before:
      > ERROR: trailing statements should be on next line
      > #1: FILE: sample.c:1:
      > +if (cond1
      > [...]
      > +       && cond3) func_foo();
      > ERROR: trailing statements should be on next line
      > #5: FILE: sample.c:5:
      > +if (cond4) func_bar();
      > +if (cond4) func_bar();
      > total: 2 errors, 0 warnings, 5 lines checked

    After:
      > ERROR: trailing statements should be on next line
      > #1: FILE: sample.c:1:
      > +if (cond1
      > [...]
      > +       && cond3) func_foo();
      >
      > ERROR: trailing statements should be on next line
      > #5: FILE: sample.c:5:
      > +if (cond4) func_bar();
      >
      > total: 2 errors, 0 warnings, 5 lines checked

    Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.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>

commit 22fd2d3e4f
Author: Stefani Seibold <stefani@seibold.net>
Date:   Fri Mar 5 13:43:52 2010 -0800

    checkpatch.pl: add union and struct to the exceptions list

    Here is a small code snippet, which will be complained about by
    checkpatch.pl:

    #define __STRUCT_KFIFO_COMMON(recsize, ptrtype) \
        union { \
                struct { \
                        unsigned int    in; \
                        unsigned int    out; \
                }; \
                char            rectype[recsize]; \
                ptrtype         *ptr; \
                const ptrtype   *ptr_const; \
        };

    This construct is legal and safe, so checkpatch.pl should accept this.  It
    should be also true for struct defined in a macro.

    Add the `struct' and `union' keywords to the exceptions list of the
    checkpatch.pl script, to prevent error message "Macros with multiple
    statements should be enclosed in a do - while loop".  Otherwise it is not
    possible to build a struct or union with a macro.

    Signed-off-by: Stefani Seibold <stefani@seibold.net>
    Cc: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit d4977c78e9
Author: Tobias Klauser <tklauser@distanz.ch>
Date:   Mon May 24 14:33:30 2010 -0700

    checkpatch: warn on declaration with storage class not at the beginning

    The C99 specification states in section 6.11.5:

    The placement of a storage-class specifier other than at the beginning
    of the declaration specifiers in a declaration is an obsolescent
    feature.

    Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
    Acked-by: Jean Delvare <khali@linux-fr.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>

commit 8f53a9b80f
Author: Joe Perches <joe@perches.com>
Date:   Fri Mar 5 13:43:48 2010 -0800

    scripts/checkpatch.pl: add WARN on sizeof(&foo)

    sizeof(&foo) is frequently an error.  Warn on its use.

    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>

commit 79404849e9
Author: Emese Revfy <re.emese@gmail.com>
Date:   Fri Mar 5 13:43:53 2010 -0800

    checkpatch.pl: extend list of expected-to-be-const structures

    Based on Arjan's suggestion, extend the list of ops structures that should
    be const.

    Signed-off-by: Emese Revfy <re.emese@gmail.com>
    Cc: Andy Whitcroft <apw@shadowen.org>
    Cc: Arjan van de Ven <arjan@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit 1704f47b50
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Fri Mar 19 01:37:42 2010 +0100

    lockdep: Add novalidate class for dev->mutex conversion

    The conversion of device->sem to device->mutex resulted in lockdep
    warnings. Create a novalidate class for now until the driver folks
    come up with separate classes. That way we have at least the basic
    mutex debugging coverage.

    Add a checkpatch error so the usage is reserved for device->mutex.

    [ tglx: checkpatch and compile fix for LOCKDEP=n ]

    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Change-Id: I11495554d7d393659e5e0d7188cdc1744e25b6ba
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit 4657bf482381583b08b34ed5ea6f7d3ad162807c)

Conflicts:

	scripts/checkpatch.pl
2013-02-20 02:49:54 -08:00
Patrick Pannuto
e388f38442 Checkpatch: Print location when catching return code error
Display context so users can see where there error was

OLD:
	ERROR: illegal return value, please use an error code

NEW:
	ERROR: illegal return value, please use an error code
	#152: test.c:5:
	+	return -1;

Change-Id: I098004d9a5dbeb6c39b35b84ac94fd7a861849d7
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit 8d09803de5d629f3ebc9cb357a40b5937a5d171e)
2013-02-20 02:49:54 -08:00
Gregory Bean
45da08a85b Revert "checkpatch: Add warning for blank lines in header"
This reverts commit 8212698c653945d0fd0783829822917bf13a5aab.
The original commit incorrectly prevents the following:
  - Commit messages which cite other commit messages, which
    are commonly used for attribution;
  - Any use of checkpatch which doesn't contain a full mail header,
    such as 'show <ref> | checkpatch.pl -'

Change-Id: I681a97913432d05bf66290cf74972aaa4e03fe5d
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit c73e32b4a1a59e3a33e9c8975ab08b5475d30f3e)
2013-02-20 02:49:53 -08:00
Patrick Pannuto
dc4e47c544 checkpatch: Check for illegal return codes
The only legal integer return is 0, anything else
following "return" should be -ERRCODE or a function.

http://lkml.org/lkml/2010/7/23/318
  There's lots of "return -1;" statements in this patch - it's obscene
  that this is used to indicate "some error occurred" in kernel space
  rather than a real errno value - even when an existing function
  (eg, request_irq) gave you an error code already.

  Please note this for the future - and please review patches on this
  point internally first.

Change-Id: I16268b2ee034f0b3b899115e45c28acfa734ddec
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit 39531a47164294315b5a7256b520fe22d6e87013)
2013-02-20 02:49:53 -08:00
Israel Schlesinger
4be1c09bc3 checkpatch: remove column limit for checkpatch patches
Currently checkpatch is enforcing an 80 character column
limit. This should not be applied for patches modifying
checkpatch.

Change-Id: I8e8935e633d79a7ee535ce6a90e54447a22d9a91
Signed-off-by: Israel Schlesinger <israels@codeaurora.org>
(cherry picked from commit 4aa1b864119e2d0e49efefcd6dba7349f13c3939)

Conflicts:

	scripts/checkpatch.pl
2013-02-20 02:49:52 -08:00
Israel Schlesinger
7ee453e97d checkpatch: fix regex for catching mdelay()
upstream prefers this change for checkpatch:
http://lkml.org/lkml/2010/7/27/254

Signed-off-by: Israel Schlesinger <israels@codeaurora.org>
Change-Id: I61f8c1ff622994b37a79fed4b811115da2c108ad
(cherry picked from commit 76cc4ad08fe1d8912ce44ee2cc1f10373c2974d3)
2013-02-20 02:49:51 -08:00
Israel Schlesinger
864c6a2685 checkpatch: Add warning for blank lines in header
Signed-off-by: Israel Schlesinger <israels@codeaurora.org>
Change-Id: Ie0da3c2842b3d1f194f60c277ae9961dcb82cd59
(cherry picked from commit 8212698c653945d0fd0783829822917bf13a5aab)
2013-02-20 02:49:51 -08:00
Israel Schlesinger
eb3ce1b125 checkpatch: Add warnings for use of mdelay()
Signed-off-by: Israel Schlesinger <israels@codeaurora.org>
Change-Id: I9e5510a79d51b8f03e03ad8466246f93bf2c623a
(cherry picked from commit 084af58596758be6e51ef060aefa2cd622dc9205)
2013-02-20 02:49:50 -08:00
Israel Schlesinger
b9fd44f1a5 checkpatch: Add warning for qualcomm email
People should not be using their qualcomm email
when signing off patches or authoring them.

Signed-off-by: Israel Schlesinger <israels@codeaurora.org>
Change-Id: Ic09516564a6b60576d6fac95e3ce4ccc8c706b0d
(cherry picked from commit bde480639313a5de6c2019a93d96767fecceaa78)
2013-02-20 02:49:50 -08:00
Matt Wagantall
2a9af98acd checkpatch: Exceptions for CLK_* macros and some spaces in macros
Add CLK_* macros used in MSM clock drivers to the list of exceptions
for the "Macros with complex values should be enclosed in parenthesis"
test.

Also, allow spaces following open branckets for macros where the
macro is the first token on the line, the space preceds a decimal
number, and the line ends with ")," or ")". Such arrangements can
be useful for aligning numerical columns of tables when the rows
are described by macros.

Change-Id: I7701119ada2ea8fd646e5448eae51786bbf1e8fa
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit ed6d6ed1c6b8f6016ea5676d075331e31b7ac1f8)

Conflicts:

	scripts/checkpatch.pl
2013-02-20 02:49:49 -08:00
Bryan Huntsman
7324a38d16 scripts/checkpatch.pl: warn on invalid credentials
@quicinc.com identities are not allowed.  Check the "From:" field in the
patch, equivalent to the author in the git commit, and the Signed-off-by
field.

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
(cherry picked from commit 374146d3656f815f45145861396df4ee35f60cec)
2013-02-20 02:49:48 -08:00
Richard Adams
5bdba0fdc2 checkpatch: warn on subject line not followed by blank line
Fixed case when no warning generated for long subject line that is
wrapped to more than one line, and all lines are less than line limit.

New warning message added:
"non-blank line after summary line"
Now there are two warnings possible for the subject line, the original
line over limit and the new one. Depending on the error(s) any
combination of the two warnings are possible.

Commit text requirements now:
1) Must be less than 75 characters
2) Must be followed by blank line.

Change-Id: If7ee833339c5be947bb1dd2a52d5d1d9ddfe5de6
Signed-off-by: Richard Adams <c_adams@quicinc.com>
(cherry picked from commit 78d0db4aa1212e00696e25b7daa9fc4ecd86f954)

Conflicts:

	scripts/checkpatch.pl
2013-02-20 02:49:48 -08:00
Abhijeet Dharmapurikar
cd04021bce checkpatch: check for #if 0/#if 1
Warn if #if 1 or #if 0 is present.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit a81f92c9abe442ad5b00e8df31172f145a14af3f)

Conflicts:

	scripts/checkpatch.pl

Change-Id: Id28c07eaa907351933e0450751b05e2f749d23d0
2013-02-20 02:49:47 -08:00
Abhijeet Dharmapurikar
eeec9b59b5 checkpatch: check for execute permissions on non code files
Make checkpatch.pl check execute permissions on non code files

Signed-off-by: Abhijeet Dharmapurikar <adharmap@quicinc.com>
(cherry picked from commit 315e124e887131124d184f1bf0778ebbb80282fb)
2013-02-20 02:49:47 -08:00
Steve Muckle
1cf404d212 checkpatch: check new files for executable permissions
Look for executable permissions on new files as well as in mode
changes on existing files.

Signed-off-by: Steve Muckle <smuckle@quicinc.com>
(cherry picked from commit 1ec31f0a5471d173b4d2eecb29f3526d77e7cc60)
2013-02-20 02:49:46 -08:00
Steve Muckle
7dab411f3d checkpatch: warn on long summary, commit text lines
Warn on summary or commit text lines greater than 75 characters.
The summary and commit text are indented and may wrap on a terminal
if they are longer than 75 characters.

Signed-off-by: Steve Muckle <smuckle@quicinc.com>
(cherry picked from commit e2638df6005402597085a58e01b6dd1cf2bdb8a4)

Conflicts:

	scripts/checkpatch.pl

Change-Id: I1546ba3b81031051fdbe6319842d6e2d96931416
2013-02-20 02:49:46 -08:00
David Brown
cfdf6912c6 scripts: Include copper pattern in build targets
Change-Id: I68e94f8c000df7cc0a481f49df267258aef952da
Signed-off-by: David Brown <davidb@codeaurora.org>
(cherry picked from commit 2ab0a60d3023a08da712dee9cc5592a216b30ad4)
2013-02-20 02:49:45 -08:00
Stephen Boyd
cb3e910330 build-all.py: Add support for apq defconfigs
There is an apq8064_defconfig. Compile it too.

Change-Id: I9ca96ab56640c8f3726d052ad43d1624a4ece0a5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit d14a37b998dcabb5783f69cc77c66722afdc7567)
2013-02-20 02:49:44 -08:00
Rohit Vaswani
59b6660305 scripts: Add fsm targets to build-all.py
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit d5b438ad986952a7b4596a9794724da83582eff8)
2013-02-20 02:49:44 -08:00
Stephen Boyd
45bc44dc22 build-all.py: Update defconfigs with savedefconfig
Copy the savedefconfig (or minimal defconfig) instead of the
.config when updating defconfigs.

Change-Id: I0ba0b7a774dd3de0dc090420bd5c118eb6199eb6
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 6575c0b29f060a5ebdeec0ff9bcfe0f1af9f0bc8)
2013-02-20 02:49:43 -08:00
Gregory Bean
2ebef7c7e9 LOCAL: build_all.py: allow alternate build targets.
Allow make targets to be given to build-all.py, which
in turn allows the build-all preverification step to be used to
generate all kernel artifacts for later preverification steps.
This moves us closer to eliminating the need to build the kernel
twice for each commit to be tested by the PV framework.

Change-Id: Ifacdbb161604f06f85f4248f21998dda282e6fd0
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit 81a73760834ee3c0b3b1ab3010fd6530d5b82313)
2013-02-20 02:49:42 -08:00
Patrick Pannuto
c95d227f7a build-all: some convenience fixes
* mkdir -p build_dir instead of just failing
* Add perf / noperf targets since building "all" is often unnecessary

Change-Id: I3216f59338ca37e87b464cccbb9c1cc766356a6c
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit b4f13cfa5a53633c0246b2136decc5d210cfcd70)
2013-02-20 02:49:42 -08:00
Patrick Pannuto
440d6ed608 build-all: Don't mix tabs / spaces
Guido says no to tabs in python (however much I may disagree
with him). Regardless of tabs or spaces, you definitely cannot
mix them; future versions of the python interpereter plan to
simply reject files that mix them outright, so we should follow
good style guidelines

Change-Id: I32a30ac3ef430916c534738a7349482d3f151fd5
Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org>
(cherry picked from commit cbebac12150f62ec6f9810f09366d5cf66d60875)
2013-02-20 02:49:41 -08:00
Stephen Boyd
5ae12f4ce9 scripts: build-all: Add a keep-going option
Sometimes I want to build all the targets and see what errors
come out while I'm out at lunch. Currently I can't do that so
introduce a new option -k/--keep-going in the spirit of make's
keep going option to build the rest of the targets even if
another target fails. This way after I eat lunch I can go through
the logs and see what files are failing.

It was suggested that the failing targets could be summarized at
the end of the build run. So when we're building many targets
keep a list of failing targets to output at the end of the run.
This way it's easy to determine which targets need fixing without
scouring the logs or the screen buffer.

While we're here fixup the above usage message.

Change-Id: Ief30ac65eb946e055051bdfdd7ba5788e5a8e426
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 3fb23529a8c959042d3efb68888bc18d8fbce0ce)
2013-02-20 02:49:41 -08:00
David Brown
7799e8d349 Allow Limit load average on builds.
Accept the -l make argument as well as -j.  Neither of these
arguments now have a default, other than what make uses, allowing
the user to specify whatever value they wish.

Signed-off-by: David Brown <davidb@quicinc.com>
(cherry picked from commit 0b2e450e1478711a0d19f15a7e66dec742468d7b)
2013-02-20 02:49:40 -08:00
Stephen Boyd
009d29cb12 scripts: build-all: add jobs option
It's annoying that the number of make jobs is hardcoded at 6.
Allow users to define the number of jobs they want with a new
option in the spirit of '-j' from make.

Change-Id: I27881eb604e27a995d5d70bdeabacd6f690aa5b0
Signed-off-by: Stephen Boyd <sboyd@quicinc.com>
(cherry picked from commit 604baf789feb66fee36ea68487d21ea94d8fb374)
2013-02-20 02:49:40 -08:00
David Brown
3eec139820 Update build-all.py to use codesourcery compiler.
Signed-off-by: David Brown <davidb@quicinc.com>
(cherry picked from commit 52e2e56187371d40f1b2163085956a96296fcdd6)
2013-02-20 02:49:39 -08:00
David Brown
8376f3f32e Kernel building utility.
A small script to make it easier to build and test all target
configurations.  Assumes the cross compiler is in the path, and
builds all defconfigs matching certain patterns.

Signed-off-by: David Brown <davidb@quicinc.com>
(cherry picked from commit 6d7b7dc07271ab50e63d43b550c8484db0da8139)
2013-02-20 02:49:38 -08:00
Sridhar Parasuram
9de992efc8 scripts: gcc-wrapper: Add an allowed warning for alignment.c
| kernel/arch/arm/mm/alignment.c:327:15: warning: 'offset.un' may be used
 uninitialized in this function [-Wuninitialized]
 | error, forbidden warning: alignment.c:327
 | make[2]: *** [arch/arm/mm/alignment.o] Error 1

Change-Id: Iadba4720a38997682036527a89b5adeb52ea6119
Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
(cherry picked from commit 32cd2e999c18bf7fa2c5722c90c9bdf6dea60aba)

Conflicts:

	scripts/gcc-wrapper.py
2013-02-20 02:49:38 -08:00
Seungwon Jeon
b4ada1fe5a scripts/gcc-wrapper: Squash mmc changes to gcc-wrapper in 1 commit
Change-Id: I147e19fa51c215cba1f5c508df5d2f68d2ae5046
2013-02-20 02:49:37 -08:00
Rohit Vaswani
acc85df03a scripts: gcc-wrapper: Add an allowed warning for block.c
Commit f2b3f49ede3be96e11b60880c22a768328ce4d2f added a warning
from Open Emdedded's gcc-4.6.3 compiler.

| kernel/drivers/mmc/card/block.c: In function 'mmc_blk_issue_rq':
| kernel/drivers/mmc/card/block.c:836:18:
| warning: 'arg' may be used uninitialized in this function
| [-Wuninitialized] error, forbidden warning: block.c:836
| kernel/drivers/mmc/card/block.c:835:6: warning: 'nr' may be used
| uninitialized in this function [-Wuninitialized]
| error, forbidden warning: block.c:835

Change-Id: I05a45033e5dae8b126cbbba89188d84244485afd
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit 3d2c28943e880d6a0e7619c4234d8a52ccf8f9e1)
2013-02-20 02:49:37 -08:00
Rohit Vaswani
c681eac5e0 scripts: gcc-wrapper: Add exceptions for netfilter failures with gcc-4.6.3
Compiling the kernel with gcc-4.6.3 generates multiple forbidden
warnings for netfilter. Adding them to the allowed warnings list.

Change-Id: I7214d8c1bb59c99e2422eaac2a820fb43cf62b1e
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit 660d3ffb16a8ee7c5693d745a8588c991035c8e7)
2013-02-20 02:49:36 -08:00
Rohit Vaswani
6e3b72fa13 scripts: gcc-wrapper: Add exceptions for failures with gcc-4.6.3
Compiling the kernel with gcc-4.6.3 generates two new forbidden
warnings. Adding them to the allowed warnings list.

Warning 1:
kernel/arch/arm/mm/alignment.c:298:15: warning: 'offset.un' may be
used uninitialized in this function [-Wuninitialized]

Warning 2:
kernel/net/sched/sch_generic.c:678:2: warning: the comparison will always
evaluate as 'true' for the address of 'noop_qdisc' will never be NULL
[-Waddress]

Change-Id: Ib559420337ac4c2d25b55eb80e8da3c2221b2f75
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit 116bcf08bd2c078e809a2d1e53fe901cf6f65502)

Conflicts:

	scripts/gcc-wrapper.py
2013-02-20 02:49:36 -08:00
Gregory Bean
74b9ffc4bc gcc-wrapper: print friendlier errors.
Print something friendlier than a stack trace for OSErrors,
and something helpful for 'file not found' errors.  This prevents
flummoxing people who build the kernel without the compiler in their path,
which is far and away the most common error.

Change-Id: If1a3dfdd0868abc8531a06a61f2f374b54c64cd0
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit e1f91f8e6b38594caa30bf82c586674b83e9c0b4)
2013-02-20 02:49:35 -08:00
Michael Bohan
b5b907b61f gcc-wrapper: Add warning for dir.c:43
Change bde4ec0140fadc028d22c8959347fb8d0f501b84 consolidated
warnings generated from several toolchains, but forgot this one.

Change-Id: I4ab67610962572371cefedace30bb2e89b818c12
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
(cherry picked from commit c630d473862bfaad8e3a1ab7e7a5f454d49087a7)
2013-02-20 02:49:34 -08:00
Gregory Bean
10309a5a2e gcc-wrapper: fix forbidden-errors list.
Change-Id: I161afde698155db38d2b35f8fdf5b7f9e5eb5276
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
(cherry picked from commit bde4ec0140fadc028d22c8959347fb8d0f501b84)

Conflicts:

	scripts/gcc-wrapper.py
2013-02-20 02:49:34 -08:00
David Brown
1d0c978ed3 scripts: Use wrapper to check compiler warnings
Rather than telling gcc to make warnings as errors, and then hunting
down make rules to disable this, leave them as warnings, but invoke
gcc through a wrapper that checks the warnings against a whitelist.

The initial whitelist comes from the warnings in the current build,
all of which have been allowed through Make overrides.

Change-Id: Ifc9952e03d1a5dbcd90819dc7aa0ec7e50328e20
Signed-off-by: David Brown <davidb@codeaurora.org>
(cherry picked from commit d21ced2f0dda815cac69c693cd81e2e75d8f0007)
2013-02-20 02:49:33 -08:00
Stephen Boyd
0e7e93da37 setlocalversion: Fix version when built/synced on a tag
If building on a tag we check to make sure the version in the
Makefile matches the tag we're building at. That would be a
string comparison and not an integer comparison. Change the test
accordingly. Right now we'll just see 3.0.8 or 3.0.8-dirty if the
kernel is built on a tag.

Similarly if we're synced to a tag we may have two references to
the same object, 1 in the local repo and one in the remote. Force
the show-ref to only look at tags so we only ever describe on
ref instead of two.

Change-Id: I694947b434db8f95d4c0b9f6e68702c65a1ee281
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit cf76837260758073496ce6325bcb20e657eb2066)
2013-02-20 02:49:33 -08:00
Stephen Boyd
aade712394 setlocalversion: Prevent tags from overflowing version string
Some post Linus tags are very long and they exceed the character
limit on the version string. This leads to compile errors like

 3.0.8-insert-your-reallllly-long-tag-name-here-13-g4b4e960-dirty
 exceeds 64 characters

Instead of putting the pretty printed name of the closest post
Linus tag, place the tag's object hash in the version string.
This should allow developers to easily run a git show on the
first hash to see what tag the build is based on. The version
will look like:

	3.0.8-gb080168-00006-g41f3bb3-dirty

meaning the kernel is based on v3.0.8 at the tag b080168 with 6
patches applied on top of that tag resulting in a commit with the
hash 41f3bb3 plus a dirty tree. Running "git show b080168"
should show the closest tag the tree was based on.

Change-Id: I8a26532f76aadf31654cb420ab789e90bd2fe828
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit cd7c0ee4d018b96fa540a29aa31452c3455f6e20)

Conflicts:

	scripts/setlocalversion
2013-02-20 02:49:32 -08:00
Laura Abbott
890bcc7532 modpost: Make verbose mismatches errors
When compiling with CONFIG_DEBUG_SECTION_MISMATCHES, compilation
will still currently succeed even though there is still a mismatch.
Fix this by putting the check in a different place.

Change-Id: I631203803ab9d78e9d57afecbe602aaf37d05dc6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(cherry picked from commit 54cb83c041bc65d3501e4f5cd94d9cc7f68b950f)
2013-02-20 02:49:31 -08:00
Laura Abbott
1bf41f8a12 modpost: Make section mismatches an error
If any section mismatches are detected the compilation will fail.
Section mismatches can go back to being warnings with
CONFIG_NO_ERROR_ON_MISMATCH=y.

Change-Id: I44f01f348703d2fdda77f2930bc290f6867b5b08
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(cherry picked from commit d34cd35c3aacb219de789a61a140e7f095794a3f)
2013-02-20 02:49:31 -08:00
H. Peter Anvin
6520fe5564 x86, realmode: 16-bit real-mode code support for relocs tool
A new option is added to the relocs tool called '--realmode'.
This option causes the generation of 16-bit segment relocations
and 32-bit linear relocations for the real-mode code. When
the real-mode code is moved to the low-memory during kernel
initialization, these relocation entries can be used to
relocate the code properly.

In the assembly code 16-bit segment relocations must be relative
to the 'real_mode_seg' absolute symbol. Linear relocations must be
relative to a symbol prefixed with 'pa_'.

16-bit segment relocation is used to load cs:ip in 16-bit code.
Linear relocations are used in the 32-bit code for relocatable
data references. They are declared in the linker script of the
real-mode code.

The relocs tool is moved to arch/x86/tools/relocs.c, and added new
target archscripts that can be used to build scripts needed building
an architecture.  be compiled before building the arch/x86 tree.

[ hpa: accelerating this because it detects invalid absolute
  relocations, a serious bug in binutils 2.22.52.0.x which currently
  produces bad kernels. ]

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/1336501366-28617-2-git-send-email-jarkko.sakkinen@intel.com
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@vger.kernel.org>
2012-05-18 19:49:40 -07:00