[PATCH] nfc: st-nci: Remove unnecessary cast

Subsystems: nfc subsystem, the rest

STALE2211d

2 messages, 2 authors, 2020-08-20 · open the first message on its own page

[PATCH] nfc: st-nci: Remove unnecessary cast

From: Alex Dewar <hidden>
Date: 2020-08-20 18:33:14

In st_nci_hci_connectivity_event_received(), the return value of
devm_kzalloc() is unnecessarily cast from void*. Remove cast.

Issue identified with Coccinelle.

Signed-off-by: Alex Dewar <redacted>
---
 drivers/nfc/st-nci/se.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nfc/st-nci/se.c b/drivers/nfc/st-nci/se.c
index f25f1ec5f9e9..807eae04c1e3 100644
--- a/drivers/nfc/st-nci/se.c
+++ b/drivers/nfc/st-nci/se.c
@@ -331,8 +331,7 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,
 		    skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG)
 			return -EPROTO;
 
-		transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
-					    skb->len - 2, GFP_KERNEL);
+		transaction = devm_kzalloc(dev, skb->len - 2, GFP_KERNEL);
 		if (!transaction)
 			return -ENOMEM;
 
-- 
2.28.0

Re: [PATCH] nfc: st-nci: Remove unnecessary cast

From: David Miller <davem@davemloft.net>
Date: 2020-08-20 23:18:50

From: Alex Dewar <redacted>
Date: Thu, 20 Aug 2020 19:32:58 +0100
In st_nci_hci_connectivity_event_received(), the return value of
devm_kzalloc() is unnecessarily cast from void*. Remove cast.

Issue identified with Coccinelle.

Signed-off-by: Alex Dewar <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help