Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2013086ybz; Thu, 30 Apr 2020 09:19:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKy/61vYY2BRp8Qx2tQylWYiscxGQHPVI+fdK5xBWSidT1rSmRjkEt00KPXKfxMeVDFf1gl X-Received: by 2002:a05:6402:b17:: with SMTP id bm23mr3568007edb.137.1588263576007; Thu, 30 Apr 2020 09:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588263575; cv=none; d=google.com; s=arc-20160816; b=Zkucp3mGAx6JY46ZQn0ufGRlHk1vGkyR3FNxeZcWUr8NZLecCHheP58D18v2yHIPa8 GZiOdXsqce90pVzSi5x/TtRmQ4s6cf3y6rEm6klVFNZNmtuHOauo4ljYYqKdqhrn0xXE FahkHgIxLy5FU26q7HAhUhqQvIKWZccln0+nCkJ+C+oGwgDAzhRPj1ZZk+ye0kAMzs9o MRoiaWUumNT7Hv0cMnL0RGUlUwGn3Fc7qQh5JeGil3S/dH8xYjB7uCHKr77mFLZYdV7U H7DpLLPTp1xou0aAXfVodM8UkTpXMvU1GnYyBxD4PqEuoxH1HGU6JK3wWsxkNB2ab71K cYPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ohe0w2oqgXjSgHTpxKWLVpHjCPyoN0t0/3ExT/Ew+K4=; b=wqpa9yuD5UdY2Xe+DDN/tjkac64npdpcdrnBqKndnOnxdWZJn2GyfFJarMYVSkRaYS UrwYmNsfobs/EJ9lTQi1pNEeSWa8Lo3tBDvO7pmcIA+2iXBzDMybZo0TW7wWb4mWWaCz TcTt01YOMUr7v/A+Fu7gcFSC6rJr/td39W+SbQWtpTE3noSA4chUh1YPdG1p1EsC0YvH pPpubTy+65BV7jsd+687nFmdurlpvRbSjwtd0ky1XbW/dN5E/DnBtZGBCNfiSX+CwDQs lY8TGQe6pr4AbWK42qBb21mmKozdUyKeiUACpwhsns0tHa8mgmsM8zeCkH+i33mHz7X1 iorw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VuaBogpL; 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 t18si5599edr.553.2020.04.30.09.19.12; Thu, 30 Apr 2020 09:19:35 -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=VuaBogpL; 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 S1726859AbgD3QPa (ORCPT + 99 others); Thu, 30 Apr 2020 12:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726482AbgD3QP3 (ORCPT ); Thu, 30 Apr 2020 12:15:29 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4EFCC035494; Thu, 30 Apr 2020 09:15:29 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id u22so2400606plq.12; Thu, 30 Apr 2020 09:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ohe0w2oqgXjSgHTpxKWLVpHjCPyoN0t0/3ExT/Ew+K4=; b=VuaBogpL2YFhEFVc9AQbn0eky1wbDGzkUtCWbCmcnp0R1bB1IRDCslhlVdcg9YPnQu fu5ifDguLmSeDujMNFpVcFTqdgVr8VVnpMDF3wIsEFJHYiv6MbkXcq8R3EDVziIVV6iU /IsZY5yA23UwE0/SAKYNbhDSUD1sxu+OPr2qQiA6P0Eu+XW4w/EaSvMfhtuy05WdBXtA X5Uml1oXzvwEBxH98XSlYDf54/eaMANlNcciA3Q7Ku2NHkUVsHbOT6fb2SHLzsfF8dYn BrDNEMwHsV/XVTd18TsGUIN+i77tFkgb24YLd77edW7RD8V6ZepGBK6YXXfCQmOFVzI8 QFFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ohe0w2oqgXjSgHTpxKWLVpHjCPyoN0t0/3ExT/Ew+K4=; b=eUu8MYvW7oYwO1fgXiKdb2AINj9Znym5MUbft9VtxitEE8OGFTBmiOV61vjxxKZD+q 5vOJ5bDEdJhaJ02hLcvGxlE3fGA4Ii9jlQi99slJLSg3f3buFBkgAAKwvFddqY1h8B1L V5F1PFkTDyeWG6OUtAkbaj+A/rNJH7vqiVDTr1I+FwRUSfbBvGgtYXxyvP1F38xcedUL 7X6ByGyl2koHClkKnqMEyVQ5XP9d2ciiM9dDN28vZxzpvg3zO44XTUUStqVZ6ej7bNuf jG9OnguTHcAak+tvdYBf0k9fj4oyDlGKWspuVtfKVqLDdoJt3/4TpNJV3F/oZzmavDx7 BTew== X-Gm-Message-State: AGi0PuaUqAMeveKVmWCB2k5fIfkxInuduYsroqqpjgxuoDve851K26y7 f/eyixELgjtyr7ox4kjC41A= X-Received: by 2002:a17:90a:c481:: with SMTP id j1mr3800867pjt.5.1588263329136; Thu, 30 Apr 2020 09:15:29 -0700 (PDT) Received: from syed ([106.210.97.7]) by smtp.gmail.com with ESMTPSA id q19sm235805pfh.34.2020.04.30.09.15.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2020 09:15:28 -0700 (PDT) Date: Thu, 30 Apr 2020 21:45:14 +0530 From: Syed Nayyar Waris To: Andy Shevchenko 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: <20200430161514.GA7107@syed> References: <80745504d15c87aa1da0d4be3c16d1279f48615b.1588112716.git.syednwaris@gmail.com> <20200429102114.GF185537@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429102114.GF185537@smile.fi.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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 01:21:14PM +0300, Andy Shevchenko wrote: > 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. Thank you for your review comments. Just want to clarify, you want a new macro to be created - 'BITS_PER_U32' ? 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? 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 > >