linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guo Ren <guoren@kernel.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-csky@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] csky: fix syscache.c fallthrough warning
Date: Tue, 13 Apr 2021 12:01:06 +0800	[thread overview]
Message-ID: <CAJF2gTThvx36XmatbxyuYBEj5b264ueA8NGrS_KuFVtcA_CD-g@mail.gmail.com> (raw)
In-Reply-To: <20210411164104.5734-1-rdunlap@infradead.org>

Acked-by: Guo Ren <guoren@kernel.org>

It's a fallthrough is for BCACHE, but affects ICACHE with more
expensive. I'll fix up it later.

        }

On Mon, Apr 12, 2021 at 12:41 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> This case of the switch statement falls through to the following case.
> This appears to be on purpose, so declare it as OK.
>
> ../arch/csky/mm/syscache.c: In function '__do_sys_cacheflush':
> ../arch/csky/mm/syscache.c:17:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    17 |   flush_icache_mm_range(current->mm,
>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    18 |     (unsigned long)addr,
>       |     ~~~~~~~~~~~~~~~~~~~~
>    19 |     (unsigned long)addr + bytes);
>       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../arch/csky/mm/syscache.c:20:2: note: here
>    20 |  case DCACHE:
>       |  ^~~~
>
> Fixes: 997153b9a75c ("csky: Add flush_icache_mm to defer flush icache all")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Guo Ren <guoren@kernel.org>
> Cc: linux-csky@vger.kernel.org
> Cc: Arnd Bergmann <arnd@arndb.de>
> ---
> @Guo, should this be a "break" instead of fallthrough?
>
>  arch/csky/mm/syscache.c |    1 +
>  1 file changed, 1 insertion(+)
>
> --- linux-next-20210409.orig/arch/csky/mm/syscache.c
> +++ linux-next-20210409/arch/csky/mm/syscache.c
> @@ -17,6 +17,7 @@ SYSCALL_DEFINE3(cacheflush,
>                 flush_icache_mm_range(current->mm,
>                                 (unsigned long)addr,
>                                 (unsigned long)addr + bytes);
> +               fallthrough;
>         case DCACHE:
>                 dcache_wb_range((unsigned long)addr,
>                                 (unsigned long)addr + bytes);



--
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

      reply	other threads:[~2021-04-13  4:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 16:41 [PATCH] csky: fix syscache.c fallthrough warning Randy Dunlap
2021-04-13  4:01 ` Guo Ren [this message]

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=CAJF2gTThvx36XmatbxyuYBEj5b264ueA8NGrS_KuFVtcA_CD-g@mail.gmail.com \
    --to=guoren@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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).