mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Minjie Du <duminjie@vivo.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Minjie Du <duminjie@vivo.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	alsa-devel@alsa-project.org (moderated list:SOUND),
	linux-kernel@vger.kernel.org (open list)
Cc: opensource.kernel@vivo.com
Subject: [PATCH v1] sound: riptide: Remove duplicate judgments code
Date: Tue,  4 Jul 2023 17:11:31 +0800	[thread overview]
Message-ID: <20230704091131.6662-1-duminjie@vivo.com> (raw)

Fix: delate duplicate judgments
Could you help check it out? Thank you!

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 sound/pci/riptide/riptide.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index b37c877c2..9bf4b2e86 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -958,8 +958,7 @@ getsourcesink(struct cmdif *cif, unsigned char source, unsigned char sink,
 {
 	union cmdret rptr = CMDRET_ZERO;
 
-	if (SEND_RSSV(cif, source, sink, &rptr) &&
-	    SEND_RSSV(cif, source, sink, &rptr))
+	if (SEND_RSSV(cif, source, sink, &rptr))
 		return -EIO;
 	*a = rptr.retbytes[0];
 	*b = rptr.retbytes[1];
@@ -978,8 +977,7 @@ getsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int *rate)
 	s = intdec;
 	for (i = 0; i < 2; i++) {
 		if (*s != 0xff) {
-			if (SEND_RSRC(cif, *s, &rptr) &&
-			    SEND_RSRC(cif, *s, &rptr))
+			if (SEND_RSRC(cif, *s, &rptr))
 				return -EIO;
 			p[i] += rptr.retwords[1];
 			p[i] *= rptr.retwords[2];
@@ -1013,8 +1011,7 @@ setsampleformat(struct cmdif *cif,
 	sig = snd_pcm_format_unsigned(format) != 0;
 	order = snd_pcm_format_big_endian(format) != 0;
 
-	if (SEND_SETF(cif, mixer, w, ch, order, sig, id) &&
-	    SEND_SETF(cif, mixer, w, ch, order, sig, id)) {
+	if (SEND_SETF(cif, mixer, w, ch, order, sig, id)) {
 		snd_printdd("setsampleformat failed\n");
 		return -EIO;
 	}
@@ -1060,7 +1057,7 @@ getmixer(struct cmdif *cif, short num, unsigned short *rval,
 {
 	union cmdret rptr = CMDRET_ZERO;
 
-	if (SEND_RDGV(cif, num, num, &rptr) && SEND_RDGV(cif, num, num, &rptr))
+	if (SEND_RDGV(cif, num, num, &rptr))
 		return -EIO;
 	*rval = rptr.retwords[0];
 	*lval = rptr.retwords[1];
-- 
2.39.0


             reply	other threads:[~2023-07-04  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04  9:11 Minjie Du [this message]
2023-07-04  9:31 ` 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=20230704091131.6662-1-duminjie@vivo.com \
    --to=duminjie@vivo.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=perex@perex.cz \
    --cc=sfr@canb.auug.org.au \
    --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

all inboxes | Powered by JetHome®