public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo
@ 2014-05-28 16:43 Dan Carpenter
  2014-05-28 21:58 ` [alsa-devel] " Takashi Sakamoto
  2014-05-29 13:58 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-05-28 16:43 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Jaroslav Kysela, Takashi Iwai, Takashi Sakamoto, alsa-devel,
	kernel-janitors

ARRAY_SIZE() was intended here instead of sizeof().  The
"bridgeco_freq_table" array holds integers so the original condition is
never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index 514c7c9..bc4f827 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -749,7 +749,7 @@ parse_stream_formation(u8 *buf, unsigned int len,
 		if (buf[2] = bridgeco_freq_table[i])
 			break;
 	}
-	if (i = sizeof(bridgeco_freq_table))
+	if (i = ARRAY_SIZE(bridgeco_freq_table))
 		return -ENOSYS;
 
 	/* Avoid double count by different entries for the same rate. */

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

* Re: [alsa-devel] [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo
  2014-05-28 16:43 [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo Dan Carpenter
@ 2014-05-28 21:58 ` Takashi Sakamoto
  2014-05-29 13:58 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Sakamoto @ 2014-05-28 21:58 UTC (permalink / raw)
  To: Dan Carpenter, Clemens Ladisch; +Cc: Takashi Iwai, alsa-devel, kernel-janitors

(May 19 2014 01:43), Dan Carpenter wrote:
> ARRAY_SIZE() was intended here instead of sizeof().  The
> "bridgeco_freq_table" array holds integers so the original condition is
> never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

> diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
> index 514c7c9..bc4f827 100644
> --- a/sound/firewire/bebob/bebob_stream.c
> +++ b/sound/firewire/bebob/bebob_stream.c
> @@ -749,7 +749,7 @@ parse_stream_formation(u8 *buf, unsigned int len,
>  		if (buf[2] = bridgeco_freq_table[i])
>  			break;
>  	}
> -	if (i = sizeof(bridgeco_freq_table))
> +	if (i = ARRAY_SIZE(bridgeco_freq_table))
>  		return -ENOSYS;
>  
>  	/* Avoid double count by different entries for the same rate. */


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

* Re: [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo
  2014-05-28 16:43 [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo Dan Carpenter
  2014-05-28 21:58 ` [alsa-devel] " Takashi Sakamoto
@ 2014-05-29 13:58 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2014-05-29 13:58 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Clemens Ladisch, Jaroslav Kysela, Takashi Sakamoto, alsa-devel,
	kernel-janitors

At Wed, 28 May 2014 19:43:30 +0300,
Dan Carpenter wrote:
> 
> ARRAY_SIZE() was intended here instead of sizeof().  The
> "bridgeco_freq_table" array holds integers so the original condition is
> never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

> 
> diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
> index 514c7c9..bc4f827 100644
> --- a/sound/firewire/bebob/bebob_stream.c
> +++ b/sound/firewire/bebob/bebob_stream.c
> @@ -749,7 +749,7 @@ parse_stream_formation(u8 *buf, unsigned int len,
>  		if (buf[2] = bridgeco_freq_table[i])
>  			break;
>  	}
> -	if (i = sizeof(bridgeco_freq_table))
> +	if (i = ARRAY_SIZE(bridgeco_freq_table))
>  		return -ENOSYS;
>  
>  	/* Avoid double count by different entries for the same rate. */
> 

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

end of thread, other threads:[~2014-05-29 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-28 16:43 [patch] ALSA: bebob: sizeof() vs ARRAY_SIZE() typo Dan Carpenter
2014-05-28 21:58 ` [alsa-devel] " Takashi Sakamoto
2014-05-29 13:58 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox