Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617586 > unrolled thread

[PATCH] sd: Explicit type cast to fix calculating rw_max

Started byFam Zheng <famz@redhat.com>
First post2017-04-06 10:30 +0200
Last post2017-04-06 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] sd: Explicit type cast to fix calculating rw_max Fam Zheng <famz@redhat.com> - 2017-04-06 10:30 +0200

#1617586 — [PATCH] sd: Explicit type cast to fix calculating rw_max

FromFam Zheng <famz@redhat.com>
Date2017-04-06 10:30 +0200
Subject[PATCH] sd: Explicit type cast to fix calculating rw_max
Message-ID<ttaXL-63S-17@gated-at.bofh.it>
Some compilers don't like BLK_DEF_MAX_SECTORS being an enum (int) when
expanding min_not_zero. Cast it to sector_t so it matches the type of
the other operand, logical_to_sectors().

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index ab9011a..8d2315a 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2957,7 +2957,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
 		rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
 	} else
 		rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
-				      BLK_DEF_MAX_SECTORS);
+				      (sector_t)BLK_DEF_MAX_SECTORS);
 
 	/* Combine with controller limits */
 	q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web