From: Gustavo A. R. Silva Date: Sun, 9 Jul 2017 05:43:37 +0000 (-0500) Subject: staging: ccree: remove unnecessary cast on kmalloc X-Git-Tag: v4.14~447^2~492 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=60ba7c7c26b8df3688a952cf4bcfbc8dcdafdb9b;p=mirror_ubuntu-bionic-kernel.git staging: ccree: remove unnecessary cast on kmalloc 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 Acked-by: Gilad Ben-Yossef Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index b35871eeabd1..18a86942134c 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;