mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH-next] staging: rtl8188eu: Remove unneeded cast
@ 2018-02-20 16:37 Christopher Diaz Riveros
  2018-02-20 18:15 ` Larry Finger
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Diaz Riveros @ 2018-02-20 16:37 UTC (permalink / raw)
  To: gregkh, Larry.Finger; +Cc: devel, kernel-janitors, linux-kernel

Fix Coccinelle alert:

drivers/staging//rtl8188eu/os_dep/usb_intf.c:336:13-27: WARNING: casting value returned by memory allocation function to (struct adapter *) is useless.

This issue was detected by using the Coccinelle software.

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 32c7225a831e..127ecf896fc9 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -333,7 +333,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
 	struct net_device *pmondev;
 	int status = _FAIL;
 
-	padapter = (struct adapter *)vzalloc(sizeof(*padapter));
+	padapter = vzalloc(sizeof(*padapter));
 	if (padapter == NULL)
 		goto exit;
 	padapter->dvobj = dvobj;
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH-next] staging: rtl8188eu: Remove unneeded cast
  2018-02-20 16:37 [PATCH-next] staging: rtl8188eu: Remove unneeded cast Christopher Diaz Riveros
@ 2018-02-20 18:15 ` Larry Finger
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2018-02-20 18:15 UTC (permalink / raw)
  To: Christopher Diaz Riveros, gregkh; +Cc: devel, kernel-janitors, linux-kernel

On 02/20/2018 10:37 AM, Christopher Diaz Riveros wrote:
> Fix Coccinelle alert:
> 
> drivers/staging//rtl8188eu/os_dep/usb_intf.c:336:13-27: WARNING: casting value returned by memory allocation function to (struct adapter *) is useless.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>


> ---
>   drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
> index 32c7225a831e..127ecf896fc9 100644
> --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
> @@ -333,7 +333,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
>   	struct net_device *pmondev;
>   	int status = _FAIL;
>   
> -	padapter = (struct adapter *)vzalloc(sizeof(*padapter));
> +	padapter = vzalloc(sizeof(*padapter));
>   	if (padapter == NULL)
>   		goto exit;
>   	padapter->dvobj = dvobj;
> 

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2018-02-20 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 16:37 [PATCH-next] staging: rtl8188eu: Remove unneeded cast Christopher Diaz Riveros
2018-02-20 18:15 ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®