Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933528AbeAJFxs (ORCPT + 1 other); Wed, 10 Jan 2018 00:53:48 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:34071 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932335AbeAJFxp (ORCPT ); Wed, 10 Jan 2018 00:53:45 -0500 X-Google-Smtp-Source: ACJfBouvNv4X86I04dg8sNMJFMaqDQ3DCTjpW7jBQE6KrCGYC6H/Y0jVssJ9xBG0rFJrWTdhLEtWlQ== Date: Wed, 10 Jan 2018 14:53:38 +0900 From: Minchan Kim To: Nick Desaulniers Cc: Andy Shevchenko , Nitin Gupta , Sergey Senozhatsky , linux-mm , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] zsmalloc: use U suffix for negative literals being shifted Message-ID: <20180110055338.h3cs5hw7mzsdtcad@eng-minchan1.roam.corp.google.com> References: <1514082821-24256-1-git-send-email-nick.desaulniers@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 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 > > wrote: > >> - link->next = -1 << OBJ_TAG_BITS; > >> + link->next = -1U << OBJ_TAG_BITS; > > > > -1UL? > > Oops, good catch. > > > Please, resend it with including Andrew Morton > > who merges zsmalloc patch into his tree. > > Will do. > > On Sun, Jan 7, 2018 at 3:02 PM, Andy Shevchenko > 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.