lkml.org 
[lkml]   [2017]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/4] ueagle-atm: Improve a size determination in uea_bind()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 19 May 2017 19:09:28 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/atm/ueagle-atm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 16fd87df69e1..9725e6f2f301 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -2551,7 +2551,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
return ret;
}

- sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL);
+ sc = kzalloc(sizeof(*sc), GFP_KERNEL);
if (!sc)
return -ENOMEM;

--
2.13.0
\
 
 \ /
  Last update: 2017-05-19 19:54    [W:0.037 / U:15.416 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site