Skip to contentSkip to conversation

nfc: st21nfca: Remove unnecessary cast

PATCH Applied Alex Dewar 2 participants 2 messages Aug 20, 2020

Subsystems (3)
lore
Share & tools
lore

Alex Dewar

author
#0 lore raw

PATCH 1/1 nfc: st21nfca: Remove unnecessary cast

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

Issue identified with Coccinelle.

---
 drivers/nfc/st21nfca/se.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/nfc/st21nfca/se.c +1 -2
index 6586378cacb0..c8bdf078d111 100644
@@ -315,8 +315,7 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
 		    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;
 
Signature · 1 line
2.28.0
maintainer Applied
#1 lore raw

From: Alex Dewar <[email protected]>
Date: Thu, 20 Aug 2020 19:38:36 +0100

Quoted 6 lines

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

Issue identified with Coccinelle.

Applied.