linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible
@ 2021-11-18 19:28 Christophe JAILLET
  2021-11-19 19:59 ` Péter Ujfalusi
  2021-11-22  4:20 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-11-18 19:28 UTC (permalink / raw)
  To: peter.ujfalusi, vkoul
  Cc: dmaengine, linux-kernel, kernel-janitors, Christophe JAILLET

Use 'for_each_set_bit()' instead of hand wrinting it. It is much less
version.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/dma/ti/edma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index caa4050ecc02..08e47f44d325 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -1681,8 +1681,7 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
 
 			dev_dbg(ecc->dev, "EMR%d 0x%08x\n", j, val);
 			emr = val;
-			for (i = find_first_bit(&emr, 32); i < 32;
-			     i = find_next_bit(&emr, 32, i + 1)) {
+			for_each_set_bit(i, &emr, 32) {
 				int k = (j << 5) + i;
 
 				/* Clear the corresponding EMR bits */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible
  2021-11-18 19:28 [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible Christophe JAILLET
@ 2021-11-19 19:59 ` Péter Ujfalusi
  2021-11-22  4:20 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2021-11-19 19:59 UTC (permalink / raw)
  To: Christophe JAILLET, vkoul; +Cc: dmaengine, linux-kernel, kernel-janitors



On 18/11/2021 21:28, Christophe JAILLET wrote:
> Use 'for_each_set_bit()' instead of hand wrinting it. It is much less
> version.

Thanks for the patch!

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>


> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/dma/ti/edma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index caa4050ecc02..08e47f44d325 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -1681,8 +1681,7 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
>  
>  			dev_dbg(ecc->dev, "EMR%d 0x%08x\n", j, val);
>  			emr = val;
> -			for (i = find_first_bit(&emr, 32); i < 32;
> -			     i = find_next_bit(&emr, 32, i + 1)) {
> +			for_each_set_bit(i, &emr, 32) {
>  				int k = (j << 5) + i;
>  
>  				/* Clear the corresponding EMR bits */
> 

-- 
Péter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible
  2021-11-18 19:28 [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible Christophe JAILLET
  2021-11-19 19:59 ` Péter Ujfalusi
@ 2021-11-22  4:20 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2021-11-22  4:20 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: peter.ujfalusi, dmaengine, linux-kernel, kernel-janitors

On 18-11-21, 20:28, Christophe JAILLET wrote:
> Use 'for_each_set_bit()' instead of hand wrinting it. It is much less
> version.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-22  4:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 19:28 [PATCH] dmaengine: ti: edma: Use 'for_each_set_bit' when possible Christophe JAILLET
2021-11-19 19:59 ` Péter Ujfalusi
2021-11-22  4:20 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).