From patchwork Fri Nov 27 13:49:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101170 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1159156lbb; Fri, 27 Nov 2015 05:50:25 -0800 (PST) X-Received: by 10.98.64.209 with SMTP id f78mr48403576pfd.74.1448632225182; Fri, 27 Nov 2015 05:50:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kh7si19581081pab.85.2015.11.27.05.50.24; Fri, 27 Nov 2015 05:50:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400AbbK0NuX (ORCPT + 28 others); Fri, 27 Nov 2015 08:50:23 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:56155 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753045AbbK0NuV (ORCPT ); Fri, 27 Nov 2015 08:50:21 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MUlX2-1Znwpv3cCK-00Y6KD; Fri, 27 Nov 2015 14:49:51 +0100 From: Arnd Bergmann To: Jens Axboe Cc: Matias Bjorling , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] null_blk: use sector_div instead of do_div Date: Fri, 27 Nov 2015 14:49:49 +0100 Message-ID: <3768541.ja0r6f0Odi@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.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TMl4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dividing a sector_t number should be done using sector_div rather than do_div to optimize the 32-bit sector_t case, and with the latest do_div optimizations, we now get a compile-time warning for this: arch/arm/include/asm/div64.h:32:95: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'sector_t * {aka long unsigned int *}' drivers/block/null_blk.c:521:81: warning: comparison of distinct pointer types lacks a cast This changes the newly added code to use sector_div. Signed-off-by: Arnd Bergmann Fixes: b2b7e00148a2 ("null_blk: register as a LightNVM device") --- Found on ARM randconfig builds with today's linux-next -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 5c8ba5484d86..d0eeecd294de 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -510,17 +510,17 @@ static int null_lnvm_id(struct request_queue *q, struct nvm_id *id) id->ppaf.ch_offset = 56; id->ppaf.ch_len = 8; - do_div(size, bs); /* convert size to pages */ - do_div(size, 256); /* concert size to pgs pr blk */ + sector_div(size, bs); /* convert size to pages */ + sector_div(size, 256); /* concert size to pgs pr blk */ grp = &id->groups[0]; grp->mtype = 0; grp->fmtype = 0; grp->num_ch = 1; grp->num_pg = 256; blksize = size; - do_div(size, (1 << 16)); + sector_div(size, (1 << 16)); grp->num_lun = size + 1; - do_div(blksize, grp->num_lun); + sector_div(blksize, grp->num_lun); grp->num_blk = blksize; grp->num_pln = 1;