lkml.org 
[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: tulip: Adjust indentation in {dmfe,uli526x}_init_module
On Mon, Dec 09, 2019 at 08:29:20PM -0800, David Miller wrote:
> From: Nathan Chancellor <natechancellor@gmail.com>
> Date: Mon, 9 Dec 2019 14:16:23 -0700
>
> > Clang warns:
> >
> > ../drivers/net/ethernet/dec/tulip/uli526x.c:1812:3: warning: misleading
> > indentation; statement is not part of the previous 'if'
> > [-Wmisleading-indentation]
> > switch (mode) {
> > ^
> > ../drivers/net/ethernet/dec/tulip/uli526x.c:1809:2: note: previous
> > statement is here
> > if (cr6set)
> > ^
> > 1 warning generated.
> >
> > ../drivers/net/ethernet/dec/tulip/dmfe.c:2217:3: warning: misleading
> > indentation; statement is not part of the previous 'if'
> > [-Wmisleading-indentation]
> > switch(mode) {
> > ^
> > ../drivers/net/ethernet/dec/tulip/dmfe.c:2214:2: note: previous
> > statement is here
> > if (cr6set)
> > ^
> > 1 warning generated.
> >
> > This warning occurs because there is a space before the tab on these
> > lines. Remove them so that the indentation is consistent with the Linux
> > kernel coding style and clang no longer warns.
> >
> > While we are here, adjust the default block in dmfe_init_module to have
> > a proper break between the label and assignment and add a space between
> > the switch and opening parentheses to avoid a checkpatch warning.
> >
> > Fixes: e1c3e5014040 ("[PATCH] initialisation cleanup for ULI526x-net-driver")
> > Link: https://github.com/ClangBuiltLinux/linux/issues/795
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
>
> Applied, but it's really crummy that the tool gets tripped up by the
> fact that a space preceeds the TAB. It's what the code visually looks
> like, not what exact kinds of SPACE characters were used to get there.

I agree. There is a follow up patch from the author of the warning that
claims to alieviate some of these but that is still in discussion and as
far as I understand it, it won't fix all of them so I'm just dealing
with all of them on the Linux side.

https://reviews.llvm.org/D71037

Thanks for picking them up!
Nathan

\
 
 \ /
  Last update: 2019-12-10 20:42    [W:2.097 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site