Commit 8bf425d
checkpatch: skip warnings for symbol links
If there is a symbol link in the given patch, like the following one:
$ cat 0001-selftests-bpf-Add-mptcp-pm_nl_ctl-link.patch
'''
# diff --git a/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c \
# b/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c
# new file mode 120000
# index 000000000000..5a08c25
# --- /dev/null
# +++ b/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c
# @@ -0,0 +1 @@
# +../net/mptcp/pm_nl_ctl.c
# \ No newline at end of file
'''
checkpatch.pl reports two inaccurate warnings:
'''
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
torvalds#65: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1:
+../net/mptcp/pm_nl_ctl.c
WARNING: adding a line without newline at end of file
torvalds#65: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1:
+../net/mptcp/pm_nl_ctl.c
'''
And three checks if run it with strict option:
'''
CHECK: spaces preferred around that '/' (ctx:VxV)
torvalds#65: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1:
+../net/mptcp/pm_nl_ctl.c
^
CHECK: spaces preferred around that '/' (ctx:VxV)
torvalds#65: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1:
+../net/mptcp/pm_nl_ctl.c
^
CHECK: spaces preferred around that '/' (ctx:VxV)
torvalds#65: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1:
+../net/mptcp/pm_nl_ctl.c
'''
This patch fixes this by adding a new variable $symbol_link in checkpatch
script, set it if the new file mode is 120000. Skip "missing or malformed
SPDX-License-Identifier tag", "adding a line without newline at end of
file" and "spaces preferred around that '/'" checks if this variable is
set.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>1 parent 13f8e00 commit 8bf425d
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2694 | 2694 | | |
2695 | 2695 | | |
2696 | 2696 | | |
| 2697 | + | |
| 2698 | + | |
2697 | 2699 | | |
2698 | 2700 | | |
2699 | 2701 | | |
| |||
3564 | 3566 | | |
3565 | 3567 | | |
3566 | 3568 | | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
3567 | 3574 | | |
3568 | 3575 | | |
3569 | 3576 | | |
| |||
3756 | 3763 | | |
3757 | 3764 | | |
3758 | 3765 | | |
3759 | | - | |
| 3766 | + | |
| 3767 | + | |
3760 | 3768 | | |
3761 | 3769 | | |
3762 | 3770 | | |
| |||
3867 | 3875 | | |
3868 | 3876 | | |
3869 | 3877 | | |
3870 | | - | |
| 3878 | + | |
| 3879 | + | |
3871 | 3880 | | |
3872 | 3881 | | |
3873 | 3882 | | |
| |||
5293 | 5302 | | |
5294 | 5303 | | |
5295 | 5304 | | |
5296 | | - | |
| 5305 | + | |
5297 | 5306 | | |
5298 | 5307 | | |
5299 | 5308 | | |
| |||
0 commit comments