Skip to contentSkip to conversation

sound/sparc/dbri: Use ARRAY_SIZE macro

PATCH New Tobias Klauser 1 participant 1 message Aug 12, 2006

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

PATCH 1/1 sound/sparc/dbri: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0])

---
 sound/sparc/dbri.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/sparc/dbri.c +1 -3
index f3ae6e2..f5475f9 100644
@@ -2452,8 +2452,6 @@ static struct snd_kcontrol_new dbri_cont
 	CS4215_SINGLE("Mic boost", 4, 4, 1, 1)
 };
 
-#define NUM_CS4215_CONTROLS (sizeof(dbri_controls)/sizeof(struct snd_kcontrol_new))
-
 static int __init snd_dbri_mixer(struct snd_dbri * dbri)
 {
 	struct snd_card *card;
@@ -2464,7 +2462,7 @@ static int __init snd_dbri_mixer(struct 
 	card = dbri->card;
 	strcpy(card->mixername, card->shortname);
 
-	for (idx = 0; idx < NUM_CS4215_CONTROLS; idx++) {
+	for (idx = 0; idx < ARRAY_SIZE(dbri_controls); idx++) {
 		if ((err = snd_ctl_add(card,
 				snd_ctl_new1(&dbri_controls[idx], dbri))) < 0)
 			return err;
Signature · 6 lines
1.4.1

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors