Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2035991ybz; Thu, 30 Apr 2020 09:43:05 -0700 (PDT) X-Google-Smtp-Source: APiQypIeEOVZzt9kje94DapQOsvapq/0zLP1G3LD06XngWaPr49Ya/fzn3MJLLrL01mvAOkVzTtb X-Received: by 2002:a50:ef18:: with SMTP id m24mr3530049eds.281.1588264985712; Thu, 30 Apr 2020 09:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588264985; cv=none; d=google.com; s=arc-20160816; b=AUykUNnwBjqB+ohc3OxC5xyH8j6isgCyOBdPe9FdJuGAsE5sQfQGEGGL4Gwd5+Rz7I XTHkNqRguFdVQokpo5cYOW3OurIoxaWyhk8xi22FrB0sTEdc+x6+Y7GEluZpXjsEtbWe sF/SOfl5p5AbZYUNj6r+7F70lrqjupJb6Jm3KW3KuYet1uQ/lAiU+c68EWrGU/xIh824 GB8Ngm6mSkxQB8UOAzJ4N9htjyZyMbwigPBz3g/p0Cfpey80wtTPao88/RE2asZay0qB tP/Vq5dnmpaoQkUkUF/c+nMIwONE9rBAoEcMpzKBk5ut8LbA8UtUP8aHgMq2aLxyo8Gr odlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=6br/ZYwc0ck9aVAk+csPLJAzqxkzPmpx1UfcUlLWZhI=; b=Zycn2SksXfmgDqXgaxqFFsCyikpcHoDkccknr5tUPemP9KLSwuTq0KMiwDwcy0yxxZ rm2yD0R0zw9yy7HWCjgw4H0WJIQ4UN0h0Kd4NvZkZPtaZp1XCRsJqc07eo9770N78NWC Yk6nB64tGbQgiDTsq0XK5dLi4cxv1n7XU2OKyuXmlSf0Wvsq/ofjjrYXr6VisLs+diYe f7t3v2GFnMxsuHWRzTfsUoLv7kyge8iLOiYwcQ2hFrUyZPBrjgtCvd4mcKrmPVbYolHY F6jLVCd1f4wCAY217tUdumZ0T3p2L+RzQV0k5EgqUfP1kbVKbAud0pbUbnT2CO/uQuPh 5mMQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si94962ejt.348.2020.04.30.09.42.40; Thu, 30 Apr 2020 09:43:05 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbgD3QjD (ORCPT + 99 others); Thu, 30 Apr 2020 12:39:03 -0400 Received: from mga12.intel.com ([192.55.52.136]:30305 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgD3QjC (ORCPT ); Thu, 30 Apr 2020 12:39:02 -0400 IronPort-SDR: s1/X7CvdGxPyXDk8DbROCbtkFZQsR7tP9i+JAxhlmxfOtjuTX36Rqu8Iau7ay4ufZ+oaGtZa18 yguDMghOXyXA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 09:38:59 -0700 IronPort-SDR: ME5Ydnoy+OAr2lFUJblXA0A6ioZNOJkRmsQr7GxyMwPdnz/fSx/zy5+Unt5y3JubqY9W4wfgY3 OHFKiMXFCseg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,336,1583222400"; d="scan'208";a="261836945" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006.jf.intel.com with ESMTP; 30 Apr 2020 09:38:52 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jUCD9-003x70-2a; Thu, 30 Apr 2020 19:38:55 +0300 Date: Thu, 30 Apr 2020 19:38:55 +0300 From: Andy Shevchenko To: Syed Nayyar Waris Cc: akpm@linux-foundation.org, vilhelm.gray@gmail.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, michal.simek@xilinx.com, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/4] gpio: xilinx: Utilize for_each_set_clump macro Message-ID: <20200430163855.GU185537@smile.fi.intel.com> References: <80745504d15c87aa1da0d4be3c16d1279f48615b.1588112716.git.syednwaris@gmail.com> <20200429102114.GF185537@smile.fi.intel.com> <20200430161514.GA7107@syed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200430161514.GA7107@syed> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). > Also, don't you think that with BITS_PER_TYPE(), in case later the type > of 'state' changes, it will be reflected in this code without any code > change? If it changes the bits per type will be least issues there. The rationale behind is to have code readable. In proposed change it is not. > Let me know if I have misunderstood something. > > > > > > + DECLARE_BITMAP(old, TOTAL_BITS); > > > + DECLARE_BITMAP(new, TOTAL_BITS); > > > + DECLARE_BITMAP(changed, TOTAL_BITS); -- With Best Regards, Andy Shevchenko