Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753AbdDFIVM (ORCPT ); Thu, 6 Apr 2017 04:21:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35000 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbdDFIVG (ORCPT ); Thu, 6 Apr 2017 04:21:06 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C8AEFC059746 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=famz@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C8AEFC059746 From: Fam Zheng To: linux-kernel@vger.kernel.org Cc: "Martin K. Petersen" , linux-scsi@vger.kernel.org, Stephen Rothwell , "James E.J. Bottomley" Subject: [PATCH] sd: Explicit type cast to fix calculating rw_max Date: Thu, 6 Apr 2017 16:20:59 +0800 Message-Id: <20170406082059.26492-1-famz@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 06 Apr 2017 08:21:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 826 Lines: 24 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 --- 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