Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-08 Thread Rasmus Villemoes
On 08/03/2019 16.53, Leon Romanovsky wrote: > On Fri, Mar 08, 2019 at 09:09:46AM +0100, Rasmus Villemoes wrote: >> On 08/03/2019 08.01, Leon Romanovsky wrote: >>> >>> Mathematical therm for discrete numbers greater or equal to zero is >>> "normal numbers". >> >> Sorry, WHAT? "Normal" is used and

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-08 Thread Leon Romanovsky
On Fri, Mar 08, 2019 at 09:09:46AM +0100, Rasmus Villemoes wrote: > On 08/03/2019 08.01, Leon Romanovsky wrote: > > > > Mathematical therm for discrete numbers greater or equal to zero is > > "normal numbers". > > Sorry, WHAT? "Normal" is used and abused for a lot of things in > mathematics, but I

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-08 Thread Jason Gunthorpe
On Fri, Mar 08, 2019 at 08:58:21AM +0100, Rasmus Villemoes wrote: > On 08/03/2019 01.08, Bart Van Assche wrote: > > On Thu, 2019-03-07 at 08:18 +0100, Rasmus Villemoes wrote: > >> On 07/03/2019 03.14, Bart Van Assche wrote: > >>> On 3/6/19 5:24 PM, Jason Gunthorpe wrote: > > > > diff --git

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-08 Thread Rasmus Villemoes
On 08/03/2019 08.01, Leon Romanovsky wrote: > > Mathematical therm for discrete numbers greater or equal to zero is > "normal numbers". Sorry, WHAT? "Normal" is used and abused for a lot of things in mathematics, but I have never heard it used that way. When attached to the word "number", it

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Rasmus Villemoes
On 08/03/2019 01.08, Bart Van Assche wrote: > On Thu, 2019-03-07 at 08:18 +0100, Rasmus Villemoes wrote: >> On 07/03/2019 03.14, Bart Van Assche wrote: >>> On 3/6/19 5:24 PM, Jason Gunthorpe wrote: > > diff --git a/include/linux/overflow.h b/include/linux/overflow.h > index

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Leon Romanovsky
On Thu, Mar 07, 2019 at 09:28:45PM +0100, Rasmus Villemoes wrote: > On 07/03/2019 18.12, Kees Cook wrote: > > On Thu, Mar 7, 2019 at 9:02 AM Leon Romanovsky wrote: > >> > >> On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote: > >>> On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky > >>>

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Leon Romanovsky
On Thu, Mar 07, 2019 at 04:08:23PM -0800, Bart Van Assche wrote: > On Thu, 2019-03-07 at 08:18 +0100, Rasmus Villemoes wrote: > > On 07/03/2019 03.14, Bart Van Assche wrote: > > > On 3/6/19 5:24 PM, Jason Gunthorpe wrote: > > > > > > > > > > diff --git a/include/linux/overflow.h

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Bart Van Assche
On Thu, 2019-03-07 at 08:18 +0100, Rasmus Villemoes wrote: > On 07/03/2019 03.14, Bart Van Assche wrote: > > On 3/6/19 5:24 PM, Jason Gunthorpe wrote: > > > > > > > > diff --git a/include/linux/overflow.h b/include/linux/overflow.h > > > > index 40b48e2133cb..8afe0c0ada6f 100644 > > > > +++

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Rasmus Villemoes
On 07/03/2019 18.12, Kees Cook wrote: > On Thu, Mar 7, 2019 at 9:02 AM Leon Romanovsky wrote: >> >> On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote: >>> On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky wrote: On Thu, Mar 07, 2019 at 06:53:54AM -0800, Bart Van Assche wrote:

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Leon Romanovsky
On Thu, Mar 07, 2019 at 09:12:40AM -0800, Kees Cook wrote: > On Thu, Mar 7, 2019 at 9:02 AM Leon Romanovsky wrote: > > > > On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote: > > > On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky > > > wrote: > > > > > > > > On Thu, Mar 07, 2019 at

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Kees Cook
On Thu, Mar 7, 2019 at 9:02 AM Leon Romanovsky wrote: > > On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote: > > On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky wrote: > > > > > > On Thu, Mar 07, 2019 at 06:53:54AM -0800, Bart Van Assche wrote: > > > > On 3/6/19 11:24 PM, Leon Romanovsky

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Leon Romanovsky
On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote: > On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky wrote: > > > > On Thu, Mar 07, 2019 at 06:53:54AM -0800, Bart Van Assche wrote: > > > On 3/6/19 11:24 PM, Leon Romanovsky wrote: > > > > My simple patch passes too :). > > > > > > Can you

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Kees Cook
On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky wrote: > > On Thu, Mar 07, 2019 at 06:53:54AM -0800, Bart Van Assche wrote: > > On 3/6/19 11:24 PM, Leon Romanovsky wrote: > > > My simple patch passes too :). > > > > Can you repost your patch? > > https://patchwork.kernel.org/patch/10841079/ > > As

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Leon Romanovsky
On Thu, Mar 07, 2019 at 06:53:54AM -0800, Bart Van Assche wrote: > On 3/6/19 11:24 PM, Leon Romanovsky wrote: > > My simple patch passes too :). > > Can you repost your patch? https://patchwork.kernel.org/patch/10841079/ As Rasmus wrote, the thing is to avoid a < 0 check. In my patch, I

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-07 Thread Bart Van Assche
On 3/6/19 11:24 PM, Leon Romanovsky wrote: My simple patch passes too :). Can you repost your patch? Thanks, Bart.

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-06 Thread Leon Romanovsky
On Wed, Mar 06, 2019 at 06:14:09PM -0800, Bart Van Assche wrote: > On 3/6/19 5:24 PM, Jason Gunthorpe wrote: > > On Wed, Mar 06, 2019 at 05:01:53PM -0800, Bart Van Assche wrote: > > > This patch avoids that the following warning is reported when building > > > the mlx5 driver with W=1: > > > > > >

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-06 Thread Rasmus Villemoes
On 07/03/2019 03.14, Bart Van Assche wrote: > On 3/6/19 5:24 PM, Jason Gunthorpe wrote: >>> >>> diff --git a/include/linux/overflow.h b/include/linux/overflow.h >>> index 40b48e2133cb..8afe0c0ada6f 100644 >>> +++ b/include/linux/overflow.h >>> @@ -202,6 +202,24 @@ >>>     #endif /*

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-06 Thread Bart Van Assche
On 3/6/19 5:24 PM, Jason Gunthorpe wrote: On Wed, Mar 06, 2019 at 05:01:53PM -0800, Bart Van Assche wrote: This patch avoids that the following warning is reported when building the mlx5 driver with W=1: drivers/infiniband/hw/mlx5/qp.c: In function set_user_rq_size:

Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1

2019-03-06 Thread Jason Gunthorpe
On Wed, Mar 06, 2019 at 05:01:53PM -0800, Bart Van Assche wrote: > This patch avoids that the following warning is reported when building > the mlx5 driver with W=1: > > drivers/infiniband/hw/mlx5/qp.c: In function set_user_rq_size: > ./include/linux/overflow.h:230:6: warning: comparison of