staging: unisys: Remove allocation from declaration line
Subsystems (2)
PATCH v2 1/1 staging: unisys: Remove allocation from declaration line
This patch removes allocation from declaration line because people are known to gloss over declarations.
Signed-off-by Quentin Lambert <[email protected]>
---
The second of version of this patch fix the checkpatch warning of line over 80 char by rewriting the size argument of kmalloc as suggested by Sudip.
drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++--- drivers/staging/unisys/visorutil/charqueue.c | 3 ++- drivers/staging/unisys/visorutil/memregion_direct.c | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-)
drivers/staging/unisys/visorchipset/visorchipset_main.c +3 -3
@@ -1604,9 +1604,9 @@ parahotplug_next_expiration(void)static struct parahotplug_request *parahotplug_request_create (struct controlvm_message *msg) { -struct parahotplug_request *req = -kmalloc (sizeof (struct parahotplug_request ), -GFP_KERNEL |__GFP_NORETRY); +struct parahotplug_request *req; + + req =kmalloc (sizeof (*req),GFP_KERNEL |__GFP_NORETRY);if (req ==NULL )return NULL ;
drivers/staging/unisys/visorutil/charqueue.c +2 -1
@@ -36,8 +36,9 @@ struct charqueue {struct charqueue *visor_charqueue_create (ulong nslots) {int alloc_size =sizeof (struct charqueue ) + nslots +1 ; -struct charqueue *cq =kmalloc (alloc_size,GFP_KERNEL |__GFP_NORETRY); +struct charqueue *cq; + cq =kmalloc (alloc_size,GFP_KERNEL |__GFP_NORETRY);if (cq ==NULL ) {ERRDRV ("visor_charqueue_create allocation failed (alloc_size=%d)" , alloc_size);
drivers/staging/unisys/visorutil/memregion_direct.c +3 -2
@@ -41,8 +41,9 @@ struct memregion * visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) {struct memregion *rc =NULL ; -struct memregion *memregion =kzalloc (sizeof (*memregion), -GFP_KERNEL | __GFP_NORETRY); +struct memregion *memregion; + + memregion =kzalloc (sizeof (*memregion),GFP_KERNEL | __GFP_NORETRY);if (memregion ==NULL ) {ERRDRV ("visor_memregion_create allocation failed" );return NULL ;
Signature · 1 line
1.9.1