Received: by 10.223.164.202 with SMTP id h10csp1010117wrb; Fri, 17 Nov 2017 12:18:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMZEuauSVivxUpO5GwSTF7Tn4jxNMBM8qvItcrxcj1yhA1oyo9fXI0iyNpGov7fFiosr1r5l X-Received: by 10.84.239.1 with SMTP id w1mr443403plk.227.1510949917704; Fri, 17 Nov 2017 12:18:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510949917; cv=none; d=google.com; s=arc-20160816; b=pyP94DJ1zQ+ezVY9DbtKLQCuoUrN3taISHXMCXzkcuuzvI2hvwWy1KHSoU9+RGH1SD 7KmSkpyErdEQkQmE7wty1SjHdQoXykIlQ8zmN/lPRhLuvMza31sPVvYF2v3SvJfX5jsi Rv64ikC1KbPZZVEjHFCg3PqM8rCM8xzbib+GSzAF8HIlbJgKWF2OvSc+aNq/5MFhSjrz Tb94meBVyYHWJcfImbw2QrKtRl/D2C2umYHCvCHz/6+qAHnVzvlKSOHIIcWaMBmoW6Um qIhIC0igi5zRrFVy9XCT2ACpJE/2frFlJNQruNQw3bMWiCKDfVm+dSHQElTM1xKKqfIs er7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:reply-to:from:date :message-id:arc-authentication-results; bh=7+mZnxQqdJUhzby+0R7dGHdhBbSIG8MWvgdaRGGuw1c=; b=R+Uw9L3maIgzTZDD/Kg2bdwdGZk+C/fu48UnDKe0ARkhMsc504IhMQ0vI7hJ3t9LC1 MuZMWkdd30uVUci/P2dLQPorzPd4Y1eQGkGC8d0bYIpX95ProMkSCH0HpXbtKdx3g44C yUbeU9/1MHrH5MKM3IHJwB+Ql0ux+zswcZfM41X7TvIYMJM2CAM9hD5kHQ+dylbw0a8U 7YTfKmFX/5mAsS2rLE4cLHfsSZtDn0dJwsaULogpH3V2UvGzO436/RbnfAzoOjxBJpQi ar36LQmV9303HK0P4FZ1uBaySrWBQR/ZDSZr67oFCfC/bJ2EOAsNiCZkpw5lY8wnMmbT QCuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t84si3582754pfg.252.2017.11.17.12.18.24; Fri, 17 Nov 2017 12:18:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456AbdKQLLY (ORCPT + 92 others); Fri, 17 Nov 2017 06:11:24 -0500 Received: from mx02-sz.bfs.de ([194.94.69.103]:29303 "EHLO mx02-sz.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbdKQLLR (ORCPT ); Fri, 17 Nov 2017 06:11:17 -0500 Received: from localhost (localhost [127.0.0.1]) by mx02-sz.bfs.de (Postfix) with ESMTP id 66B262F7; Fri, 17 Nov 2017 12:11:16 +0100 (CET) X-Virus-Scanned: amavisd-new at bfs.de Received: from mx02-sz.bfs.de ([127.0.0.1]) by localhost (mx02-sz.bfs.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lk-tHSBkvkW3; Fri, 17 Nov 2017 12:11:15 +0100 (CET) Received: from mail-fr.bfs.de (mail-fr.bfs.de [10.177.18.200]) by mx02-sz.bfs.de (Postfix) with ESMTPS; Fri, 17 Nov 2017 12:11:15 +0100 (CET) Received: from [134.92.181.33] (unknown [134.92.181.33]) by mail-fr.bfs.de (Postfix) with ESMTPS id CB410BEE58; Fri, 17 Nov 2017 12:11:14 +0100 (CET) Message-ID: <5A0EC3D0.6020101@bfs.de> Date: Fri, 17 Nov 2017 12:11:12 +0100 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Colin Ian King CC: Takashi Iwai , alsa-devel@alsa-project.org, Jaroslav Kysela , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: synth: emux: remove redundant test for r <= 13 References: <20171114172653.6690-1-colin.king@canonical.com> <8de4b3a4-9ab4-3d23-6664-afffb28d864e@canonical.com> In-Reply-To: <8de4b3a4-9ab4-3d23-6664-afffb28d864e@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 17.11.2017 12:07, schrieb Colin Ian King: > On 17/11/17 11:06, Takashi Iwai wrote: >> On Tue, 14 Nov 2017 18:26:53 +0100, >> Colin King wrote: >>> >>> From: Colin Ian King >>> >>> 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 >> >> The calculation of t itself can be generic in case we may add a >> support greater than the current r, so I don't think it's so much >> beneficial with this code reduction. Better to keep the code as >> reference. > > OK, that's a good decision. > NTL is should be documented that this is intentional before the next scanner finds it. just my 2 cents, re, wh > Colin >> >> >> thanks, >> >> Takashi >> >>> --- >>> 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 >>> >>> >> -- >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > From 1584345810930587416@xxx Fri Nov 17 20:18:28 +0000 2017 X-GM-THRID: 1584068603357623771 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread