diff options
author | Vitaly Osipov <vitaly.osipov@gmail.com> | 2014-06-14 15:47:21 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-20 03:44:06 +0400 |
commit | bd9dc62c365c0a6cf12d571ec0a2f10218a30c81 (patch) | |
tree | b14a9f53f0655090a9192b7431b02211bfd12041 /drivers/staging/rtl8712/rtl871x_io.c | |
parent | 3ae70746d0569dd942cedd668f3a4a256c06fbe8 (diff) | |
download | linux-bd9dc62c365c0a6cf12d571ec0a2f10218a30c81.tar.xz |
staging: rtl8712: replace kmalloc(..., sizeof(T))
As suggested by Andy Shevchenko on driverdev-devel, replace
v = ... sizeof(struct type_of_v) -> sizeof(*v)
Based on a cocci patch along the lines of
@@
type T;
expression E;
identifier V;
@@
T *V;
...
- V = kmalloc(sizeof(T), E);
+ V = kmalloc(sizeof(*V), E);
@@
type T;
expression E;
identifier V;
@@
T *V;
...
- V = kzalloc(sizeof(T), E);
+ V = kzalloc(sizeof(*V), E);
Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_io.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index 37a841a14889..e881b0d9c34f 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -112,7 +112,7 @@ uint r8712_alloc_io_queue(struct _adapter *adapter) struct io_queue *pio_queue; struct io_req *pio_req; - pio_queue = kmalloc(sizeof(struct io_queue), GFP_ATOMIC); + pio_queue = kmalloc(sizeof(*pio_queue), GFP_ATOMIC); if (pio_queue == NULL) goto alloc_io_queue_fail; _init_listhead(&pio_queue->free_ioreqs); |