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]
Date:   Tue, 14 Nov 2017 17:26:53 +0000
From:   Colin King <colin.king@...onical.com>
To:     Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
        alsa-devel@...a-project.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ALSA: synth: emux: remove redundant test for r <= 13

From: Colin Ian King <colin.king@...onical.com>

The calculation r = (3 - ((rate >> 6) & 3)) * 3 results in r being
0, 3, 6 or 9 and so the check (13 > r) is always true and hence we
can remove the redundant check and the else path.

Detected by CoverityScan, CID#744415 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 sound/synth/emux/soundfont.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 31a4ea94830e..0beb5a737c8b 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -858,10 +858,7 @@ calc_gus_envelope_time(int rate, int start, int end)
 	p = rate & 0x3f;
 	t = end - start;
 	if (t < 0) t = -t;
-	if (13 > r)
-		t = t << (13 - r);
-	else
-		t = t >> (r - 13);
+	t = t << (13 - r);
 	return (t * 10) / (p * 441);
 }
 
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ