alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 01/10] ALSA: firewire-lib: fix invalid assignment to union data for directional parameter
Date: Fri,  8 May 2020 13:36:26 +0900	[thread overview]
Message-ID: <20200508043635.349339-2-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20200508043635.349339-1-o-takashi@sakamocchi.jp>

Although the value of FDF is used just for outgoing stream, the assignment
to union member is done for both directions of stream. At present this
causes no issue because the value of same position is reassigned later for
opposite stream. However, it's better to add if statement.

Fixes: d3d10a4a1b19 ("ALSA: firewire-lib: use union for directional parameters")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/amdtp-am824.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/firewire/amdtp-am824.c b/sound/firewire/amdtp-am824.c
index 67d735e9a6a4..fea92e148790 100644
--- a/sound/firewire/amdtp-am824.c
+++ b/sound/firewire/amdtp-am824.c
@@ -82,7 +82,8 @@ int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
 	if (err < 0)
 		return err;
 
-	s->ctx_data.rx.fdf = AMDTP_FDF_AM824 | s->sfc;
+	if (s->direction == AMDTP_OUT_STREAM)
+		s->ctx_data.rx.fdf = AMDTP_FDF_AM824 | s->sfc;
 
 	p->pcm_channels = pcm_channels;
 	p->midi_ports = midi_ports;
-- 
2.25.1


  reply	other threads:[~2020-05-08  4:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  4:36 [PATCH 00/10] ALSA: firewire-lib: pool sequence of syt offset and data blocks in AMDTP domain structure Takashi Sakamoto
2020-05-08  4:36 ` Takashi Sakamoto [this message]
2020-05-08  4:36 ` [PATCH 02/10] ALSA: firewire-lib: use macro for maximum value of second in 1394 OHCI isoc descriptor Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 03/10] ALSA: firewire-lib: add reference to domain structure from stream structure Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 04/10] ALSA: firewire-lib: code refactoring for parameters of packet queue and IRQ timing Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 05/10] ALSA: firewire-lib: code refactoring for syt computation Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 06/10] ALSA: firewire-lib: code refactoring for syt offset calculation Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 07/10] ALSA: firewire-lib: code refactoring for data block calculation Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 08/10] ALSA: firewire-lib: add cache for packet sequence to AMDTP domain structure Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 09/10] ALSA: firewire-lib: pool ideal sequence of syt offset and data block Takashi Sakamoto
2020-05-08  4:36 ` [PATCH 10/10] ALSA: firewire-lib: use sequence of syt offset and data block on pool in AMDTP domain Takashi Sakamoto
2020-05-08  7:48 ` [PATCH 00/10] ALSA: firewire-lib: pool sequence of syt offset and data blocks in AMDTP domain structure 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=20200508043635.349339-2-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --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 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).