lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241203154635.2512-1-liujing@cmss.chinamobile.com>
Date: Tue,  3 Dec 2024 23:46:35 +0800
From: liujing <liujing@...s.chinamobile.com>
To: perex@...ex.cz,
	tiwai@...e.com
Cc: linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	liujing <liujing@...s.chinamobile.com>
Subject: [PATCH] ALSA: asihpi: Delete redundant judgments

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

Signed-off-by: liujing <liujing@...s.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




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ