]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
vme: Move an assignment in vme_new_dma_list()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 24 Aug 2017 20:04:45 +0000 (22:04 +0200)
committerMartyn Welch <martyn.welch@collabora.co.uk>
Fri, 13 Oct 2017 20:32:01 +0000 (21:32 +0100)
Assign a pointer to a data structure member without using an intermediate
local variable.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Martyn Welch <martyn@welchs.me.uk>
drivers/vme/vme.c

index 1afddf5eafd4ad27c613a3094816d30f5b2796ad..d890410e472dd6641224b0200cb47a8f86db33eb 100644 (file)
@@ -948,7 +948,6 @@ EXPORT_SYMBOL(vme_dma_request);
  */
 struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource)
 {
-       struct vme_dma_resource *ctrlr;
        struct vme_dma_list *dma_list;
 
        if (resource->type != VME_DMA) {
@@ -956,14 +955,14 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource)
                return NULL;
        }
 
-       ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
-
        dma_list = kmalloc(sizeof(*dma_list), GFP_KERNEL);
        if (!dma_list)
                return NULL;
 
        INIT_LIST_HEAD(&dma_list->entries);
-       dma_list->parent = ctrlr;
+       dma_list->parent = list_entry(resource->entry,
+                                     struct vme_dma_resource,
+                                     list);
        mutex_init(&dma_list->mtx);
 
        return dma_list;