public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative
@ 2023-05-16  8:11 Yang Li
  2023-05-22 20:33 ` Ranjani Sridharan
  2023-05-23 19:50 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2023-05-16  8:11 UTC (permalink / raw)
  To: perex
  Cc: tiwai, pierre-louis.bossart, lgirdwood, peter.ujfalusi,
	yung-chuan.liao, ranjani.sridharan, daniel.baluta, kai.vehmanen,
	broonie, sound-open-firmware, alsa-devel, linux-kernel, Yang Li,
	Abaci Robot

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 <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4985
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 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;
 
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-23 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16  8:11 [PATCH -next] ASoC: SOF: ipc4-topology: Fix an unsigned comparison which can never be negative Yang Li
2023-05-22 20:33 ` Ranjani Sridharan
2023-05-23 19:50 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox