Skip to content

Commit a01bcfd

Browse files
NFC: st21nfca: Fix fall-through warnings
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings by adding a missing break and a fall-through annotation: drivers/nfc/st21nfca/dep.c: In function ‘st21nfca_tm_event_send_data’: drivers/nfc/st21nfca/dep.c:391:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (cmd1) { ^~~~~~ drivers/nfc/st21nfca/dep.c:404:2: note: here default: ^~~~~~~ In file included from ./include/linux/kernel.h:15, from ./include/linux/skbuff.h:17, from ./include/net/nfc/hci.h:21, from drivers/nfc/st21nfca/dep.c:17: drivers/nfc/st21nfca/dep.c: In function ‘st21nfca_im_recv_dep_res_cb’: ./include/linux/printk.h:303:2: warning: this statement may fall through [-Wimplicit-fallthrough=] printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/nfc/st21nfca/dep.c:622:4: note: in expansion of macro ‘pr_err’ pr_err("Received a ACK/NACK PDU\n"); ^~~~~~ drivers/nfc/st21nfca/dep.c:623:3: note: here case ST21NFCA_NFC_DEP_PFB_I_PDU: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
1 parent 9fe0a75 commit a01bcfd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/nfc/st21nfca

‎drivers/nfc/st21nfca/dep.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ static int st21nfca_tm_event_send_data(struct nfc_hci_dev *hdev,
400400
default:
401401
return 1;
402402
}
403+
break;
403404
default:
404405
return 1;
405406
}
@@ -619,6 +620,7 @@ static void st21nfca_im_recv_dep_res_cb(void *context, struct sk_buff *skb,
619620
switch (ST21NFCA_NFC_DEP_PFB_TYPE(dep_res->pfb)) {
620621
case ST21NFCA_NFC_DEP_PFB_ACK_NACK_PDU:
621622
pr_err("Received a ACK/NACK PDU\n");
623+
/* fall through */
622624
case ST21NFCA_NFC_DEP_PFB_I_PDU:
623625
info->dep_info.curr_nfc_dep_pni =
624626
ST21NFCA_NFC_DEP_PFB_PNI(dep_res->pfb + 1);

0 commit comments

Comments
 (0)