diff mbox

[2/2] nfc: st21nfca: Remove unnecessary devm_kzalloc() cast

Message ID 1521899099-23634-2-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Delegated to: Samuel Ortiz
Headers show

Commit Message

Fabio Estevam March 24, 2018, 1:44 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

There is no need to use cast for the returned value
from memory allocation functions, so remove the unnecessary cast.

Detected via Coccinelle script:
scripts/coccinelle/api/alloc/alloc_cast.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/nfc/st21nfca/se.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/nfc/st21nfca/se.c b/drivers/nfc/st21nfca/se.c
index fd967a3..5b63549 100644
--- a/drivers/nfc/st21nfca/se.c
+++ b/drivers/nfc/st21nfca/se.c
@@ -326,8 +326,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;