From patchwork Thu Oct 18 23:50:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 10648435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF9D1157A for ; Thu, 18 Oct 2018 23:50:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA25928BB8 for ; Thu, 18 Oct 2018 23:50:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9906728BA5; Thu, 18 Oct 2018 23:50:58 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 4002428BA5 for ; Thu, 18 Oct 2018 23:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbeJSHyS (ORCPT ); Fri, 19 Oct 2018 03:54:18 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:44228 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbeJSHyS (ORCPT ); Fri, 19 Oct 2018 03:54:18 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 204908EE108; Thu, 18 Oct 2018 16:50:57 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N0tPTmUC11BZ; Thu, 18 Oct 2018 16:50:57 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.68.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id A4DA98EE0D5; Thu, 18 Oct 2018 16:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1539906656; bh=0Pk1s3GUyzbZJI2sMem+PkH/dnmFpQwsfjrHQBDyd+w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=aFG3fOASXwCpdi+mdCUtKdtpFxnNpgfilbX05FS/qzyCaGLWa8rQTP68fOl0xgX2J RkBHuVM3UVba2qaS1eOS5o+veV9BQ5SPAfTETes9VDG3TgjXvDrHXJMq4YIjcmRG8G TfTr0xoOx2pJ+oPHxQ4/XjUf84qj0oZDgyNu/7s8= Message-ID: <1539906656.18970.34.camel@HansenPartnership.com> Subject: [PATCH] scsi: myrs: fix build failure on 32 bit From: James Bottomley To: kbuild test robot , Hannes Reinecke Cc: kbuild-all@01.org, linux-scsi@vger.kernel.org, "Martin K. Petersen" , Christoph Hellwig Date: Thu, 18 Oct 2018 16:50:56 -0700 In-Reply-To: <1539906510.18970.32.camel@HansenPartnership.com> References: <201810190117.TDDk5Jka%fengguang.wu@intel.com> <1539883734.18970.0.camel@HansenPartnership.com> <1539906510.18970.32.camel@HansenPartnership.com> X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 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 For 32 bit versions we have to be careful about divisions of 64 bit quantities so use do_div() instead of a direct division. This fixes a warning about _uldivmod being undefined in certain configurations Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller") Reported-by: kbuild test robot Signed-off-by: James Bottomley Reviewed-by: Hannes Reinecke Tested-by: Randy Dunlap # build-tested --- drivers/scsi/myrs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index b02ee0b0dd55..a9f9c77e889f 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -1978,7 +1978,8 @@ myrs_get_resync(struct device *dev) struct scsi_device *sdev = to_scsi_device(dev); struct myrs_hba *cs = shost_priv(sdev->host); struct myrs_ldev_info *ldev_info = sdev->hostdata; - u8 percent_complete = 0, status; + u64 percent_complete = 0; + u8 status; if (sdev->channel < cs->ctlr_info->physchan_present || !ldev_info) return; @@ -1986,8 +1987,8 @@ myrs_get_resync(struct device *dev) unsigned short ldev_num = ldev_info->ldev_num; status = myrs_get_ldev_info(cs, ldev_num, ldev_info); - percent_complete = ldev_info->rbld_lba * 100 / - ldev_info->cfg_devsize; + percent_complete = ldev_info->rbld_lba * 100; + do_div(percent_complete, ldev_info->cfg_devsize); } raid_set_resync(myrs_raid_template, dev, percent_complete); }