Skip to contentSkip to conversation

Staging: ks7010: Drop memory allocation cast.

PATCH Superseded Sandhya Bankar 3 participants 3 messages Sep 16, 2016 – Sep 17, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: ks7010: Drop memory allocation cast.

Drop cast on the result of kzalloc.

The semantic patch that makes this change is as follows:

@@
type T;
@@

- (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))

---
 drivers/staging/ks7010/ks7010_sdio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +1 -2
index f9aec4f..c40e6c5 100755
@@ -1147,8 +1147,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 		/* send stop request to MAC */
 		{
 			struct hostif_stop_request_t *pp;
-			pp = (struct hostif_stop_request_t *)
-			    kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
+			pp = kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
 			if (!pp) {
 				DPRINTK(3, "allocate memory failed..\n");
 				return;	/* to do goto ni suru */
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Sandhya Bankar

Drop cast on the result of kzalloc.

The semantic patch that makes this change is as follows:

@@
type T;
@@

Quoted 6 lines

- (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))

Quoted 28 lines
---
 drivers/staging/ks7010/ks7010_sdio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +1 -3
index f9aec4f..c40e6c5 100755
@@ -1147,8 +1147,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 		/* send stop request to MAC */
 		{
 			struct hostif_stop_request_t *pp;
-			pp = (struct hostif_stop_request_t *)
-			    kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
+			pp = kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
 			if (!pp) {
 				DPRINTK(3, "allocate memory failed..\n");
 				return;	/* to do goto ni suru */
--

1.7.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160916173854.GA3176%40sandhya.
For more options, visit https://groups.google.com/d/optout.

maintainer
#2 lore raw
In reply to Sandhya Bankar

drivers/staging/ks7010/ks7010_sdio.c

Quoted 21 lines · Sandhya Bankar

Drop cast on the result of kzalloc.

The semantic patch that makes this change is as follows:

@@
type T;
@@

- (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))

---
 drivers/staging/ks7010/ks7010_sdio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +0 -0
index f9aec4f..c40e6c5 100755

All of your patches have the file permissions issue, please fix it up and resend all of them, I've had to drop all of your pending patches from my to-apply queue because of this.

thanks,

greg k-h