|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7 |
|
| #
bc2f19d6 |
| 10-Mar-2025 |
Philipp Hahn <[email protected]> |
checkpatch: describe --min-conf-desc-length
Neither the warning nor the help message gives any hint on the unit for length: Could be meters, inches, bytes, characters or ... lines.
Extend the outp
checkpatch: describe --min-conf-desc-length
Neither the warning nor the help message gives any hint on the unit for length: Could be meters, inches, bytes, characters or ... lines.
Extend the output of `--help` to name the unit "lines" and the default: - --min-conf-desc-length=n set the min description length, if shorter, warn + --min-conf-desc-length=n set the minimum description length for config symbols + in lines, if shorter, warn (default 4)
Include the minimum number of lines as other error messages already do: - WARNING: please write a help paragraph that fully describes the config symbol + WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines
Link: https://lkml.kernel.org/r/c71c170c90eba26265951e248adfedd3245fe575.1741605695.git.p.hahn@avm.de Signed-off-by: Philipp Hahn <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Joe Perches <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2 |
|
| #
e966ad0e |
| 05-Feb-2025 |
Masahiro Yamada <[email protected]> |
kbuild: remove EXTRA_*FLAGS support
Commit f77bf01425b1 ("kbuild: introduce ccflags-y, asflags-y and ldflags-y") deprecated these in 2007. The migration should have been completed by now.
Signed-of
kbuild: remove EXTRA_*FLAGS support
Commit f77bf01425b1 ("kbuild: introduce ccflags-y, asflags-y and ldflags-y") deprecated these in 2007. The migration should have been completed by now.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc1, v6.13, v6.13-rc7 |
|
| #
d22feb5b |
| 10-Jan-2025 |
Dan Carpenter <[email protected]> |
checkpatch: don't warn about extra parentheses in staging/
This "Unnecessary parentheses" warning is disabled for drivers/staging unless the --strict option is used. Really, we don't want it at all
checkpatch: don't warn about extra parentheses in staging/
This "Unnecessary parentheses" warning is disabled for drivers/staging unless the --strict option is used. Really, we don't want it at all even if the --strict option is used.
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Joe Perches <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
c6da721f |
| 08-Jan-2025 |
David Reaver <[email protected]> |
checkpatch: remove migrated RCU APIs from deprecated_apis
The deprecated_apis map was created in [1] so checkpatch would flag deprecated RCU APIs. These deprecated APIs have since been removed from
checkpatch: remove migrated RCU APIs from deprecated_apis
The deprecated_apis map was created in [1] so checkpatch would flag deprecated RCU APIs. These deprecated APIs have since been removed from the kernel. This patch removes them from this map so checkpatch doesn't waste time looking for them, and so readers of checkpatch looking for deprecated APIs don't waste time searching for them.
Link: https://lore.kernel.org/all/[email protected]/ [1]
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: David Reaver <[email protected]> Reviewed-by: Paul E. McKenney <[email protected]> Reviewed-by: Kuan-Wei Chiu <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Krister Johansen <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2 |
|
| #
3735c522 |
| 04-Dec-2024 |
Tamir Duberstein <[email protected]> |
checkpatch: check return of `git_commit_info`
Avoid string concatenation with an undefined variable when a reference to a missing commit is contained in a `Fixes` tag.
Given this patch:
: From: Ta
checkpatch: check return of `git_commit_info`
Avoid string concatenation with an undefined variable when a reference to a missing commit is contained in a `Fixes` tag.
Given this patch:
: From: Tamir Duberstein <[email protected]> : Subject: Test patch : Date: Fri, 25 Oct 2024 19:30:51 -0400 : : This is a test patch. : : Fixes: deadbeef111 : Signed-off-by: Tamir Duberstein <[email protected]> : --- /dev/null : +++ b/new-file : @@ -0,0 +1 @@ : +Test.
Before:
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: ("commit title")' WARNING: Unknown commit id 'deadbeef111', maybe rebased or not pulled? Use of uninitialized value $cid in concatenation (.) or string at scripts/checkpatch.pl line 3242.
After:
WARNING: Unknown commit id 'deadbeef111', maybe rebased or not pulled?
This patch also reduce duplication slightly.
[[email protected]: s/12 chars of sha1/12+ chars of sha1/, per Jon] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Tamir Duberstein <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Joe Perches <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
10d27111 |
| 05-Dec-2024 |
Geert Uytterhoeven <[email protected]> |
checkpatch: update reference to include/asm-<arch>
Patch series "Update reference to include/asm-<arch>".
Despite "include/asm-<arch>" having been replaced by "arch/<arch>/include/asm" 15 years ago
checkpatch: update reference to include/asm-<arch>
Patch series "Update reference to include/asm-<arch>".
Despite "include/asm-<arch>" having been replaced by "arch/<arch>/include/asm" 15 years ago, there are still several references left.
This patch series updates the most visible ones.
This patch (of 3):
"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.
Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/2c4a75726a976d117055055b68a31c40dcab044e.1733404444.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Joe Perches <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Yury Norov <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
6356f18f |
| 05-Dec-2024 |
Geert Uytterhoeven <[email protected]> |
Align git commit ID abbreviation guidelines and checks
The guidelines for git commit ID abbreviation are inconsistent: some places state to use 12 characters exactly, while other places recommend 12
Align git commit ID abbreviation guidelines and checks
The guidelines for git commit ID abbreviation are inconsistent: some places state to use 12 characters exactly, while other places recommend 12 characters or more. The same issue is present in the checkpatch.pl script.
E.g. Documentation/dev-tools/checkpatch.rst says:
**GIT_COMMIT_ID** The proper way to reference a commit id is: commit <12+ chars of sha1> ("<title line>")
However, scripts/checkpatch.pl has two different checks: one warning check accepting 12 characters exactly:
# Check Fixes: styles is correct Please use correct Fixes: style 'Fixes: <12 chars of sha1> (\"<title line>\")'
and a second error check accepting 12-40 characters:
# Check for git id commit length and improperly formed commit descriptions # A correctly formed commit description is: # commit <SHA-1 hash length 12+ chars> ("Complete commit subject") Please use git commit description style 'commit <12+ chars of sha1>
Hence patches containing commit IDs with more than 12 characters are flagged by checkpatch, and sometimes rejected by maintainers or reviewers. This is becoming more important with the growth of the repository, as git may decide to use more characters in case of local conflicts.
Fix this by settling on at least 12 characters, in both the documentation and in the checkpatch.pl script.
Fixes: bd17e036b495bebb ("checkpatch: warn for non-standard fixes tag style") Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/1c244040bf6ce304656e31036e5178b4b9dfb719.1733421037.git.geert+renesas@glider.be Signed-off-by: Jonathan Corbet <[email protected]>
show more ...
|
| #
20d00cfa |
| 16-Dec-2024 |
Przemek Kitszel <[email protected]> |
checkpatch: don't complain on _Generic() use
Improve CamelCase recognition logic to avoid reporting on _Generic() use.
Other C keywords, such as _Bool, are intentionally omitted, as those should b
checkpatch: don't complain on _Generic() use
Improve CamelCase recognition logic to avoid reporting on _Generic() use.
Other C keywords, such as _Bool, are intentionally omitted, as those should be rather avoided in new source code.
Reviewed-by: Wojciech Drewek <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Mateusz Polchlopek <[email protected]> Acked-by: Joe Perches <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5 |
|
| #
2f07b652 |
| 25-Oct-2024 |
Tamir Duberstein <[email protected]> |
checkpatch: always parse orig_commit in fixes tag
Do not require the presence of `$balanced_parens` to get the commit SHA; this allows a `Fixes: deadbeef` tag to get a correct suggestion rather than
checkpatch: always parse orig_commit in fixes tag
Do not require the presence of `$balanced_parens` to get the commit SHA; this allows a `Fixes: deadbeef` tag to get a correct suggestion rather than a suggestion containing a reference to HEAD.
Given this patch:
: From: Tamir Duberstein <[email protected]> : Subject: Test patch : Date: Fri, 25 Oct 2024 19:30:51 -0400 : : This is a test patch. : : Fixes: bd17e036b495 : Signed-off-by: Tamir Duberstein <[email protected]> : --- /dev/null : +++ b/new-file : @@ -0,0 +1 @@ : +Test.
Before:
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: c10a7d25e68f ("Test patch")'
After:
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: bd17e036b495 ("checkpatch: warn for non-standard fixes tag style")'
The prior behavior incorrectly suggested the patch's own SHA and title line rather than the referenced commit's. This fixes that.
Ironically this:
Fixes: bd17e036b495 ("checkpatch: warn for non-standard fixes tag style") Signed-off-by: Tamir Duberstein <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Joe Perches <[email protected]> Cc: Louis Peens <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc: Niklas Söderlund <[email protected]> Cc: Philippe Schenker <[email protected]> Cc: Simon Horman <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.12-rc4 |
|
| #
6534086a |
| 14-Oct-2024 |
Anna-Maria Behnsen <[email protected]> |
checkpatch: Remove links to outdated documentation
checkpatch.pl checks for several things related to sleep and delay functions. In all warnings the outdated documentation is referenced. Also in che
checkpatch: Remove links to outdated documentation
checkpatch.pl checks for several things related to sleep and delay functions. In all warnings the outdated documentation is referenced. Also in checkpatch kernel documentation the outdated documentation is referenced.
Replace the links to the outdated documentation with links to the function description.
Note: Update of the outdated checkpatch checks is done in a second step.
Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/all/20241014-devel-anna-maria-b4-timers-flseep-v3-10-dc8b907cb62f@linutronix.de
show more ...
|
|
Revision tags: v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5 |
|
| #
82b8000c |
| 19-Aug-2024 |
Johannes Berg <[email protected]> |
net: drop special comment style
As we discussed in the room at netdevconf earlier this week, drop the requirement for special comment style for netdev.
For checkpatch, the general check accepts bot
net: drop special comment style
As we discussed in the room at netdevconf earlier this week, drop the requirement for special comment style for netdev.
For checkpatch, the general check accepts both right now, so simply drop the special request there as well.
Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4 |
|
| #
d5d6281a |
| 11-Jun-2024 |
Dan Carpenter <[email protected]> |
checkpatch: check for missing Fixes tags
This check looks for common words that probably indicate a patch is a fix. For now the regex is:
(?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller)/)
checkpatch: check for missing Fixes tags
This check looks for common words that probably indicate a patch is a fix. For now the regex is:
(?:(?:BUG: K.|UB)SAN: |Call Trace:|stable\@|syzkaller)/)
Why are stable patches encouraged to have a fixes tag? Some people mark their stable patches as "# 5.10" etc. This is useful but a Fixes tag is still a good idea. For example, the Fixes tag helps in review. It helps people to not cherry-pick buggy patches without also cherry-picking the fix.
Also if a bug affects the 5.7 kernel some people will round it up to 5.10+ because 5.7 is not supported on kernel.org. It's possible the Bad Binder bug was caused by this sort of gap where companies outside of kernel.org are supporting different kernels from kernel.org.
Should it be counted as a Fix when a patch just silences harmless WARN_ON() stack trace. Yes. Definitely.
Is silencing compiler warnings a fix? It seems unfair to the original authors, but we use -Werror now, and warnings break the build so let's just add Fixes tags. I tell people that silencing static checker warnings is not a fix but the rules on this vary by subsystem.
Is fixing a minor LTP issue (Linux Test Project) a fix? Probably? It's hard to know what to do if the LTP test has technically always been broken.
One clear false positive from this check is when someone updated their debug output and included before and after Call Traces. Or when crashes are introduced deliberately for testing. In those cases, you should just ignore checkpatch.
Link: https://lkml.kernel.org/r/ZmhUgZBKeF_8ixA6@moroto Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Kees Cook <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Joe Perches <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Thorsten Leemhuis <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
d6bb3951 |
| 10-Jun-2024 |
Wolfram Sang <[email protected]> |
checkpatch: really skip LONG_LINE_* when LONG_LINE is ignored
For a printout to happen, all types must be set to "show". So, AND is needed for the flags, not OR, if we want to ignore something.
Li
checkpatch: really skip LONG_LINE_* when LONG_LINE is ignored
For a printout to happen, all types must be set to "show". So, AND is needed for the flags, not OR, if we want to ignore something.
Link: https://lkml.kernel.org/r/[email protected] Fixes: 47e0c88b37a5 ("checkpatch: categorize some long line length checks") Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9 |
|
| #
b1be5844 |
| 07-May-2024 |
Xining Xu <[email protected]> |
scripts: checkpatch: check unused parameters for function-like macro
If function-like macros do not utilize a parameter, it might result in a build warning. In our coding style guidelines, we advoc
scripts: checkpatch: check unused parameters for function-like macro
If function-like macros do not utilize a parameter, it might result in a build warning. In our coding style guidelines, we advocate for utilizing static inline functions to replace such macros. This patch verifies compliance with the new rule.
For a macro such as the one below,
#define test(a) do { } while (0)
The test result is as follows.
WARNING: Argument 'a' is not used in function-like macro #21: FILE: mm/init-mm.c:20: +#define test(a) do { } while (0)
total: 0 errors, 1 warnings, 8 lines checked
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Xining Xu <[email protected]> Tested-by: Barry Song <[email protected]> Signed-off-by: Barry Song <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Mark Brown <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc: Max Filippov <[email protected]> Cc: Jeff Johnson <[email protected]> Cc: Charlemagne Lasse <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6 |
|
| #
2f9dadba |
| 16-Dec-2023 |
Marcelo Schmitt <[email protected]> |
scripts: checkpatch: Add __aligned to the list of attribute notes
Checkpatch presumes attributes marked with __aligned(alignment) are part of a function declaration and throws a warning stating that
scripts: checkpatch: Add __aligned to the list of attribute notes
Checkpatch presumes attributes marked with __aligned(alignment) are part of a function declaration and throws a warning stating that those compiler attributes should have an identifier name which is not correct. Add __aligned compiler attributes to the list of attribute notes so they don't cause warnings anymore.
Signed-off-by: Marcelo Schmitt <[email protected]> Acked-by: Joe Perches <[email protected]> Link: https://lore.kernel.org/r/1c5c93ecbd8c46a338b22a4ef52e51648e333c01.1702746240.git.marcelo.schmitt1@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1 |
|
| #
71aa3419 |
| 09-Nov-2023 |
Sergey Senozhatsky <[email protected]> |
checkpatch: do not require an empty line before error injection
ALLOW_ERROR_INJECTION macro (just like EXPORT_SYMBOL) can immediately follow a function it annotates.
Link: https://lkml.kernel.org/r
checkpatch: do not require an empty line before error injection
ALLOW_ERROR_INJECTION macro (just like EXPORT_SYMBOL) can immediately follow a function it annotates.
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Sergey Senozhatsky <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> (maintainer:CHECKPATCH) Cc: Dwaipayan Ray <[email protected]> (reviewer:CHECKPATCH) Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
9b5f621c |
| 06-Dec-2023 |
[email protected] <[email protected]> |
checkpatch: add ethtool_sprintf rules
Add some warnings for using ethtool_sprintf() where a simple ethtool_puts() would suffice.
The two cases are:
1) Use ethtool_sprintf() with just two arguments
checkpatch: add ethtool_sprintf rules
Add some warnings for using ethtool_sprintf() where a simple ethtool_puts() would suffice.
The two cases are:
1) Use ethtool_sprintf() with just two arguments: | ethtool_sprintf(&data, driver[i].name); or 2) Use ethtool_sprintf() with a standalone "%s" fmt string: | ethtool_sprintf(&data, "%s", driver[i].name);
The former may cause -Wformat-security warnings while the latter is just not preferred. Both are safely in the category of warnings, not errors.
Signed-off-by: Justin Stitt <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
|
Revision tags: v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4 |
|
| #
ff18cb81 |
| 25-Jul-2023 |
Joel Fernandes (Google) <[email protected]> |
Revert "checkpatch: Error out if deprecated RCU API used"
The definition for single-argument kfree_rcu() has been removed, so that any further attempt to use it will result in a build error. Because
Revert "checkpatch: Error out if deprecated RCU API used"
The definition for single-argument kfree_rcu() has been removed, so that any further attempt to use it will result in a build error. Because of this build error, there is no longer any need for a special check in checkpatch.pl.
Therefore, revert commit 1eacac3255495be7502d406e2ba5444fb5c3607c.
Signed-off-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
show more ...
|
| #
8e7b7ffb |
| 08-Aug-2023 |
Jim Cromie <[email protected]> |
checkpatch: reword long-line warning about commit-msg
Reword the warning to complain about line length 1st, since thats whats actually tested.
Link: https://lkml.kernel.org/r/20230808033019.21911-3
checkpatch: reword long-line warning about commit-msg
Reword the warning to complain about line length 1st, since thats whats actually tested.
Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Jim Cromie <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
| #
5b2c7334 |
| 08-Aug-2023 |
Jim Cromie <[email protected]> |
checkpatch: special case extern struct in .c
"externs should be avoided in .c files" needs an exception for linker symbols, like those that mark the start, stop of many kernel sections.
Since check
checkpatch: special case extern struct in .c
"externs should be avoided in .c files" needs an exception for linker symbols, like those that mark the start, stop of many kernel sections.
Since checkpatch already checks REALNAME to avoid looking at fragments changing vmlinux.lds.h, add a new else-if block to look at them instead. As a simple heuristic, treat all words (in the patch-line) as possible symbols, to screen later warnings.
For my test case, the possible-symbols included BOUNDED_BY (a macro), which is extra, but not troublesome - these are just to screen WARNINGS that might be issued on later fragments (changing .c files)
Where the WARN is issued, precede it with an else-if block to catch one common extern-in-c use case: "extern struct foo bar[]". Here we can at least issue a softer warning, after checking for a match with a maybe-linker-symbol parsed earlier from the patch.
Though heuristic, it worked for my test-case, allowing both start__, stop__ $symbol's (wo the prefixes specifically named). I've coded it narrowly, it can be expanded later to cover any other expressions.
It does require that the externs in .c's have the additions to vmlinux.lds.h in the same patch. And requires vmlinux.lds.h before .c fragments.
Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jim Cromie <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc3, v6.5-rc2, v6.5-rc1 |
|
| #
84dd7f19 |
| 06-Jul-2023 |
Paul E. McKenney <[email protected]> |
checkpatch: Complain about unexpected uses of RCU Tasks Trace
RCU Tasks Trace is quite specialized, having been created specifically for sleepable BPF programs. Because it allows general blocking w
checkpatch: Complain about unexpected uses of RCU Tasks Trace
RCU Tasks Trace is quite specialized, having been created specifically for sleepable BPF programs. Because it allows general blocking within readers, any new use of RCU Tasks Trace must take current use cases into account. Therefore, update checkpatch.pl to complain about use of any of the RCU Tasks Trace API members outside of BPF and outside of RCU itself.
[ paulmck: Apply Joe Perches feedback. ]
Cc: Andy Whitcroft <[email protected]> (maintainer:CHECKPATCH) Cc: Joe Perches <[email protected]> (maintainer:CHECKPATCH) Cc: Dwaipayan Ray <[email protected]> (reviewer:CHECKPATCH) Cc: Lukas Bulwahn <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: John Fastabend <[email protected]> Cc: <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
show more ...
|
|
Revision tags: v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4 |
|
| #
54da6a09 |
| 26-May-2023 |
Peter Zijlstra <[email protected]> |
locking: Introduce __cleanup() based infrastructure
Use __attribute__((__cleanup__(func))) to build:
- simple auto-release pointers using __free()
- 'classes' with constructor and destructor sem
locking: Introduce __cleanup() based infrastructure
Use __attribute__((__cleanup__(func))) to build:
- simple auto-release pointers using __free()
- 'classes' with constructor and destructor semantics for scope-based resource management.
- lock guards based on the above classes.
Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/20230612093537.614161713%40infradead.org
show more ...
|
| #
f26799ff |
| 01-Jun-2023 |
Kees Cook <[email protected]> |
checkpatch: check for 0-length and 1-element arrays
Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_
checkpatch: check for 0-length and 1-element arrays
Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_SOURCE and CONFIG_UBSAN_BOUNDS can provide proper array bounds checking.
[[email protected]: various suggestions] Link: https://lkml.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]> Acked-by: Gustavo A. R. Silva <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|
|
Revision tags: v6.4-rc3 |
|
| #
8515e4a7 |
| 17-May-2023 |
Kees Cook <[email protected]> |
checkpatch: Check for 0-length and 1-element arrays
Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_S
checkpatch: Check for 0-length and 1-element arrays
Fake flexible arrays have been deprecated since last millennium. Proper C99 flexible arrays must be used throughout the kernel so CONFIG_FORTIFY_SOURCE and CONFIG_UBSAN_BOUNDS can provide proper array bounds checking.
Cc: Andy Whitcroft <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Fixed-by: Joe Perches <[email protected]> Signed-off-by: Kees Cook <[email protected]> Acked-by: Gustavo A. R. Silva <[email protected]> Acked-by: Joe Perches <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
| #
d0f90841 |
| 17-May-2023 |
Kees Cook <[email protected]> |
checkpatch: Check for strcpy and strncpy too
Warn about strcpy(), strncpy(), and strlcpy(). Suggest strscpy() and include pointers to the open KSPP issues for each, which has further details and rep
checkpatch: Check for strcpy and strncpy too
Warn about strcpy(), strncpy(), and strlcpy(). Suggest strscpy() and include pointers to the open KSPP issues for each, which has further details and replacement procedures.
Cc: Andy Whitcroft <[email protected]> Cc: Joe Perches <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|