linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Network Development <netdev@vger.kernel.org>,
	linux-parisc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] net: tulip: Adjust indentation in {dmfe,uli526x}_init_module
Date: Mon, 9 Dec 2019 13:22:46 -0800	[thread overview]
Message-ID: <CAKwvOd=UgY8+w9MVjJa-xpZ-08K9zrn79226otp2=TOCFT6MnQ@mail.gmail.com> (raw)
In-Reply-To: <20191209211623.44166-1-natechancellor@gmail.com>

On Mon, Dec 9, 2019 at 1:16 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> 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>

/^ \t
in vim turns up a few more cases that I think should be fixed (in both files)

> ---
>  drivers/net/ethernet/dec/tulip/dmfe.c    | 7 ++++---
>  drivers/net/ethernet/dec/tulip/uli526x.c | 4 ++--
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/dec/tulip/dmfe.c b/drivers/net/ethernet/dec/tulip/dmfe.c
> index 0efdbd1a4a6f..32d470d4122a 100644
> --- a/drivers/net/ethernet/dec/tulip/dmfe.c
> +++ b/drivers/net/ethernet/dec/tulip/dmfe.c
> @@ -2214,15 +2214,16 @@ static int __init dmfe_init_module(void)
>         if (cr6set)
>                 dmfe_cr6_user_set = cr6set;
>
> -       switch(mode) {
> -       case DMFE_10MHF:
> +       switch (mode) {
> +       case DMFE_10MHF:
>         case DMFE_100MHF:
>         case DMFE_10MFD:
>         case DMFE_100MFD:
>         case DMFE_1M_HPNA:
>                 dmfe_media_mode = mode;
>                 break;
> -       default:dmfe_media_mode = DMFE_AUTO;
> +       default:
> +               dmfe_media_mode = DMFE_AUTO;
>                 break;
>         }
>
> diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c
> index b1f30b194300..117ffe08800d 100644
> --- a/drivers/net/ethernet/dec/tulip/uli526x.c
> +++ b/drivers/net/ethernet/dec/tulip/uli526x.c
> @@ -1809,8 +1809,8 @@ static int __init uli526x_init_module(void)
>         if (cr6set)
>                 uli526x_cr6_user_set = cr6set;
>
> -       switch (mode) {
> -       case ULI526X_10MHF:
> +       switch (mode) {
> +       case ULI526X_10MHF:
>         case ULI526X_100MHF:
>         case ULI526X_10MFD:
>         case ULI526X_100MFD:
> --
> 2.24.0
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20191209211623.44166-1-natechancellor%40gmail.com.



-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2019-12-09 21:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 21:16 [PATCH] net: tulip: Adjust indentation in {dmfe,uli526x}_init_module Nathan Chancellor
2019-12-09 21:22 ` Nick Desaulniers [this message]
2019-12-10  4:29 ` David Miller
2019-12-10 19:41   ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOd=UgY8+w9MVjJa-xpZ-08K9zrn79226otp2=TOCFT6MnQ@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).