From: Tobias Klauser Date: Fri, 29 Sep 2006 09:00:21 +0000 (-0700) Subject: [PATCH] sound/sparc/dbri: Use ARRAY_SIZE macro X-Git-Tag: v2.6.19-rc1~751 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c2d8b5dcad468cb0bdec3368b53383bde51e487;p=linux-2.6 [PATCH] sound/sparc/dbri: Use ARRAY_SIZE macro Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) Signed-off-by: Tobias Klauser Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 8016541ec1..5a97be689b 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -2412,8 +2412,6 @@ static struct snd_kcontrol_new dbri_controls[] __devinitdata = { 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; @@ -2424,7 +2422,7 @@ static int __init snd_dbri_mixer(struct snd_dbri * dbri) 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;