All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de, perex@perex.cz
Cc: alsa-devel@alsa-project.org
Subject: [PATCH] bebob: Use ARRAY_SIZE() instead of sizeof() for return condition
Date: Sat, 31 May 2014 15:33:52 +0900	[thread overview]
Message-ID: <1401518032-7223-1-git-send-email-o-takashi@sakamocchi.jp> (raw)

The parser for stream format information should return when detecting wrong
value for sampling rate. But it doesn't.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/bebob/bebob_stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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. */
-- 
1.8.3.2

             reply	other threads:[~2014-05-31  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-31  6:33 Takashi Sakamoto [this message]
2014-05-31  7:34 ` [PATCH] bebob: Use ARRAY_SIZE() instead of sizeof() for return condition Takashi Iwai
2014-06-01 15:04   ` Takashi Sakamoto
2014-06-01 16:17     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401518032-7223-1-git-send-email-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.