]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/dasd: Make setting queue_max_segments more explicit
authorJan Höppner <hoeppner@linux.vnet.ibm.com>
Thu, 30 Jun 2016 10:58:51 +0000 (12:58 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 28 Oct 2016 08:09:01 +0000 (10:09 +0200)
Currently the block queue value max_segments is set to -1L, which
is then implicitly casted to unsigned short in blk_queue_max_segments.
This results in 65535 (64k) max_segments.

Even though the resulting value is correct, setting it implicitly using
-1L is rather confusing. Set the value explicitly using the USHRT_MAX
macro instead.

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

index 1de089019268e10279a4c88be7767cf11f21eb96..6a0c9df8f323758848afd82c1654f28957ae00ce 100644 (file)
@@ -3140,7 +3140,7 @@ static void dasd_setup_queue(struct dasd_block *block)
        blk_queue_logical_block_size(block->request_queue,
                                     block->bp_block);
        blk_queue_max_hw_sectors(block->request_queue, max);
-       blk_queue_max_segments(block->request_queue, -1L);
+       blk_queue_max_segments(block->request_queue, USHRT_MAX);
        /* with page sized segments we can translate each segement into
         * one idaw/tidaw
         */