From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965177AbbLHPmw (ORCPT ); Tue, 8 Dec 2015 10:42:52 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:61127 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965077AbbLHPmu (ORCPT ); Tue, 8 Dec 2015 10:42:50 -0500 From: Arnd Bergmann To: Mike Snitzer , dm-devel@redhat.com Cc: Alasdair Kergon , linux-raid@vger.kernel.org, Neil Brown , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen Subject: [PATCH] dm verity: use sector_div for division Date: Tue, 08 Dec 2015 16:42:12 +0100 Message-ID: <2666833.eM84rj4CYY@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:5u/Tz1+6lAlL1G74lShw+tmxc64Px02Lc3SxSBXDZNvqgQk4NCb rR4FH2pgTotiRrZ43HlF+Lyb5d73Ga9a/PlLtbH3LhxRh2yqV97tvLZP+66D9J+Vh5L36yC olggPyjl5Ny49HaCyJvmGAa6iKEXMSUX+qYC/7dLvJN5g3WorJB63MmONU/YrT6Au3dpbQY U28A2HSxR6PvIjezQUDew== X-UI-Out-Filterresults: notjunk:1;V01:K0:PPy3HIvbwvU=:jYp3xg2NssEWEC/V6r9IH+ vt6cnaRmNd/0jF6VCNO5tGe9N7H0k6A51ZR//jhp3Gyl1EQOYaaE5UWituzhqpo1L+u3km6Nq s42TRBUKeeMoc2ap7VgYVrXAvYSl6mClGbliNNWLHaSnxYToge9pP4aAWfJwoDwegJkBb44kR OJJ30WnM5+I3LNrONOpH+O2X47gyr6b2fboHOTLNLWG4ViVjSCEhtbyKKymeMF/T7jLjxyU7/ BtF0wx6yK8MvlizphKEzhqTr1LG7m6qj+6VE80Ix345c3mcYyca2RgfrAwIVHQUJuRjARyiIy OmORu5MLqfIlxqBeYNe8NsZmmswPPD8ndITjllHEhusecXmF3xU8bI8i8jdw4kBxgXzBvs6jw qg39jgdOqMB7//4yvZ30bIipIzqLS12fY8GDPCzsTMT9/mqOb9OwQNuhyN7KR8mnxUU+EPo6U I1aK/mAtONv/as5xxGFbp7qDiv6JTmBWkR88GX0pnA4NEJTNWS867TeEQybdth53M+yLRL1p2 POaDTNiipAkbModWb799IJvKLuMe4i+DPtcI6NO8jZgwXLnmTu58+oUbxH7hRhuyeqWL1J8qu uFoMdKKbBq04s4xQd8XixVOW90L7yR5PxlMMtv67MZvP3zOydsIC2kAvuqxS/fwuG+XRiDSsq 1FroBYZ8qY2T6O4a0CwMl1ppR98ErNNxeXd3amSzDjP6hYujAGrRnErns6UQjBviJlGxSlZKf 5UgjK36oAFIZrKy7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dm verity sec implementation uses do_div for dividing a sector_t, which is slower than necessary when sector_t is a 32-bit type, and we now get a warning for this case: include/asm-generic/div64.h:224:22: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types] drivers/md/dm-verity-fec.c:725:6: note: in expansion of macro 'do_div' if (do_div(f->rounds, f->rsn)) This changes the code to use sector_div instead, which does the right thing and avoids the warning. Signed-off-by: Arnd Bergmann --- drivers/md/dm-verity-fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) I believe we had a fix for this in the series that introduced the optimized do_div, but the file got moved around and the fix got lost. diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index e722ce57520f..1bddaca37e98 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -722,7 +722,7 @@ int verity_fec_ctr(struct dm_verity *v) } f->rounds = f->blocks; - if (do_div(f->rounds, f->rsn)) + if (sector_div(f->rounds, f->rsn)) f->rounds++; /* -- 2.1.0.rc2