LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97()
@ 2008-03-05 17:55 Roel Kluin
  2008-03-05 18:16 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-03-05 17:55 UTC (permalink / raw)
  To: mchehab, v4l-dvb-maintainer; +Cc: video4linux-list, lkml

Mind that the patch below was not yet tested
---
! has a higher priority than &

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 7d1537c..da8189a 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
 	for (i = 0; i < 10; i++) {
 		if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
 			return ret;
-		if (!((u8) ret) & 0x01)
+		if (!(((u8) ret) & 0x01))
 			return 0;
 		msleep(5);
 	}

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

* Re: [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97()
  2008-03-05 17:55 [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97() Roel Kluin
@ 2008-03-05 18:16 ` Joe Perches
  2008-03-05 18:43   ` Roel Kluin
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2008-03-05 18:16 UTC (permalink / raw)
  To: Roel Kluin; +Cc: mchehab, v4l-dvb-maintainer, video4linux-list, lkml

On Wed, 2008-03-05 at 18:55 +0100, Roel Kluin wrote:
> diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
> index 7d1537c..da8189a 100644
> --- a/drivers/media/video/em28xx/em28xx-core.c
> +++ b/drivers/media/video/em28xx/em28xx-core.c
> @@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
>  	for (i = 0; i < 10; i++) {
>  		if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
>  			return ret;
> -		if (!((u8) ret) & 0x01)
> +		if (!(((u8) ret) & 0x01))

I think it'd be clearer without the cast to (u8)
which is then implicit cast back to int anyway

	if (!(ret & 1))



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

* Re: [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97()
  2008-03-05 18:16 ` Joe Perches
@ 2008-03-05 18:43   ` Roel Kluin
  2008-03-10 12:23     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-03-05 18:43 UTC (permalink / raw)
  To: Joe Perches; +Cc: mchehab, v4l-dvb-maintainer, video4linux-list, lkml

Joe Perches wrote:

>> -		if (!((u8) ret) & 0x01)
>> +		if (!(((u8) ret) & 0x01))
> 
> I think it'd be clearer without the cast to (u8)
> which is then implicit cast back to int anyway
> 
> 	if (!(ret & 1))

ok.
---

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 7d1537c..c797472 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
 	for (i = 0; i < 10; i++) {
 		if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
 			return ret;
-		if (!((u8) ret) & 0x01)
+		if (!(ret & 1))
 			return 0;
 		msleep(5);
 	}

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

* Re: [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97()
  2008-03-05 18:43   ` Roel Kluin
@ 2008-03-10 12:23     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2008-03-10 12:23 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Joe Perches, v4l-dvb-maintainer, video4linux-list, lkml

Roel and Joe,

Thanks for your patches.

I've already received and committed two patches with your proposed changes:

http://linuxtv.org/hg/v4l-dvb/rev/127f67dea087
http://linuxtv.org/hg/v4l-dvb/rev/f83ed13f5bf5

Cheers,
Mauro

On Wed, 05 Mar 2008 19:43:46 +0100
Roel Kluin <12o3l@tiscali.nl> wrote:

> Joe Perches wrote:
> 
> >> -		if (!((u8) ret) & 0x01)
> >> +		if (!(((u8) ret) & 0x01))
> > 
> > I think it'd be clearer without the cast to (u8)
> > which is then implicit cast back to int anyway
> > 
> > 	if (!(ret & 1))
> 
> ok.
> ---
> 
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
> index 7d1537c..c797472 100644
> --- a/drivers/media/video/em28xx/em28xx-core.c
> +++ b/drivers/media/video/em28xx/em28xx-core.c
> @@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
>  	for (i = 0; i < 10; i++) {
>  		if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
>  			return ret;
> -		if (!((u8) ret) & 0x01)
> +		if (!(ret & 1))
>  			return 0;
>  		msleep(5);
>  	}




Cheers,
Mauro

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

end of thread, other threads:[~2008-03-10 12:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 17:55 [PATCH] em28xx-core.c: add missing parentheses in em28xx_write_ac97() Roel Kluin
2008-03-05 18:16 ` Joe Perches
2008-03-05 18:43   ` Roel Kluin
2008-03-10 12:23     ` Mauro Carvalho Chehab

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).