staging: unisys: Remove allocation from declaration line
authorQuentin Lambert <lambert.quentin@gmail.com>
Tue, 10 Feb 2015 14:12:07 +0000 (15:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Feb 2015 01:15:08 +0000 (17:15 -0800)
This patch removes allocation from declaration line because
people are known to gloss over declarations.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorchipset/visorchipset_main.c
drivers/staging/unisys/visorutil/charqueue.c
drivers/staging/unisys/visorutil/memregion_direct.c

index f606ee9e0de908fb1107ce6f66fbe07785f3f6c9..149d4bc953acb0c344e6b79d26007bb074e6dbc1 100644 (file)
@@ -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;
 
index ac7acb7c5b7955eb63c1c7403eebb314f2fc5cb9..e2ee5ee7585e208d775ce034cc1bff8912e13b7e 100644 (file)
@@ -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);
index 33522cc8c22c9687d9c9fee70c764a7cfea5dcd1..f4ecac0e50929828d1b364e1cba025e0644e86af 100644 (file)
@@ -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;