aboutsummaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* kbuild: make it possible to specify the module output dirRom Lemarchand2015-03-041-1/+1
| | | | | | | | | | | | | Make modinst_dir user-defined on the command line. This allows to do things like: make MODLIB=output/ modinst_dir=. modules_install to ensure all the .ko are in the output/ directory. Change-Id: I2bc007eea27ee744d35289e26e4a8ac43ba04151 Signed-off-by: Rom Lemarchand <romlem@android.com> (cherry picked from commit ae7f28e5aa168a008c153ccff7cc437066d016c3)
* dtc: Dynamic symbols & fixup support (shipped)Pantelis Antoniou2015-02-203-932/+929
| | | | | | | | | | | This commit adds the generated shipped files by the "dtc: Dynamic symbols & fixup support" commit Change-Id: If68f2a38da44775539a457d872606673256300f2 Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> Git-Commit: e4f4b652d6fb36db1e6ec3453ef550637197a55d Git-Repo: git://github.com/beagleboard/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* dtc: Dynamic symbols & fixup supportPantelis Antoniou2015-02-196-9/+325
| | | | | | | | | | | | | | | | | | | | Enable the generation of symbol & fixup information for usage with dynamic DT loading. Passing the -@ option generates a __symbols__ node at the root node of the resulting blob for any node labels used. When using the /plugin/ tag all unresolved label references be tracked in the __fixups__ node, while all local phandle references will the tracked in the __local_fixups__ node. This is sufficient to implement a dynamic DT object loader. Change-Id: I756e4debd4485ed1e4663a39bc04a7b3951aab6a Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> Git-Commit: 134e978d51318411276c52794ed0bf8e5dbe0db6 Git-Repo: git://github.com/beagleboard/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* dtc: add integer overflow checks in fdt headerVijay Kumar Pendoti2014-11-212-1/+15
| | | | | | | | | Protect against integer overflows caused by malformed fdt headers. CRs-Fixed: 749977 Change-Id: I51d87038f520bc761b163d291b0138c513c69a33 Signed-off-by: Vijay Kumar Pendoti <vpendo@codeaurora.org> Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
* scripts: checkpatch.pl: warn on invalid credentialsBryan Huntsman2014-10-101-0/+9
| | | | | | | | | | @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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Excuse reverts from "summary line over 75 characters" checkMatt Wagantall2014-10-101-2/+2
| | | | | | | | | | Rather than forcing authors of reverts to truncate the summary line because the "Revert" prefix added pushes it over the character limit, excuse reverts from this rule. Change-Id: I395dfff3327e360ef935d4a685c38df6577e3867 Signed-off-by: Matt Wagantall <mattw@codeaurora.org> Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: recognize only specific tags when ending commit textSteve Muckle2014-10-101-1/+4
| | | | | | | | | | | There are some very frequently used tags that checkpatch can look for as an ending to the commit text rather than using a pattern, which can generate false positives in the "no commit text" rule. Change-Id: I5b4400017b8273bcd9f5a59b3e28965c0062bef4 Signed-off-by: Steve Muckle <smuckle@codeaurora.org> (cherry picked from commit 336a3ae6253031d6a0de11882ac24a11f83d3323) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: require commit textSteve Muckle2014-10-101-5/+53
| | | | | | | | | | | Commit text is almost always necessary to explain why a change is needed. Exceptions are rare enough that these can be granted through manual checkpatch overrides. Change-Id: I926b2276f717940c2fec77a6709fa3088b1bf0c3 Signed-off-by: Steve Muckle <smuckle@codeaurora.org> (cherry picked from commit d3b3b64c907dbf2244250fc4b389562f2efedee2) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Add check for vreg_xxx api in opensource driversPankaj Kumar2014-10-101-0/+7
| | | | | | | | | | | Vreg API implementation is deprecated. We are using Linux regulator framework now. Hence vreg API should not be used. Change-Id: I8e31dac66592d2d195d190b770a436e93206cf8b Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org> (cherry picked from commit adfb933a24911e3514a2f1b6fe1b1a9151fec56d) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Add check for gpiomux usage in msm board filesRohit Vaswani2014-10-101-0/+8
| | | | | | | | | | | MSM has a board-*-gpiomux file where all the gpiomux configs reside. Warn if a non gpiomux board file tries to add gpiomux configs. The camera board file is an exception to this rule. Change-Id: Ibab190dcbd7ea78e7ca150142c68c5ae881e4e06 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org> (cherry picked from commit 60d78bb9809e7d4d1c3dc1425cbfd9e649e87c1c) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: complain about the use of dsb().Gregory Bean2014-10-101-0/+7
| | | | | | | | | Now that mb() does what we want, dsb() should be discouraged. Change-Id: Ib8fe8f44f669753c3d91fac3c6e598e117d6d90e Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit 9c0619be7b93ad114d6f33a749d905ddff93df7d) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: close filp_open loophole.Gregory Bean2014-10-101-0/+7
| | | | | | | | | | filp_open allows people to get around the ban on sys_open. Close the loophole. Change-Id: I6e2be62e848cbc064e07008d0886c0d003c8be4b Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit bb181a18a813a70176f71a0c64aa572fcfbef0f0) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Handle long multi-line macros better.Gregory Bean2014-10-101-1/+7
| | | | | | | | | | | | | | | | Improve parsing of multiline macros which run beyond the available diff context. These beyond-the-horizon macros previously caused two distinct naughty behaviors: - The scanner, confused by the trailing backslash, would grab the header of the next context hunk and treat it as the last line of the preceding macro. - The analyzer, unable to fully reduce the macro, would blame the patch for submitting an unbalanced or unprotected macro. Change-Id: I6b7dd3d577c524d30b59dff7b20393bb5135f16d Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit ddd028c47b4d91aa9c0e97445eb584b2de367769) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: deprecate unbounded string functions.Gregory Bean2014-10-101-0/+20
| | | | | | | | | | Unbounded string functions are overflow risks. The 'n' versions of those functions should be used instead. Change-Id: Ice0fb3ebdae9aa88cc7e764ffdf68cbed857febf Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit 15e1e97d66dd6a6039c1ec2bd549a632fe361128) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: forbid implied-barrier I/O functions.Gregory Bean2014-10-101-0/+20
| | | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Merge continuation-header handling from .38.Gregory Bean2014-10-101-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: forbid filesystem accesses from within the kernel.Gregory Bean2014-10-101-0/+7
| | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* Don't complain about MIME headers.Gregory Bean2014-10-101-7/+14
| | | | | | | | | | 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> (cherry picked from commit 8e6b9d3790595198a34320f1c3f4504cd258fed1) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* Checkpatch: Print location when catching return code errorPatrick Pannuto2014-10-101-1/+1
| | | | | | | | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Check for illegal return codesPatrick Pannuto2014-10-101-0/+6
| | | | | | | | | | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: remove column limit for checkpatch patchesIsrael Schlesinger2014-10-101-0/+1
| | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Add warnings for use of mdelay()Israel Schlesinger2014-10-101-0/+6
| | | | | | Signed-off-by: Israel Schlesinger <israels@codeaurora.org> (cherry picked from commit 084af58596758be6e51ef060aefa2cd622dc9205) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: Exceptions for CLK_* macros and some spaces in macrosMatt Wagantall2014-10-101-1/+2
| | | | | | | | | | | | | | | | | 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) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: warn on subject line not followed by blank lineRichard Adams2014-10-101-1/+17
| | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Richard Adams <c_adams@quicinc.com> (cherry picked from commit 78d0db4aa1212e00696e25b7daa9fc4ecd86f954) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: check for #if 0/#if 1Abhijeet Dharmapurikar2014-10-101-3/+10
| | | | | | | | Warn if #if 1 or #if 0 is present. Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> (cherry picked from commit a81f92c9abe442ad5b00e8df31172f145a14af3f) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: warn on long summary, commit text linesSteve Muckle2014-10-101-1/+41
| | | | | | | | | | 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> (cherry picked from commit e2638df6005402597085a58e01b6dd1cf2bdb8a4) Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: fix detection of git repositoryRichard Genoud2014-10-101-2/+2
| | | | | | | | | | | | | | | | Since git v1.7.7, the .git directory can be a file when, for example, the kernel is a submodule of another git super project. So, the check "-d .git" is not working anymore in this case. Using a more generic check like "-e .git" corrects this behaviour. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> 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> Git-commit: 3645e3283b90524ed9a6b33b68c93ee29d1bfeb9 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch.pl: check for function declarations without argumentsJoe Perches2014-10-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | Functions like this one are evil: void foo() { ... } Because these functions allow variadic arguments without checking the arguments at all. Original patch by Richard Weinberger. Signed-off-by: Joe Perches <joe@perches.com> Cc: Richard Weinberger <richard@nod.at> Cc: Borislav Petkov <bp@alien8.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: b36190c5f85724da1871bfb8eddbeb77a45c4952 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: prefer ether_addr_copy to memcpy(foo, bar, ETH_ALEN)Joe Perches2014-10-101-0/+10
| | | | | | | | | | | | | | ether_addr_copy was added for kernel version 3.14. It's slightly smaller/faster for some arches. Encourage its use. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 98a9bba51c6e47f69c4fa22cc39a600d2e39536c Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add DT compatible string documentation checksRob Herring2014-10-101-0/+27
| | | | | | | | | | | | | | | | | | This adds a simple check that any compatible strings in DeviceTree dts files are present in Documentation/devicetree/bindings. Vendor prefixes are also checked for existing in vendor-prefixes.txt These should be temporary checks until we have more sophisticated binding schema checking. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Joe Perches <joe@perches.com> Cc: Grant Likely <grant.likely@linaro.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> Git-commit: bff5da4335256513497cc8c79f9a9d1665e09864 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: only flag FSF address, not gnu.org URLAlexander Duyck2014-10-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This change restricts the check for the for the FSF address in the GPL copyright statement so that it only flags the address, not the references to the gnu.org/licenses URL which appears to be used in numerous drivers. The idea is to still allow some reference to an external copy of the GPL in the event that files are copied out of the kernel tree without the COPYING file. So for example this statement will still return an error: You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. However, this statement will not return an error after this patch: You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.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> Git-commit: 109d8cb2002dcb0fff04ff1afe8f1cec66bbdad9 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add tests for function pointer style misusesJoe Perches2014-10-101-0/+59
| | | | | | | | | | | | | | | | Kernel style uses function pointers in this form: "type (*funcptr)(args...)" Emit warnings when this function pointer form isn't used. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@shadowen.org> Cc: Derek Perrin <d.roc16@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 31070b5d4490c6c876e0d3b093e5d5b05e4027fa Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: update the FSF/GPL address checkJoe Perches2014-10-101-5/+6
| | | | | | | | | | | | | | | | | | The FSF address check is a bit too verbose looking for the GPL text. Quiet it a bit by requiring --strict for the GPL bit. Also make the address tests match a few uses of abbreviations for street names and make it case insensitive. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Cc: Manfred Spraul <manfred@colorfullife.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> Git-commit: 3e2232f2d03ffa531e31662c447496ec2552d85b Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: check for if's with unnecessary parenthesesJoe Perches2014-10-101-0/+14
| | | | | | | | | | | | | | | | | | If statements don't need multiple parentheses around tested comparisons like "if ((foo == bar))". An == comparison maybe a sign of an intended assignment, so emit a slightly different message if so. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Cc: Manfred Spraul <manfred@colorfullife.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> Git-commit: 189248d8f4f3ac2fba30da9b40133b5891df95fc Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: improve space before tab --fix optionJoe Perches2014-10-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | This test should remove all the spaces before a tab not just one space. Substitute a tab for each 8 space block before a tab and remove less than 8 spaces before a tab. This SPACE_BEFORE_TAB test is done after CODE_INDENT. If there are spaces used at the beginning of a line that should be converted to tabs, please make sure that the CODE_INDENT test and conversion is done before this SPACE_BEFORE_TAB test and conversion. Reported-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Joe Perches <joe@perches.com> Cc: Josh Triplett <josh@joshtriplett.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> Git-commit: c76f4cb3d25e5dc84017d7e845072e9aef6037f4 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add a --fix-inplace optionJoe Perches2014-10-101-1/+9
| | | | | | | | | | | | | | | Add the ability to fix and overwrite existing files/patches instead of creating a new file "<filename>.EXPERIMENTAL-checkpatch-fixes". Suggested-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Josh Triplett <josh@joshtriplett.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> Git-commit: 9624b8d65cd1e9a6415a81a6588e423b1d8c2282 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: attempt to find missing switch/case break;Joe Perches2014-10-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | switch case statements missing a break statement are an unfortunately common error. e.g.: commit 4a2c94c9b6c0 ("HID: kye: Add report fixup for Genius Manticore Keyboard") case blocks should end in a break/return/goto/continue. If a fall-through is used, it should have a comment showing that it is intentional. Ideally that comment should be something like: "/* fall-through */" Add a test to look for missing break statements. This looks only at the context lines before an inserted case so it's possible to have false positives when the context contains a close brace and the break is before the brace and not part of the patch context. Looking at recent patches, this is a pretty rare occurrence. The normal kernel style uses a break as the last line of the previous block. Signed-off-by: Joe Perches <joe@perche.com> Cc: Andy Whitcroft <apw@shadowen.org> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Dave Jones <davej@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: c34c09a8451fac8555cbf0e8df1f6cf31cf1360b Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add warning of future __GFP_NOFAIL useDavid Rientjes2014-10-101-0/+6
| | | | | | | | | | | | | | | gfp.h and page_alloc.c already specify that __GFP_NOFAIL is deprecated and no new users should be added. Add a warning to checkpatch to catch this. Signed-off-by: David Rientjes <rientjes@google.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> Git-commit: 7e4915e78992ebd3cc031051dc23063bbf29e749 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: warn only on "space before semicolon" at end of lineJoe Perches2014-10-101-1/+1
| | | | | | | | | | | | | | | The "space before a non-naked semicolon" test has unwanted output when used in "for ( ;; )" loops. Make the test work only on end-of-line statement termination semicolons. Signed-off-by: Joe Perches <joe@perches.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: d2e248e7b0068b940f3ca1fc26da603536a533db Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: more comprehensive split strings warningJoe Perches2014-10-101-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current checkpatch test for split strings does not find several cases that should be found. For instance: /* Else poor success; go back to mode in "active" table */ } else { IWL_DEBUG_RATE(mvm, - "LQ: GOING BACK TO THE OLD TABLE suc=%d cur-tpt=%d old-tpt=%d\n", + "GOING BACK TO THE OLD TABLE: SR %d " + "cur-tpt %d old-tpt %d\n", window->success_ratio, window->average_tpt, lq_sta->last_tpt); does not currently emit a warning. Improve the test to find these cases. Add more exceptions to reduce false positives for assembly and octal/hex string constants. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 8c5fcd24a9ea608286816a1508c067c8a512af78 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* PCI/checkpatch: Deprecate DEFINE_PCI_DEVICE_TABLEJoe Perches2014-10-101-4/+7
| | | | | | | | | | | | | | Prefer use of the direct definition of struct pci_device_id instead of indirection via macro DEFINE_PCI_DEVICE_TABLE. Update the PCI documentation to deprecate DEFINE_PCI_DEVICE_TABLE. Update checkpatch adding --fix option. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Git-commit: 92e112fdbb3cb55b43390426501a7efacd893b96 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: fix "Use of uninitialized value" warningsJoe Perches2014-10-101-0/+1
| | | | | | | | | | | | | | | | checkpatch is currently confused about some complex macros and references undefined variables $stat and $cond. Make sure these are defined before using them. Signed-off-by: Joe Perches <joe@perches.com> Reported-by: Gerhard Sittig <gsi@denx.de> 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> Git-commit: c11230f44b3c3e055e4e7cd572fc1c4a22c6f4a9 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add check for sscanf without return useJoe Perches2014-10-101-0/+17
| | | | | | | | | | | | | | | | | Naked use sscanf can be troublesome because the pointed to variables may not have been set. Add a warning when the sscanf return value is not used. For now, do not add __must_check to the sscanf prototype because that will cause a couple of hundred new warnings when compiling a kernel. 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> Git-commit: 823b794ce176bcf135a062075737be71a78629dd Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: don't require kernel style __attribute__ shortcuts in uapi pathsJoe Perches2014-10-101-7/+12
| | | | | | | | | | | | | | | | | | Avoid prescribing kernel styled shortcuts for gcc extensions of __attribute__((foo)) in the uapi include paths. Fix $realfile filename when using -f/--file to not remove first level directory as if the filename was used in a -P1 patch. Only strip the first level directory (typically a or b) for P1 patches. Signed-off-by: Joe Perches <joe@perches.com> Cc: "Dixit, Ashutosh" <ashutosh.dixit@intel.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> Git-commit: 2b7ab45395dc4d91ef30985f76d90a8f28f58c27 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: improve "return is not a function" testJoe Perches2014-10-101-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | Find a few more cases where parentheses are used around the value of a return statement. This now uses the "$balanced_parens" test and also makes the test depend on perl v5.10 and higher. This now finds return with parenthesis uses the old code did not find like: ERROR: return is not a function, parentheses are not required #211: FILE: arch/m68k/include/asm/sun3xflop.h:211: + return ((error == 0) ? 0 : -1); Signed-off-by: Joe Perches <joe@perches.com> Tested-by: David Cohen <david.a.cohen@linux.intel.com> Acked-by: David Cohen <david.a.cohen@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 507e51418ca0c98640310aa02450720825b2b6b1 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch.pl: check for the FSF mailing addressJosh Triplett2014-10-101-0/+12
| | | | | | | | | | | | | | | | | | | Kernel maintainers reject new instances of the GPL boilerplate paragraph directing people to write to the FSF for a copy of the GPL, since the FSF has moved in the past and may do so again. Make this an error for new code, but just a --strict CHK in --file mode; anyone interested in doing tree-wide cleanups of this form can enable this test explicitly. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 4783f894d0f3bfb107cf3b1d9aed1f1a0672ee1d Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: make the memory barrier test noisierJoe Perches2014-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Peter Zijlstra prefers that comments be required near uses of memory barriers. Change the message level for memory barrier uses from a --strict test only to a normal WARN so it's always emitted. This might produce false positives around insertions of memory barriers when a comment is outside the patch context block. And checkpatch is still stupid, it only looks for existence of any comment, not at the comment content. Signed-off-by: Joe Perches <joe@perches.com> Suggested-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: c1fd7bb99637e69994d26df5f6e33192319d3866 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add rules to check init attribute and const defectsJoe Perches2014-10-101-2/+34
| | | | | | | | | | | | | | | | | People get this regularly wrong and it breaks the LTO builds, as it causes a section attribute conflict. Add --fix capability too. Based on a patch from Andi Kleen. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: e970b8846ae4763e64be3c93dc06b4eaebf9ad63 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: add test for #defines of ARCH_HAS_<foo>Joe Perches2014-10-101-8/+14
| | | | | | | | | | | | | | | Add a test for these #defines Additionally, moved string_find_replace sub as it screws up subsequent formatting when placed inside another sub. Signed-off-by: Joe Perches <joe@perches.com> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 52ea85061d188031c827ecef9bce47ae93f1e52e Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* checkpatch: find CamelCase definitions of struct/union/enumJoe Perches2014-10-101-2/+3
| | | | | | | | | | | | | | Checkpatch doesn't currently find CamelCase definitions of structs, unions or enums. Add that ability. 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> Git-commit: 11ea516a6c578564a65a352abb08ef558d365946 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>