- Backports from upstream: minor PCM fixes, topology API updates, and a few build cleanup: 0002-pcm-simple-Fix-asserts.patch 0003-topology-open-topology-files-with-O_TRUNC.patch 0004-topology-Remove-unused-function-write_data_block.patch 0005-topology-Remove-unused-variables.patch 0006-topology-Fix-comparison-of-unsigned-expression-0.patch 0007-topology-Not-compare-a-for-loop-iterator-with-ABI-__.patch 0008-topology-Quit-and-show-error-message-on-big-endian-m.patch 0009-config-files-do-not-include-ucm-topology-configurati.patch 0010-control-add-missing-asserts-to-ctl_elem_set-function.patch 0011-pcm_hw-fix-possible-memory-leak-coverity.patch 0012-coverity-fixes.patch 0013-topology-fix-debug-output-to-print-correct-max-value.patch OBS-URL: https://build.opensuse.org/request/show/357797 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=192
49 lines
1.5 KiB
Diff
49 lines
1.5 KiB
Diff
From 8504a41d9424456f2cdca058d036eb42c195ee52 Mon Sep 17 00:00:00 2001
|
|
From: Mengdong Lin <mengdong.lin@linux.intel.com>
|
|
Date: Wed, 18 Nov 2015 02:23:59 -0500
|
|
Subject: [PATCH] topology: Fix comparison of unsigned expression < 0
|
|
|
|
Fix gcc warning: comparison of unsigned expression < 0 is always false
|
|
[-Wtype-limits]
|
|
|
|
The ABI object channel->id is _le32 and is converted to host unsigned
|
|
integer. It cannot be < 0.
|
|
|
|
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
|
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
---
|
|
src/topology/channel.c | 6 ++++--
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/topology/channel.c b/src/topology/channel.c
|
|
index 9bc5d5a77c57..c2f1feadca9a 100644
|
|
--- a/src/topology/channel.c
|
|
+++ b/src/topology/channel.c
|
|
@@ -80,6 +80,7 @@ int tplg_parse_channel(snd_tplg_t *tplg,
|
|
snd_config_t *n;
|
|
struct snd_soc_tplg_channel *channel = private;
|
|
const char *id, *value;
|
|
+ int channel_id;
|
|
|
|
if (tplg->channel_idx >= SND_SOC_TPLG_MAX_CHAN)
|
|
return -EINVAL;
|
|
@@ -88,12 +89,13 @@ int tplg_parse_channel(snd_tplg_t *tplg,
|
|
snd_config_get_id(cfg, &id);
|
|
tplg_dbg("\tChannel %s at index %d\n", id, tplg->channel_idx);
|
|
|
|
- channel->id = lookup_channel(id);
|
|
- if (channel->id < 0) {
|
|
+ channel_id = lookup_channel(id);
|
|
+ if (channel_id < 0) {
|
|
SNDERR("error: invalid channel %s\n", id);
|
|
return -EINVAL;
|
|
}
|
|
|
|
+ channel->id = channel_id;
|
|
channel->size = sizeof(*channel);
|
|
tplg_dbg("\tChan %s = %d\n", id, channel->id);
|
|
|
|
--
|
|
2.7.0
|
|
|