From patchwork Fri Nov 8 03:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luo Yifan X-Patchwork-Id: 13867422 Received: from cmccmta2.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F4A34962C; Fri, 8 Nov 2024 03:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.22.67.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731036433; cv=none; b=LaP7OUJvGrA95VLJEOF+BMg4gqx4hmAyLQtq9moQcB6iQLel2aNPv6bUj8w1IUX1o/2Ebq5kY3/2IEvzi89mnWIpXdHnnH4EZ4hC00mdC842K/NEUGhaEV3qXDLKaojoUWQT67+Z0RHVM/BN+1bG0OVdrEXYkaoUTnjNXKsi1cc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731036433; c=relaxed/simple; bh=cDiAD11i49EaVXWiTXFqmb6+pxirgdJOujFJfqczyNs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=jUPrvObymswOcHcY74/pSDYhooy+ZBl6xoXsafPxPi0CjkyK50SKRuh0d+2+Z66LceZxvgjEpdBK36m9nnvkYsTBWP2HjoT6B++g4VeXsJszG7GPnbQAN+JaS8hVhRct8Rt3mIN8QzzfTW20L5GM9TELXgpiMBFrjqtEygFH5kk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=none smtp.client-ip=111.22.67.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee6672d8508358-bcc24; Fri, 08 Nov 2024 11:27:05 +0800 (CST) X-RM-TRANSID: 2ee6672d8508358-bcc24 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.103]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee9672d8507b87-84368; Fri, 08 Nov 2024 11:27:04 +0800 (CST) X-RM-TRANSID: 2ee9672d8507b87-84368 From: Luo Yifan To: perex@perex.cz, tiwai@suse.com Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Luo Yifan Subject: [PATCH] ALSA: ump: remove unnecessary check on blk Date: Fri, 8 Nov 2024 11:27:02 +0800 Message-Id: <20241108032702.217168-1-luoyifan@cmss.chinamobile.com> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The unsigned expression 'blk' will never be negative, so remove the unnecessary check. Signed-off-by: Luo Yifan --- sound/core/ump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/ump.c b/sound/core/ump.c index cf22a17e3..af763939e 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -366,7 +366,7 @@ int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk, { struct snd_ump_block *fb, *p; - if (blk < 0 || blk >= SNDRV_UMP_MAX_BLOCKS) + if (blk >= SNDRV_UMP_MAX_BLOCKS) return -EINVAL; if (snd_ump_get_block(ump, blk))