Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-08 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-08 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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; > >

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread 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; > >

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Timur Tabi
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Sinan Kaya
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:

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread 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; > >

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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) { >>

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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 =

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Timur Tabi
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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

[PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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

[PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread Sinan Kaya
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-04 Thread kbuild test robot
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