Skip to contentSkip to conversation

ALSA: bebob: sizeof() vs ARRAY_SIZE() typo

PATCH Applied Dan Carpenter 3 participants 3 messages May 28, 2014 – May 29, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: bebob: sizeof() vs ARRAY_SIZE() typo

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

sound/firewire/bebob/bebob_stream.c +1 -1
index 514c7c9..bc4f827 100644
@@ -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. */
maintainer Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

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

Quoted 13 lines
sound/firewire/bebob/bebob_stream.c +1 -1
index 514c7c9..bc4f827 100644
@@ -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. */
Applied
#2 lore raw
In reply to Dan Carpenter

At Wed, 28 May 2014 19:43:30 +0300,

Quoted 6 lines · Dan Carpenter

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

Applied, thanks.

Takashi

Quoted 15 lines
sound/firewire/bebob/bebob_stream.c +1 -1
index 514c7c9..bc4f827 100644
@@ -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. */