From patchwork Tue Dec 8 15:42:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7799321 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 391B59F1C2 for ; Tue, 8 Dec 2015 15:46:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EBA8204D6 for ; Tue, 8 Dec 2015 15:46:01 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F799204B5 for ; Tue, 8 Dec 2015 15:46:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id tB8FgQKw023539; Tue, 8 Dec 2015 10:42:27 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id tB8FgPV1017289 for ; Tue, 8 Dec 2015 10:42:25 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB8FgP1I018990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 8 Dec 2015 10:42:25 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by mx1.redhat.com (Postfix) with ESMTPS id 7E54C8C1B2; Tue, 8 Dec 2015 15:42:24 +0000 (UTC) Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0MYrHb-1Zjvu80MXT-00Vgqk; Tue, 08 Dec 2015 16:42:15 +0100 From: Arnd Bergmann To: Mike Snitzer , dm-devel@redhat.com 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 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 X-RedHat-Spam-Score: 0.789 (BAYES_50, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2) 212.227.126.133 mout.kundenserver.de 212.227.126.133 mout.kundenserver.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: dm-devel@redhat.com Cc: Neil Brown , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Alasdair Kergon , Sami Tolvanen , linux-arm-kernel@lists.infradead.org Subject: [dm-devel] [PATCH] dm verity: use sector_div for division X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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++; /*