alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] ALSA: bebob: Improve a size determination in parse_stream_formation()
Date: Wed, 6 Sep 2017 12:24:22 +0200	[thread overview]
Message-ID: <3092a93b-9991-eca8-bc77-5c973355477e@users.sourceforge.net> (raw)
In-Reply-To: <85f95150-9cec-7a53-7692-837ba543e1ec@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Sep 2017 11:55:45 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 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 211ff43207d6..a26863b82330 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -736,7 +736,7 @@ parse_stream_formation(u8 *buf, unsigned int len,
 		return -ENOSYS;
 
 	/* Avoid double count by different entries for the same rate. */
-	memset(&formation[i], 0, sizeof(struct snd_bebob_stream_formation));
+	memset(&formation[i], 0, sizeof(*formation));
 
 	for (e = 0; e < buf[4]; e++) {
 		channels = buf[5 + e * 2];
-- 
2.14.1

      parent reply	other threads:[~2017-09-06 10:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 10:21 [PATCH 0/3] ALSA: BeBoB: Fine-tuning for six function implementations SF Markus Elfring
2017-09-06 10:22 ` [PATCH 1/3] ALSA: bebob: Use common error handling code in snd_bebob_stream_start_duplex() SF Markus Elfring
2017-09-24  3:50   ` Takashi Sakamoto
2017-09-24  7:06     ` SF Markus Elfring
2017-09-26 23:30       ` Takashi Sakamoto
2017-09-27  6:38         ` SF Markus Elfring
2017-09-27 11:09           ` Takashi Sakamoto
2017-09-06 10:23 ` [PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers SF Markus Elfring
2017-09-06 10:24 ` SF Markus Elfring [this message]

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=3092a93b-9991-eca8-bc77-5c973355477e@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).