linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* False-positive in Checkpatch
@ 2022-08-17  8:29 Matthias May
  2022-08-17 11:20 ` Lukas Bulwahn
  2022-08-18  4:35 ` Joe Perches
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias May @ 2022-08-17  8:29 UTC (permalink / raw)
  To: apw, joe, dwaipayanray1, lukas.bulwahn, linux-kernel, bpf


[-- Attachment #1.1: Type: text/plain, Size: 492 bytes --]

Hi Checkpatch Maintainers

The selftest patch at
https://lore.kernel.org/netdev/20220817073649.26117-1-matthias.may@westermo.com/T/#u
claims too long lines.
However this seems to be a misinterpretation of the indention before the printf split over 2
lines to exactly not have too long lines.
The false positive checkpatch results are also on the netdev patchwork:
https://patchwork.kernel.org/project/netdevbpf/patch/20220817073649.26117-1-matthias.may@westermo.com/

BR
Matthias

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: False-positive in Checkpatch
  2022-08-17  8:29 False-positive in Checkpatch Matthias May
@ 2022-08-17 11:20 ` Lukas Bulwahn
  2022-08-18  4:35 ` Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: Lukas Bulwahn @ 2022-08-17 11:20 UTC (permalink / raw)
  To: Matthias May
  Cc: Andy Whitcroft, Joe Perches, Dwaipayan Ray,
	Linux Kernel Mailing List, bpf

On Wed, Aug 17, 2022 at 10:29 AM Matthias May <matthias.may@westermo.com> wrote:
>
> Hi Checkpatch Maintainers
>
> The selftest patch at
> https://lore.kernel.org/netdev/20220817073649.26117-1-matthias.may@westermo.com/T/#u
> claims too long lines.
> However this seems to be a misinterpretation of the indention before the printf split over 2
> lines to exactly not have too long lines.
> The false positive checkpatch results are also on the netdev patchwork:
> https://patchwork.kernel.org/project/netdevbpf/patch/20220817073649.26117-1-matthias.may@westermo.com/
>

Hi Matthias,

Thanks for reporting. I tried checkpatch on this referred patch and
can confirm that it reports:

WARNING: line length of 132 exceeds 100 columns
#413: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:359:
+printf "┌────────┬───────┬───────┬──────────────┬"

WARNING: line length of 107 exceeds 100 columns
#414: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:360:
+printf "──────────────┬───────┬────────┐\n"

WARNING: line length of 148 exceeds 100 columns
#420: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:366:
+ printf "├────────┼───────┼───────┼──────────────┼"

WARNING: line length of 123 exceeds 100 columns
#421: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:367:
+ printf "──────────────┼───────┼────────┤\n"

WARNING: line length of 156 exceeds 100 columns
#425: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:371:
+ printf "├────────┼───────┼───────┼──────────────┼"

WARNING: line length of 131 exceeds 100 columns
#426: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:372:
+ printf "──────────────┼───────┼────────┤\n"

WARNING: line length of 132 exceeds 100 columns
#439: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:385:
+printf "└────────┴───────┴───────┴──────────────┴"

WARNING: line length of 107 exceeds 100 columns
#440: FILE: tools/testing/selftests/net/l2_tos_ttl_inherit.sh:386:
+printf "──────────────┴───────┴────────┘\n"


In my editor (vim), these lines are rather short but it seems the real
line number is much larger.

For example, in line 420, vim states "420,135-66" at the end of the
line. So, there are clearly different ways of counting the number of
characters this line has. I think that at least explains it, I really
do not know which way of counting is the best, though.

Lukas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: False-positive in Checkpatch
  2022-08-17  8:29 False-positive in Checkpatch Matthias May
  2022-08-17 11:20 ` Lukas Bulwahn
@ 2022-08-18  4:35 ` Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2022-08-18  4:35 UTC (permalink / raw)
  To: Matthias May, apw, dwaipayanray1, lukas.bulwahn, linux-kernel, bpf

On Wed, 2022-08-17 at 10:29 +0200, Matthias May wrote:
> Hi Checkpatch Maintainers
> 
> The selftest patch at
> https://lore.kernel.org/netdev/20220817073649.26117-1-matthias.may@westermo.com/T/#u
> claims too long lines.
> However this seems to be a misinterpretation of the indention before the printf split over 2
> lines to exactly not have too long lines.
> The false positive checkpatch results are also on the netdev patchwork:
> https://patchwork.kernel.org/project/netdevbpf/patch/20220817073649.26117-1-matthias.may@westermo.com/

Each character in the boxing output is actually 3 ascii characters.
checkpatch doesn't interpret unicode within character strings.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-18  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17  8:29 False-positive in Checkpatch Matthias May
2022-08-17 11:20 ` Lukas Bulwahn
2022-08-18  4:35 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).