summaryrefslogtreecommitdiff
path: root/drivers/nfc/st21nfca
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-02-12 11:35:21 -0600
committerGustavo A. R. Silva <gustavo@embeddedor.com>2019-04-09 12:08:27 -0500
commita01bcfd6990d18d97f88c01d3082e562a562cc4d (patch)
tree2d63b364cee94a6e9c9b2618db2e4ef5f3c31b5c /drivers/nfc/st21nfca
parent9fe0a75908903428ef33d05a4f4842a057b36a62 (diff)
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>
Diffstat (limited to 'drivers/nfc/st21nfca')
-rw-r--r--drivers/nfc/st21nfca/dep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
index fd08be2917e6..c005997493af 100644
--- a/drivers/nfc/st21nfca/dep.c
+++ b/drivers/nfc/st21nfca/dep.c
@@ -400,6 +400,7 @@ static int st21nfca_tm_event_send_data(struct nfc_hci_dev *hdev,
default:
return 1;
}
+ break;
default:
return 1;
}
@@ -619,6 +620,7 @@ static void st21nfca_im_recv_dep_res_cb(void *context, struct sk_buff *skb,
switch (ST21NFCA_NFC_DEP_PFB_TYPE(dep_res->pfb)) {
case ST21NFCA_NFC_DEP_PFB_ACK_NACK_PDU:
pr_err("Received a ACK/NACK PDU\n");
+ /* fall through */
case ST21NFCA_NFC_DEP_PFB_I_PDU:
info->dep_info.curr_nfc_dep_pni =
ST21NFCA_NFC_DEP_PFB_PNI(dep_res->pfb + 1);