]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
staging: unisys: visorbus: consolidate if statements
authorDavid Kershner <david.kershner@unisys.com>
Tue, 28 Mar 2017 13:34:56 +0000 (09:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Mar 2017 07:17:03 +0000 (09:17 +0200)
We had several if statements inside of if statements that should be
consolidated into an if statement with an && to clean up the code some
more.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorchannel.c

index 686137a59c5cdd31b6f2f02fce6d6902d08eb5a2..8c27b56a7aa7e639a3c05f1421c7ee5c532ff979 100644 (file)
@@ -418,12 +418,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
         * release later on.
         */
        channel->requested = request_mem_region(physaddr, size, MYDRVNAME);
-       if (!channel->requested) {
-               if (uuid_le_cmp(guid, spar_video_guid)) {
-                       /* Not the video channel we care about this */
-                       goto err_destroy_channel;
-               }
-       }
+       if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+               /* we only care about errors if this is not the video channel */
+               goto err_destroy_channel;
 
        channel->mapped = memremap(physaddr, size, MEMREMAP_WB);
        if (!channel->mapped) {
@@ -451,12 +448,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
        channel->mapped = NULL;
        channel->requested = request_mem_region(channel->physaddr,
                                                channel_bytes, MYDRVNAME);
-       if (!channel->requested) {
-               if (uuid_le_cmp(guid, spar_video_guid)) {
-                       /* Different we care about this */
-                       goto err_destroy_channel;
-               }
-       }
+       if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+               /* we only care about errors if this is not the video channel */
+               goto err_destroy_channel;
 
        channel->mapped = memremap(channel->physaddr, channel_bytes,
                        MEMREMAP_WB);