Skip to contentSkip to conversation

xen-netfront: mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 4 participants 9 messages Apr 15, 2019 – Apr 24, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netfront: mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 drivers/net/xen-netfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
index 80c30321de41..8d33970a2950 100644
@@ -2037,7 +2037,7 @@ static void netback_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* Missed the backend's CLOSING state -- fallthrough */
+		/* Fall through - Missed the backend's CLOSING state. */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
Signature · 1 line
2.21.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Juergen

#2 lore raw
Quoted 19 lines · Juergen Gross
Quoted 18 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

Quoted 7 lines
Quoted 4 lines

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Thanks, Juergen.
--
Gustavo

#3 lore raw
In reply to Juergen Gross
Quoted 19 lines · Juergen Gross
Quoted 18 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

Quoted 7 lines
Quoted 4 lines

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Thanks, Juergen.
--
Gustavo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Gustavo A. R. Silva
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer
#5 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 15 Apr 2019 16:11:41 -0500

Quoted 15 lines

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Applied.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer Applied
#6 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 15 Apr 2019 16:11:41 -0500

Quoted 15 lines

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Applied.

#7 lore raw
In reply to Gustavo A. R. Silva
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Applied to for-linus-5.2

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw
In reply to Gustavo A. R. Silva
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/xen-netfront.c: In function ‘netback_changed’:
drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (dev->state == XenbusStateClosed)

      ^

drivers/net/xen-netfront.c:2041:2: note: here
case XenbusStateClosing:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Quoted 7 lines

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Applied to for-linus-5.2

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel