Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbbKJJXr (ORCPT ); Tue, 10 Nov 2015 04:23:47 -0500 Received: from mail-yk0-f196.google.com ([209.85.160.196]:34998 "EHLO mail-yk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751860AbbKJJXn (ORCPT ); Tue, 10 Nov 2015 04:23:43 -0500 MIME-Version: 1.0 In-Reply-To: <5641783D.3030108@codeaurora.org> References: <1447034266-28003-1-git-send-email-okaya@codeaurora.org> <1447034266-28003-3-git-send-email-okaya@codeaurora.org> <564162AB.6080803@codeaurora.org> <564163F7.2020109@codeaurora.org> <564177D7.7070103@codeaurora.org> <5641783D.3030108@codeaurora.org> Date: Tue, 10 Nov 2015 11:23:42 +0200 Message-ID: Subject: Re: [PATCH V2 2/3] scsi: fix compiler warning for sg From: Andy Shevchenko To: Timur Tabi Cc: Sinan Kaya , linux-scsi , cov@codeaurora.org, jcm@redhat.com, Andy Gross , linux-arm-msm@vger.kernel.org, linux-arm Mailing List , Doug Gilbert , "James E.J. Bottomley" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 926 Lines: 30 On Tue, Nov 10, 2015 at 6:53 AM, Timur Tabi wrote: > Sinan Kaya wrote: >> >> >> The code says it is using these macros for small integers only which >> can't overflow. I was trying to get rid of compiler warning and it seems >> to have disappeared. > > > I would double-check the assembly code, if I were you. I don't like it when > warnings just go away like that. +1 to that. > > Besides, we *should* be using do_div() for 64-bit division. But here looks like all numbers are guaranteed to be less than or equal to INT_MAX. Thus, the matter is only to replace MULDIV() by mult_frac() which is already in kernel. -- With Best Regards, Andy Shevchenko -- 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/