From: Fabio Estevam <festevam@gmail.com>
To: sameo@linux.intel.com
Cc: linux-wireless@vger.kernel.org, christophe.ricard@gmail.com,
linux-nfc@lists.01.org, Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH 2/2] nfc: st21nfca: Remove unnecessary devm_kzalloc() cast
Date: Sat, 24 Mar 2018 10:44:59 -0300 [thread overview]
Message-ID: <1521899099-23634-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1521899099-23634-1-git-send-email-festevam@gmail.com>
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 --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;
--
2.7.4
next prev parent reply other threads:[~2018-03-24 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 13:44 [PATCH 1/2] nfc: st21nfca: Check for devm_kzalloc() failure Fabio Estevam
2018-03-24 13:44 ` Fabio Estevam [this message]
2018-04-23 11:50 ` Fabio Estevam
2018-06-04 4:26 ` Samuel Ortiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521899099-23634-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=christophe.ricard@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=linux-nfc@lists.01.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).