u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] cmd: convert fallthrough comment.
@ 2023-04-01  7:14 Heinrich Schuchardt
  2023-04-02  2:26 ` Simon Glass
  2023-04-07 14:50 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2023-04-01  7:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, u-boot, Heinrich Schuchardt

gcc does not understand /* FALL TROUGH */ and emits a warning:

    cmd/date.c: In function ‘do_date’:
    cmd/date.c:62:20: warning:
    this statement may fall through [-Wimplicit-fallthrough=]
       62 |                 if (strcmp(argv[1],"reset") == 0) {
          |                    ^
    cmd/date.c:102:9: note: here
      102 |         case 1:                 /* get date & time */
          |         ^~~~

Use the fallthrough macro instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 cmd/date.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/date.c b/cmd/date.c
index 58505e6e1d..fe9c8c6534 100644
--- a/cmd/date.c
+++ b/cmd/date.c
@@ -98,7 +98,7 @@ static int do_date(struct cmd_tbl *cmdtp, int flag, int argc,
 				puts("## Get date failed\n");
 			}
 		}
-		/* FALL TROUGH */
+		fallthrough;
 	case 1:			/* get date & time */
 #ifdef CONFIG_DM_RTC
 		rcode = dm_rtc_get(dev, &tm);
-- 
2.39.2


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

* Re: [PATCH 1/1] cmd: convert fallthrough comment.
  2023-04-01  7:14 [PATCH 1/1] cmd: convert fallthrough comment Heinrich Schuchardt
@ 2023-04-02  2:26 ` Simon Glass
  2023-04-07 14:50 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2023-04-02  2:26 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Tom Rini, U-Boot Mailing List

On Sat, 1 Apr 2023 at 20:14, Heinrich Schuchardt <
heinrich.schuchardt@canonical.com> wrote:
>
> gcc does not understand /* FALL TROUGH */ and emits a warning:
>
>     cmd/date.c: In function ‘do_date’:
>     cmd/date.c:62:20: warning:
>     this statement may fall through [-Wimplicit-fallthrough=]
>        62 |                 if (strcmp(argv[1],"reset") == 0) {
>           |                    ^
>     cmd/date.c:102:9: note: here
>       102 |         case 1:                 /* get date & time */
>           |         ^~~~
>
> Use the fallthrough macro instead.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  cmd/date.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH 1/1] cmd: convert fallthrough comment.
  2023-04-01  7:14 [PATCH 1/1] cmd: convert fallthrough comment Heinrich Schuchardt
  2023-04-02  2:26 ` Simon Glass
@ 2023-04-07 14:50 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2023-04-07 14:50 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

On Sat, Apr 01, 2023 at 09:14:11AM +0200, Heinrich Schuchardt wrote:

> gcc does not understand /* FALL TROUGH */ and emits a warning:
> 
>     cmd/date.c: In function ‘do_date’:
>     cmd/date.c:62:20: warning:
>     this statement may fall through [-Wimplicit-fallthrough=]
>        62 |                 if (strcmp(argv[1],"reset") == 0) {
>           |                    ^
>     cmd/date.c:102:9: note: here
>       102 |         case 1:                 /* get date & time */
>           |         ^~~~
> 
> Use the fallthrough macro instead.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2023-04-07 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01  7:14 [PATCH 1/1] cmd: convert fallthrough comment Heinrich Schuchardt
2023-04-02  2:26 ` Simon Glass
2023-04-07 14:50 ` Tom Rini

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).