From patchwork Tue May 16 08:11:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 94506 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp262552vqo; Tue, 16 May 2023 01:22:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6d2GY2MQhp/0Qr7UoWBF4EguFvTZnXP+q3S3qGsy4zBaihIK6SpJEYgvv39heQhuKuJaYd X-Received: by 2002:a17:90a:d590:b0:250:b16:f498 with SMTP id v16-20020a17090ad59000b002500b16f498mr35083003pju.47.1684225352343; Tue, 16 May 2023 01:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684225352; cv=none; d=google.com; s=arc-20160816; b=kMGTT6bNfjHWwjsvqxC4DER+hlvDgiHJIuOHS8jMB5Z47Q7e74wRz4EtLqQ/Ue+0Fv r+FIz7clasWWhEKWamcRjnsTjefuNfAb6gu/ZWYPQKIyLrsMltiB81KtQhYYerPjAG3F d1dPRbAqym3r+XV/vpEKnMAe9PYKRDW+kvvgHf59kNTNmoLh2YtEUAvfpGe6De0nDS9W LfuT/L2QKOQpbKjnjYiN8PVZvI9CXNb0nLhCr5vHRuFdDQ/joG0Pl3Oaz6GDIIECInMp Tp75UGhSUqmGJs/Hm1Ej1eJ7K2o8o4eSsHcP0z8SU6Z12x/rUyYAenvwCxbx9uqPlEQP PW1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ATrK/DFgb9hb7hx+aUy9AlE+5CJNCzvg+LTWEET2Hyo=; b=EjSpauICd5zUCJkCTXotCGtbLO5ttw6OKOy1+vCmI/wH7PIlnLX8tFxZXUQzyA53w1 ssiwttdUkH/eNbk5J/5TFZ03HsSFe+JC+cRKgOo5gHaM0mFcfBula6DrfSNDp0Q6mQaK U+uMdFg8QLzWKU0Rqwp3rQ7/fSwp0EtCTjjqWZzdyoRBTgPRg1iq18kavvgNRDGR+yyn w054g4x44/09F12mai4xBCxTYP/GQzoLQbaqvQD5/n1QY4vw4y1TdJb3rh+NsBluQfXs Rmiph37KDmBJbM99EIKCrhq6AxIkGChjIqZoKbS+M+s7hRd92qmJbCyWS53JF3sXos43 HaMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go13-20020a17090b03cd00b0024b9e5aa258si17736862pjb.0.2023.05.16.01.22.17; Tue, 16 May 2023 01:22:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231332AbjEPIL0 (ORCPT + 99 others); Tue, 16 May 2023 04:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbjEPILY (ORCPT ); Tue, 16 May 2023 04:11:24 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95AE540C1 for ; Tue, 16 May 2023 01:11:23 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VinPRLs_1684224678; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VinPRLs_1684224678) by smtp.aliyun-inc.com; Tue, 16 May 2023 16:11:19 +0800 From: Yang Li To: perex@perex.cz Cc: tiwai@suse.com, pierre-louis.bossart@linux.intel.com, lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com, kai.vehmanen@linux.intel.com, broonie@kernel.org, sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] ASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative Date: Tue, 16 May 2023 16:11:16 +0800 Message-Id: <20230516081116.71370-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766038283169484180?= X-GMAIL-MSGID: =?utf-8?q?1766038283169484180?= The return value from the call to sof_ipc4_get_valid_bits() is int. However, the return value is being assigned to an unsigned int variable 'out_ref_valid_bits', so making it an int. Eliminate the following warning: ./sound/soc/sof/ipc4-topology.c:1537:6-24: WARNING: Unsigned expression compared with zero: out_ref_valid_bits < 0 Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4985 Signed-off-by: Yang Li Reviewed-by: Ranjani Sridharan --- sound/soc/sof/ipc4-topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index dce2f8f7f518..d82ac5701eb2 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -1381,8 +1381,8 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, void **ipc_config_data; int *ipc_config_size; u32 **data; - int ipc_size, ret; - u32 out_ref_rate, out_ref_channels, out_ref_valid_bits; + int ipc_size, ret, out_ref_valid_bits; + u32 out_ref_rate, out_ref_channels; u32 deep_buffer_dma_ms = 0; int output_fmt_index;