From patchwork Thu Apr 6 08:20:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 9666347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B275860364 for ; Thu, 6 Apr 2017 08:21:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0FAD2815E for ; Thu, 6 Apr 2017 08:21:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95A762848E; Thu, 6 Apr 2017 08:21:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 426FC2815E for ; Thu, 6 Apr 2017 08:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbdDFIVI (ORCPT ); Thu, 6 Apr 2017 04:21:08 -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 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8AEFC059746; Thu, 6 Apr 2017 08:21:05 +0000 (UTC) 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 Received: from lemon.redhat.com (ovpn-8-35.pek2.redhat.com [10.72.8.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1271119CB6; Thu, 6 Apr 2017 08:21:02 +0000 (UTC) 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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));