On 11/5/2015 2:56 PM, Andy Shevchenko wrote:
On Thu, Nov 5, 2015 at 9:31 PM, Andy Shevchenko
wrote:
On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
Let's try again.
static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) {
u64
On 11/5/2015 2:56 PM, Andy Shevchenko wrote:
On Thu, Nov 5, 2015 at 9:31 PM, Andy Shevchenko
wrote:
On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
Let's try again.
static inline u64
On 11/5/2015 2:56 PM, Andy Shevchenko wrote:
One more look to the users of MULDIV.
They all seems 32 bit for x.
It means you don't need two do_div()s at all.
Just do something like:
u64 d = x * numer;
do_div(d, denom);
return d;
OK. I assume you want a change only in this file.
--
Sinan
On Thu, Nov 5, 2015 at 9:31 PM, Andy Shevchenko
wrote:
> On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
>> On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
>
>> Let's try again.
>>
>> static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) {
>> u64 rem = x % denom;
>> u64 quot
On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
> On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
> Let's try again.
>
> static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) {
> u64 rem = x % denom;
> u64 quot = do_div(x, denom);
> u64 mul = rem * numer;
>
>
On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
OK, I didn't know that we had such a macro. To make this look like the other
>macro, I can do this.
>
>static inline u64 mult_frac64(u64 x, u32 numer, u32 denom)
>{
> u64 quot;
> u64 rem = x % denom;
> u64 rem2;
>
>
On Thu, Nov 5, 2015 at 5:10 PM, Sinan Kaya wrote:
>
>
> On 11/5/2015 3:48 AM, Andy Shevchenko wrote:
>>
>> On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
>>>
>>> The MULDIV macro has been designed for small
>>> numbers. It emits an overflow warning on 64 bit
>>> systems. This patch places
Sinan Kaya wrote:
>
>
> #define MULDIV(X,MUL,DIV)mult_frac64(X, MUL, DIV)
Why bother with the macro at all? Just change the code to use do_div()
directly. It's possible that the original code was written before
do_div() became standard, or the developer didn't know about, which is
why we
On 11/5/2015 3:48 AM, Andy Shevchenko wrote:
On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
The MULDIV macro has been designed for small
numbers. It emits an overflow warning on 64 bit
systems. This patch places type casts in the
parameters to fix the compiler warning.
Signed-off-by:
On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
> The MULDIV macro has been designed for small
> numbers. It emits an overflow warning on 64 bit
> systems. This patch places type casts in the
> parameters to fix the compiler warning.
>
> Signed-off-by: Sinan Kaya
> ---
> drivers/scsi/sg.c | 5
On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
> The MULDIV macro has been designed for small
> numbers. It emits an overflow warning on 64 bit
> systems. This patch places type casts in the
> parameters to fix the compiler warning.
>
> Signed-off-by: Sinan Kaya
On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
OK, I didn't know that we had such a macro. To make this look like the other
>macro, I can do this.
>
>static inline u64 mult_frac64(u64 x, u32 numer, u32 denom)
>{
> u64 quot;
> u64 rem = x % denom;
> u64 rem2;
>
>
On Thu, Nov 5, 2015 at 9:31 PM, Andy Shevchenko
wrote:
> On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
>> On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
>
>> Let's try again.
>>
>> static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) {
>>
On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote:
> On 11/5/2015 1:07 PM, Andy Shevchenko wrote:
> Let's try again.
>
> static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) {
> u64 rem = x % denom;
> u64 quot = do_div(x, denom);
> u64 mul =
On 11/5/2015 2:56 PM, Andy Shevchenko wrote:
One more look to the users of MULDIV.
They all seems 32 bit for x.
It means you don't need two do_div()s at all.
Just do something like:
u64 d = x * numer;
do_div(d, denom);
return d;
OK. I assume you want a change only in this file.
--
Sinan
On Thu, Nov 5, 2015 at 5:10 PM, Sinan Kaya wrote:
>
>
> On 11/5/2015 3:48 AM, Andy Shevchenko wrote:
>>
>> On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
>>>
>>> The MULDIV macro has been designed for small
>>> numbers. It emits an overflow warning
Sinan Kaya wrote:
>
>
> #define MULDIV(X,MUL,DIV)mult_frac64(X, MUL, DIV)
Why bother with the macro at all? Just change the code to use do_div()
directly. It's possible that the original code was written before
do_div() became standard, or the developer didn't know about, which is
why we
On 11/5/2015 3:48 AM, Andy Shevchenko wrote:
On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote:
The MULDIV macro has been designed for small
numbers. It emits an overflow warning on 64 bit
systems. This patch places type casts in the
parameters to fix the compiler
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151105]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151105]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151104]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
The MULDIV macro has been designed for small
numbers. It emits an overflow warning on 64 bit
systems. This patch places type casts in the
parameters to fix the compiler warning.
Signed-off-by: Sinan Kaya
---
drivers/scsi/sg.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151104]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
The MULDIV macro has been designed for small
numbers. It emits an overflow warning on 64 bit
systems. This patch places type casts in the
parameters to fix the compiler warning.
Signed-off-by: Sinan Kaya
---
drivers/scsi/sg.c | 5 -
1 file changed, 4 insertions(+), 1
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151105]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
Hi Sinan,
[auto build test ERROR on: scsi/for-next]
[also build test ERROR on: v4.3 next-20151105]
url:
https://github.com/0day-ci/linux/commits/Sinan-Kaya/scsi-mpt2sas-try-64-bit-DMA-when-32-bit-DMA-fails/20151105-125248
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
26 matches
Mail list logo