]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/dasd: remove unneeded sanity check
authorStefan Haberland <sth@linux.vnet.ibm.com>
Mon, 19 Feb 2018 11:24:39 +0000 (12:24 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 27 Feb 2018 07:05:28 +0000 (08:05 +0100)
Reported by smatch that the usage of cqr->block is inconsistent.
The sanity check is not needed because _dasd_requeue_request already
checks for a valid cqr->block pointer and all referenced ERP requests
have a valid cqr->block pointer as well since it is copied during ERP
process.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c

index ecef8e73d40b2f845a9048151870778032fb6f18..c89c26e401651ef05e126843757431394ca80b71 100644 (file)
@@ -3918,8 +3918,13 @@ static int dasd_generic_requeue_all_requests(struct dasd_device *device)
                        cqr = refers;
                }
 
-               if (cqr->block)
-                       list_del_init(&cqr->blocklist);
+               /*
+                * _dasd_requeue_request already checked for a valid
+                * blockdevice, no need to check again
+                * all erp requests (cqr->refers) have a cqr->block
+                * pointer copy from the original cqr
+                */
+               list_del_init(&cqr->blocklist);
                cqr->block->base->discipline->free_cp(
                        cqr, (struct request *) cqr->callback_data);
        }