Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp673721ybz; Fri, 1 May 2020 06:35:38 -0700 (PDT) X-Google-Smtp-Source: APiQypJxoeVvAJ6PJqyc4DNhbUOKA2PBos63dx7azSHXC6SHSvelyg9RJJ7FTr6Tpv5EnCsvh3W0 X-Received: by 2002:a17:906:3004:: with SMTP id 4mr3196979ejz.381.1588340138337; Fri, 01 May 2020 06:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588340138; cv=none; d=google.com; s=arc-20160816; b=T0tHu6Au5IX2SRk9lL+wgkxYFsbollUAvcD75XBOiiFvR0jsvtnDM8FH9OtMxoguf7 PiBKiEb2tgeEbKxgUIWf+Pq+YBj++6oUy5P4uifcKDcAZLlLSYVz5B2yQr5qeTBKOZV4 S6RcZ80ArWwy3IcPCdN8lda7n0KG7Rj39neEX5/bsIJ5jxMRPwwTRI4SvclPHALZD1nc VcMsXgViesONjGxMNYCUmgYAOJP2sGETOd4/0/g0c57LR/UQ3r7RqpqKGr2UrIlC5wGU cb/FYDOpM7zm0eS8/hCLncDAoVY6tjQOHKFQj7mqrwBuloiBWmPbzlN8a3wjBSlrdaHs 4zrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eXZUCfdK7gY+Kv1hYGPVu4uc+SR+yxwik4zzcFw4aa4=; b=xIxM8i2650ZM2aeL5Qzvyt1VihJoGm9cGHwi/TN5mPaHElpjeZLG8bujcGlSRswAiS YhcFih0EVR0fFvBMed8+411NovjgF4nhW8XsoAA2tBHyJa9UzWIILTcCbLszyZqd3Hu1 B7awL+d3a1KyiO22+7JSfj6kAGF+Xu7KDY3SVDGiFL8MOnJV1B7qn1mo1+4cHytGrkF9 uMm4EzMd9NTU9+XNTcTn4KF9PiymcCPV/q3iRpo6LaTSUeX7sSv23sHuZl5AVdEgN/9P B20xlODo1P/BU7R/rMs8LjHjlS1h44T215SlVBKNO29YgtYlFGTORkHvqGpwatWkbc1m I6OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jy9nd5+8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si1784002ejj.269.2020.05.01.06.35.15; Fri, 01 May 2020 06:35:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jy9nd5+8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730353AbgEANcu (ORCPT + 99 others); Fri, 1 May 2020 09:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729504AbgEANco (ORCPT ); Fri, 1 May 2020 09:32:44 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7F7C061A0E; Fri, 1 May 2020 06:32:44 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id y6so2296262pjc.4; Fri, 01 May 2020 06:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eXZUCfdK7gY+Kv1hYGPVu4uc+SR+yxwik4zzcFw4aa4=; b=jy9nd5+8sIX4f67XLtJU1Ddc2S7xNmy0kmwE4u2l/biJGftOorp9LiZnPJqgqOqxpD MVOF+gGbJ8ESScoLQJqUwnl1QmhCxlN3A0NTpar+HqR1kb6Z6/B1Hdw2tgn3HsxiNTHd llkmOe547clbhmtHU5qt7cWhkNthcT99c8qyYROUE0bqjI+wJv/Y3dIxGa8tHKZzzPax hN/p1T6pH/YyQjNRJzkrYUFkwaXvABudC6P2hZ5Bbc6j1W0I2lpRALAzt1PC0bvr84EA STiy+EAQCVDzmwnW9RCuCgFgxOC3WWWjnhAVnTxEkzwA9+DTRCD99FtWPz+nYhwEv3A8 0PZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eXZUCfdK7gY+Kv1hYGPVu4uc+SR+yxwik4zzcFw4aa4=; b=deWI9zVaPvEKOKl4mpq7PbByQ75dAzi7+lJ0zmcXkhLyZXGm8iJjAa8ThPNdeZa2eq r6mczsG/KOXB8iC8xmZwku5T2xLKUJhmlEc3esCzX47YSdPz8C47DAtzfeY60P1SXxI7 J3mI2pubF6bVqPhhpG+R0LqlYYdG7yKjapYzdKXAZwNj/yXwRF09ez/0pJkHx4SOOB8W uNHNnnDSjtWnx0pzlvctntlbuH/otmGVvBklpmYveHqqmQtFv9oMwBMfmOp8XbkcIxAI MvM0KysyeRMHV1d1MsUMLDfYSWceI8CV2DVv9uQie/W4h6Bl50APisKYJOcVQu7BahXR kLOA== X-Gm-Message-State: AGi0PubO2KzKQKUCeQJSun0u6Q5UYqEaSe8SOYTJlMHc3iPFQ4qnSFGL 1DP8X/WvQE0QxFu6WQ4V4r/XP94z3qCgeHFAQ6E= X-Received: by 2002:a17:902:9306:: with SMTP id bc6mr4487958plb.255.1588339963862; Fri, 01 May 2020 06:32:43 -0700 (PDT) MIME-Version: 1.0 References: <80745504d15c87aa1da0d4be3c16d1279f48615b.1588112716.git.syednwaris@gmail.com> <20200429102114.GF185537@smile.fi.intel.com> <20200430161514.GA7107@syed> <20200430163855.GU185537@smile.fi.intel.com> <20200430233227.GA15963@icarus> In-Reply-To: <20200430233227.GA15963@icarus> From: Andy Shevchenko Date: Fri, 1 May 2020 16:32:32 +0300 Message-ID: Subject: Re: [PATCH v3 4/4] gpio: xilinx: Utilize for_each_set_clump macro To: William Breathitt Gray Cc: Andy Shevchenko , Syed Nayyar Waris , Andrew Morton , Linus Walleij , Bartosz Golaszewski , Michal Simek , "open list:GPIO SUBSYSTEM" , linux-arm Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 1, 2020 at 2:38 AM William Breathitt Gray wrote: > On Thu, Apr 30, 2020 at 07:38:55PM +0300, Andy Shevchenko wrote: > > On Thu, Apr 30, 2020 at 09:45:14PM +0530, Syed Nayyar Waris wrote: > > > On Wed, Apr 29, 2020 at 01:21:14PM +0300, Andy Shevchenko wrote: > > > > On Wed, Apr 29, 2020 at 04:39:47AM +0530, Syed Nayyar Waris wrote: > > > > ... > > > > > > > + const unsigned long state_size = BITS_PER_TYPE(*state); > > > > > > > > This '*state' is unneeded complication, use BITS_PER_U32. > > > > > > > > > +#define TOTAL_BITS BITS_PER_TYPE(chip->gpio_state) > > > > > > > > This macro makes code uglier, besides the fact of absence of #undef. > > > > And also see above. > > > > > > Thank you for your review comments. Just want to clarify, you want > > > a new macro to be created - 'BITS_PER_U32' ? > > > > It's already there (read bits.h). > > I'm having trouble finding the BITS_PER_U32 macro; are you thinking of > BITS_PER_LONG? Oh, my bad. I messed above with BITS_TO_U32() which is not what we want here. > I don't think there are any cases where u32 is not 32 > bits wide, so perhaps it'll be better to just hardcode 32 directly in > the code here to make it easier to read. Yes, would work! -- With Best Regards, Andy Shevchenko