Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp456151ybz; Wed, 29 Apr 2020 03:23:20 -0700 (PDT) X-Google-Smtp-Source: APiQypIRzERzb/+ockWkdup23twyqdcWoj2b9LV6Qd3oqKpbup3QDIJtCiq940NKnhZIdusxdcKt X-Received: by 2002:a17:907:40f2:: with SMTP id no2mr1955462ejb.41.1588155799907; Wed, 29 Apr 2020 03:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588155799; cv=none; d=google.com; s=arc-20160816; b=vojsqPp5vffF6nef5F07WQHr7q4ClwIQYXmOH+tN+mml/yD6cMZ7S/HtgkA93SefBt Xo/hMKMVguE1n5f2hXqhdbW4N3nPFyi4yF4xqj8M3+IPLCon4CGIL3lEhgICuBpywZih 51bmvw4b2i9R7V8J63lLtsbaV2Evj1vfKQj5o8BaZ8uw7wGg8cfxs7QtZKMPgQUfj95V BLGAcMtpSwKXIXNPI8lpevMMnjwfg5GEYdyQC6IhGyOqN4y1MpxN3bNAAbSl+q65y/9n 1HB50wPOgGbpxrmWm68eZIRX0FPEziNOYsjz2vEiJBzEIFMbhEc0uq8n0j+YJiuLis6l Ty+w== 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=a5GbwtF1upp0wu5UX/ozI0Hnte+4kYJeH5mdZBJ6cq0=; b=eYSg7X8qxUJFWpAIfpxPJwAFOObpUrtqWpxqLbLDrnZpDvM+cOaqmj2HihZl7hjiq6 6xSEqx/IguA+Prpkl67DQKqBmFLz5V0HAZQDCyoH13MkCK/tD+LmAT5VFVsGyJi1pNaG +KtnV+ZPu1WI0w/ffCKcybvf3DMm0PmhQqpad/+7NJEboHAVh0LWk3ydjDyDpJG4lZOa 0N/S/o9jJL5jrvxcR7NDppX/BvBxydvSQqF7bNVjozdhGJSU9GrwKQhwgSagVJRopfus FDC88f5ePxBJV9gMYNGy3ecUJTi3+J71/2hay5prWApcPAEI+T40bj4FDSj8PwN/Y/Fj 3ZvQ== 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 t14si3058214edi.331.2020.04.29.03.22.57; Wed, 29 Apr 2020 03:23:19 -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 S1726875AbgD2KVP (ORCPT + 99 others); Wed, 29 Apr 2020 06:21:15 -0400 Received: from mga02.intel.com ([134.134.136.20]:51286 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbgD2KVO (ORCPT ); Wed, 29 Apr 2020 06:21:14 -0400 IronPort-SDR: UQsTIgWKefsUMXqtPLXQxg6ouBAnKfC0T2foVfLRiD30WX95Ib0np7GaTcmizyElBwiCEyDIb7 iFP1BcBj7tgg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 03:21:13 -0700 IronPort-SDR: ySQ0rVq4vj1Kw0NWsqMA+zUA61ak4m1l5gWDv1p/wODWBKx+zsg31IJqEqxh6l7ecsbszvc/KA dDhAkfJSz4uA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,331,1583222400"; d="scan'208";a="404999202" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 29 Apr 2020 03:21:11 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jTjq6-003hwH-5E; Wed, 29 Apr 2020 13:21:14 +0300 Date: Wed, 29 Apr 2020 13:21:14 +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: <20200429102114.GF185537@smile.fi.intel.com> References: <80745504d15c87aa1da0d4be3c16d1279f48615b.1588112716.git.syednwaris@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80745504d15c87aa1da0d4be3c16d1279f48615b.1588112716.git.syednwaris@gmail.com> 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 Wed, Apr 29, 2020 at 04:39:47AM +0530, Syed Nayyar Waris wrote: > This patch reimplements the xgpio_set_multiple function in > drivers/gpio/gpio-xilinx.c to use the new for_each_set_clump macro. > Instead of looping for each bit in xgpio_set_multiple > function, now we can check each channel at a time and save cycles. > + 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. > + DECLARE_BITMAP(old, TOTAL_BITS); > + DECLARE_BITMAP(new, TOTAL_BITS); > + DECLARE_BITMAP(changed, TOTAL_BITS); -- With Best Regards, Andy Shevchenko