]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: manifest: simplify descriptor address calculation
authorSachin Pandhare <sachin.pandhare@linaro.org>
Tue, 24 Nov 2015 02:29:10 +0000 (07:59 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 24 Nov 2015 03:23:47 +0000 (19:23 -0800)
This patch doesn't change any functionality. It just improves the
readability of the code.
Current code to get 'descriptors' pointer looks as if we are forcing the
pointer type change. To simplify the address calculations, use
'descriptors' member directly from greybus_manifest structure.

Signed-off-by: Sachin Pandhare <sachin.pandhare@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/manifest.c

index c80a849617d7effc9fdc8824927e39a9fa00950a..41d51579217fd305254606a8bf7cdbbc319db389 100644 (file)
@@ -475,7 +475,7 @@ bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size)
        }
 
        /* OK, find all the descriptors */
-       desc = (struct greybus_descriptor *)(header + 1);
+       desc = manifest->descriptors;
        size -= sizeof(*header);
        while (size) {
                int desc_size;