linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc
@ 2017-07-09  5:43 Gustavo A. R. Silva
  2017-07-09  5:45 ` [PATCH 2/2] staging: ccree: use sizeof(*var) in kmalloc Gustavo A. R. Silva
  2017-07-11 13:44 ` [PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc Gilad Ben-Yossef
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-07-09  5:43 UTC (permalink / raw)
  To: Gilad Ben-Yossef, Greg Kroah-Hartman
  Cc: linux-crypto, driverdev-devel, devel, linux-kernel,
	Gustavo A. R. Silva

The assignment operator implicitly converts a void pointer to the type of the
pointer it is assigned to.

This issue was detected using Coccinelle and the following semantic patch:

@@
expression * e;
expression arg1, arg2;
type T;
@@

- e=(T*)
+ e=
kmalloc(arg1, arg2);

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/staging/ccree/ssi_buffer_mgr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c
index b35871e..18a8694 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -1725,8 +1725,7 @@ int ssi_buffer_mgr_init(struct ssi_drvdata *drvdata)
 	struct buff_mgr_handle *buff_mgr_handle;
 	struct device *dev = &drvdata->plat_dev->dev;
 
-	buff_mgr_handle = (struct buff_mgr_handle *)
-		kmalloc(sizeof(struct buff_mgr_handle), GFP_KERNEL);
+	buff_mgr_handle = kmalloc(sizeof(struct buff_mgr_handle), GFP_KERNEL);
 	if (!buff_mgr_handle)
 		return -ENOMEM;
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-11 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-09  5:43 [PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc Gustavo A. R. Silva
2017-07-09  5:45 ` [PATCH 2/2] staging: ccree: use sizeof(*var) in kmalloc Gustavo A. R. Silva
2017-07-11 13:44 ` [PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc Gilad Ben-Yossef

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).