lkml.org 
[lkml]   [2019]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Avoid that check_shl_overflow() triggers a compiler warning when building with W=1
Date
On Thu, Mar 07, 2019 at 08:52:51AM -0800, Kees Cook wrote:
> On Thu, Mar 7, 2019 at 7:40 AM Leon Romanovsky <leonro@mellanox.com> 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 Rasmus wrote, the thing is to avoid a < 0 check. In my patch,
> > I converted a <= 0 to !(a > 0 || a == 0) expression.
>
> I'd be happy either way. Is there a larger benefit to having a safe
> "is_non_negative()" helper, or should we go with the minimal change to
> the shl macro?

I personally prefer simplest possible solution.

>
> -Kees
>
> --
> Kees Cook
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-03-07 18:03    [W:0.104 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site