Skip to contentSkip to conversation

Bluetooth: Annotate implicit fall through in l2cap_config_rsp

PATCH In review Mathieu Malaterre 2 participants 5 messages Jan 24, 2019 – Jan 25, 2019

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

PATCH 1/2 Bluetooth: Annotate implicit fall through in l2cap_config_rsp

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit removes the following warning:

net/bluetooth/l2cap_core.c:4223:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 net/bluetooth/l2cap_core.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/l2cap_core.c +1 -0
index 2a7fb517d460..a5b76e24940a 100644
@@ -4244,6 +4244,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn,
 				goto done;
 			break;
 		}
+		/* fall through */
 
 	default:
 		l2cap_chan_set_err(chan, ECONNRESET);
Signature · 1 line
2.19.2
#1 lore raw

PATCH 2/2 Bluetooth: Correctly annotate implicit fall through in __rfcomm_dlc_close

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

In this particular case put the fall through comment on a separate line so as to match the regular expression expected by GCC.

This commit removes the following warning:

net/bluetooth/rfcomm/core.c:479:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 net/bluetooth/rfcomm/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/bluetooth/rfcomm/core.c +2 -3
index 1a635df80643..caaae6accafa 100644
@@ -480,9 +480,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 			__rfcomm_dlc_disconn(d);
 			break;
 		}
-		/* if closing a dlc in a session that hasn't been started,
-		 * just close and unlink the dlc
-		 */
+		/* fall through - if closing a dlc in a session that hasn't */
+		/* been started, just close and unlink the dlc */
 
 	default:
 		rfcomm_dlc_clear_timer(d);
Signature · 1 line
2.19.2
#2 lore raw

Re: [PATCH 2/2] Bluetooth: Correctly annotate implicit fall through in __rfcomm_dlc_close

Quoted 10 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

In this particular case put the fall through comment on a separate line so as to match the regular expression expected by GCC.

This commit removes the following warning:

net/bluetooth/rfcomm/core.c:479:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Please discard, already fixed by :

6317950c1b9c Bluetooth: Mark expected switch fall-throughs

Quoted 25 lines
---
 net/bluetooth/rfcomm/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/bluetooth/rfcomm/core.c +2 -4
index 1a635df80643..caaae6accafa 100644
@@ -480,9 +480,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
                        __rfcomm_dlc_disconn(d);
                        break;
                }
-               /* if closing a dlc in a session that hasn't been started,
-                * just close and unlink the dlc
-                */
+               /* fall through - if closing a dlc in a session that hasn't */
+               /* been started, just close and unlink the dlc */
 
        default:
                rfcomm_dlc_clear_timer(d);
--

2.19.2

maintainer
#3 lore raw
In reply to Mathieu Malaterre

Hi Mathieu,

Quoted 5 lines

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit removes the following warning:

Quoted 7 lines

net/bluetooth/l2cap_core.c:4223:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
net/bluetooth/l2cap_core.c | 1 +

1 file changed, 1 insertion(+)

the patches don’t apply cleanly against bluetooth-next tree. Please fix it up and resend.

Regards

Marcel

#4 lore raw
Quoted 10 lines · Marcel Holtmann

Hi Mathieu,

Quoted 7 lines

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit removes the following warning:

net/bluetooth/l2cap_core.c:4223:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 7 lines
Quoted 5 lines

---
net/bluetooth/l2cap_core.c | 1 +

1 file changed, 1 insertion(+)

the patches don’t apply cleanly against bluetooth-next tree. Please fix it up and resend.

Never mind, both warnings are already fixed by:

6317950c1b9c Bluetooth: Mark expected switch fall-throughs

Sorry for the noise

Quoted 4 lines

Regards

Marcel