lkml.org 
[lkml]   [2018]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zsmalloc: use U suffix for negative literals being shifted
Hi Nick,

On Mon, Jan 08, 2018 at 08:35:19PM -0800, Nick Desaulniers wrote:
> On Sun, Jan 7, 2018 at 7:04 AM, Minchan Kim <minchan@kernel.org> wrote:
> > Sorry for the delay. I have missed this until now. ;-(
>
> No worries, figured patches would need a post holiday bump for review.
>
> >
> > On Sun, Dec 24, 2017 at 11:33 AM, Nick Desaulniers
> > <nick.desaulniers@gmail.com> wrote:
> >> - link->next = -1 << OBJ_TAG_BITS;
> >> + link->next = -1U << OBJ_TAG_BITS;
> >
> > -1UL?
>
> Oops, good catch.
>
> > Please, resend it with including Andrew Morton
> > <akpm@linux-foundation.org> who merges zsmalloc patch into his tree.
>
> Will do.
>
> On Sun, Jan 7, 2018 at 3:02 PM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > Oh, boy, shouldn't be rather GENMASK() / GENMASK_ULL() in a way how
>
> Thanks for the suggestion. `GENMASK(BITS_PER_LONG - 1, OBJ_TAG_BITS);`
> is equivalent. Whether that is more readable, I'll wait for Minchan
> to decide. If that's preferred, I'll make sure to credit you with the
> Suggested-By tag in the commit message.

I don't see any benefit with GENMASK in our usecase.
If it's not a good justfication, I'd like to use just -1UL which
would be more readable without effort to understand new API.

Thanks.

\
 
 \ /
  Last update: 2018-01-14 23:20    [W:1.096 / U:7.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site