mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liujing <liujing@cmss.chinamobile.com>
To: perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	liujing <liujing@cmss.chinamobile.com>
Subject: [PATCH] ALSA: asihpi: Delete redundant judgments
Date: Tue,  3 Dec 2024 23:46:35 +0800	[thread overview]
Message-ID: <20241203154635.2512-1-liujing@cmss.chinamobile.com> (raw)

Since HPI6205_TIMEOUT is a constant, time_out is always true,
so unneeded judgments are removed.

Signed-off-by: liujing <liujing@cmss.chinamobile.com>

diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c
index c7d7eff86727..391cce428a11 100644
--- a/sound/pci/asihpi/hpi6205.c
+++ b/sound/pci/asihpi/hpi6205.c
@@ -2127,22 +2127,20 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao,
 	time_out = HPI6205_TIMEOUT;
 
 	/* read the result */
-	if (time_out) {
-		if (interface->u.response_buffer.response.size <= phr->size)
-			memcpy(phr, &interface->u.response_buffer,
-				interface->u.response_buffer.response.size);
-		else {
-			HPI_DEBUG_LOG(ERROR,
+	if (interface->u.response_buffer.response.size <= phr->size)
+		memcpy(phr, &interface->u.response_buffer,
+			interface->u.response_buffer.response.size);
+	else {
+		HPI_DEBUG_LOG(ERROR,
 				"response len %d too big for buffer %d\n",
 				interface->u.response_buffer.response.size,
 				phr->size);
-			memcpy(phr, &interface->u.response_buffer,
+		memcpy(phr, &interface->u.response_buffer,
 				sizeof(struct hpi_response_header));
-			phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL;
-			phr->specific_error =
-				interface->u.response_buffer.response.size;
-			phr->size = sizeof(struct hpi_response_header);
-		}
+		phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL;
+		phr->specific_error =
+			interface->u.response_buffer.response.size;
+		phr->size = sizeof(struct hpi_response_header);
 	}
 	/* set interface back to idle */
 	send_dsp_command(phw, H620_HIF_IDLE);
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 7ceaf6a7a77e..cac5fcaef08b 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -1320,12 +1320,12 @@ static int snd_mixart_probe(struct pci_dev *pci,
 			idx = index[dev];
 		else
 			idx = index[dev] + i;
-		snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
+		snprintf(tmpid, sizeof(tmpid), "%s-%u", id[dev] ? id[dev] : "MIXART", i);
 		err = snd_card_new(&pci->dev, idx, tmpid, THIS_MODULE,
 				   0, &card);
 
 		if (err < 0) {
-			dev_err(&pci->dev, "cannot allocate the card %d\n", i);
+			dev_err(&pci->dev, "cannot allocate the card %u\n", i);
 			snd_mixart_free(mgr);
 			return err;
 		}
@@ -1334,7 +1334,7 @@ static int snd_mixart_probe(struct pci_dev *pci,
 		snprintf(card->shortname, sizeof(card->shortname),
 			 "Digigram miXart [PCM #%d]", i);
 		snprintf(card->longname, sizeof(card->longname),
-			"Digigram miXart at 0x%lx & 0x%lx, irq %i [PCM #%d]",
+			"Digigram miXart at 0x%lx & 0x%lx, irq %i [PCM #%u]",
 			mgr->mem[0].phys, mgr->mem[1].phys, mgr->irq, i);
 
 		err = snd_mixart_create(mgr, card, i);
-- 
2.27.0




             reply	other threads:[~2024-12-03 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 15:46 liujing [this message]
2024-12-04  9:31 ` Takashi Iwai
2024-12-04 11:43 ` kernel test robot

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=20241203154635.2512-1-liujing@cmss.chinamobile.com \
    --to=liujing@cmss.chinamobile.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@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

all inboxes | Powered by JetHome®