Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753723AbbKXMun (ORCPT ); Tue, 24 Nov 2015 07:50:43 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37668 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753146AbbKXMum (ORCPT ); Tue, 24 Nov 2015 07:50:42 -0500 Subject: Re: [PATCH] scsi: use sector_div instead of do_div To: Arnd Bergmann , linux-scsi@vger.kernel.org References: <24882658.08y4bWL6tn@wuerfel> Cc: jbottomley@odin.com, martin.petersen@oracle.com, nico@fluxnic.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Sagi Grimberg Message-ID: <56545D1C.6070509@dev.mellanox.co.il> Date: Tue, 24 Nov 2015 14:50:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <24882658.08y4bWL6tn@wuerfel> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 815 Lines: 21 On 20/11/2015 18:38, Arnd Bergmann wrote: > do_div is the wrong way to divide a sector_t, as it is less > efficient when sector_t is 32-bit wide. With the upcoming > do_div optimizations, the kernel starts warning about this: > > drivers/scsi/scsi_debug.c: In function 'dif_store': > include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast > > This changes the code to use sector_div instead, which always > produces optimal code. > > Signed-off-by: Arnd Bergmann Reviewed-by: Sagi Grimberg -- 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/