All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Syed Nayyar Waris <syednwaris@gmail.com>
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
Date: Thu, 30 Apr 2020 19:38:55 +0300	[thread overview]
Message-ID: <20200430163855.GU185537@smile.fi.intel.com> (raw)
In-Reply-To: <20200430161514.GA7107@syed>

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



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Syed Nayyar Waris <syednwaris@gmail.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linus.walleij@linaro.org, vilhelm.gray@gmail.com,
	michal.simek@xilinx.com, bgolaszewski@baylibre.com,
	akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/4] gpio: xilinx: Utilize for_each_set_clump macro
Date: Thu, 30 Apr 2020 19:38:55 +0300	[thread overview]
Message-ID: <20200430163855.GU185537@smile.fi.intel.com> (raw)
In-Reply-To: <20200430161514.GA7107@syed>

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



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-04-30 16:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 23:03 [PATCH v3 0/4] Introduce the for_each_set_clump macro Syed Nayyar Waris
2020-04-28 23:03 ` Syed Nayyar Waris
2020-04-28 23:04 ` [PATCH v3 1/4] bitops: Introduce the " Syed Nayyar Waris
2020-04-28 23:05 ` [PATCH v3 2/4] lib/test_bitmap.c: Add for_each_set_clump test cases Syed Nayyar Waris
2020-04-29 10:16   ` Andy Shevchenko
2020-04-28 23:07 ` [PATCH v3 3/4] gpio: thunderx: Utilize for_each_set_clump macro Syed Nayyar Waris
2020-04-29 10:17   ` Andy Shevchenko
2020-04-30 16:22     ` Syed Nayyar Waris
2020-04-28 23:09 ` [PATCH v3 4/4] gpio: xilinx: " Syed Nayyar Waris
2020-04-28 23:09   ` Syed Nayyar Waris
2020-04-29 10:21   ` Andy Shevchenko
2020-04-29 10:21     ` Andy Shevchenko
2020-04-30 16:15     ` Syed Nayyar Waris
2020-04-30 16:15       ` Syed Nayyar Waris
2020-04-30 16:38       ` Andy Shevchenko [this message]
2020-04-30 16:38         ` Andy Shevchenko
2020-04-30 23:32         ` William Breathitt Gray
2020-04-30 23:32           ` William Breathitt Gray
2020-05-01 13:32           ` Andy Shevchenko
2020-05-01 13:32             ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200430163855.GU185537@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=syednwaris@gmail.com \
    --cc=vilhelm.gray@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.