From 4dd886188a52b44a5805cdb2701b8671e4a6a246 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 10 May 2021 10:50:12 +1000 Subject: [PATCH] alsa: fix scan-build errors for unused variables All cases of value stored but never read --- spa/plugins/alsa/acp/alsa-mixer.c | 2 +- spa/plugins/alsa/alsa-acp-device.c | 10 +++++----- spa/plugins/alsa/alsa-pcm.c | 2 +- spa/plugins/alsa/alsa-udev.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spa/plugins/alsa/acp/alsa-mixer.c b/spa/plugins/alsa/acp/alsa-mixer.c index 9d41b1931..f581e71ba 100644 --- a/spa/plugins/alsa/acp/alsa-mixer.c +++ b/spa/plugins/alsa/acp/alsa-mixer.c @@ -5159,7 +5159,7 @@ void pa_alsa_profile_set_probe( pp += add_profiles_to_probe(pp, ps->profiles, false, false); pp += add_profiles_to_probe(pp, ps->profiles, false, true); pp += add_profiles_to_probe(pp, ps->profiles, true, false); - pp += add_profiles_to_probe(pp, ps->profiles, true, true); + add_profiles_to_probe(pp, ps->profiles, true, true); for (pp = probe_order; *pp; pp++) { uint32_t idx; diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c index fdeff9e86..ac26190e1 100644 --- a/spa/plugins/alsa/alsa-acp-device.c +++ b/spa/plugins/alsa/alsa-acp-device.c @@ -568,7 +568,7 @@ static int apply_device_props(struct impl *this, struct acp_device *dev, struct int changed = 0; float volumes[ACP_MAX_CHANNELS]; uint32_t channels[ACP_MAX_CHANNELS]; - uint32_t n_volumes = 0, n_channels = 0; + uint32_t n_volumes = 0; if (!spa_pod_is_object_type(props, SPA_TYPE_OBJECT_Props)) return -EINVAL; @@ -594,8 +594,8 @@ static int apply_device_props(struct impl *this, struct acp_device *dev, struct } break; case SPA_PROP_channelMap: - if ((n_channels = spa_pod_copy_array(&prop->value, SPA_TYPE_Id, - channels, ACP_MAX_CHANNELS)) > 0) { + if (spa_pod_copy_array(&prop->value, SPA_TYPE_Id, + channels, ACP_MAX_CHANNELS) > 0) { changed++; } break; @@ -634,7 +634,7 @@ static int impl_set_param(void *object, return res; } - res = acp_card_set_profile(this->card, id, save ? ACP_PROFILE_SAVE : 0); + acp_card_set_profile(this->card, id, save ? ACP_PROFILE_SAVE : 0); emit_info(this, false); break; } @@ -662,7 +662,7 @@ static int impl_set_param(void *object, return -EINVAL; dev = this->card->devices[device]; - res = acp_device_set_port(dev, id, save ? ACP_PORT_SAVE : 0); + acp_device_set_port(dev, id, save ? ACP_PORT_SAVE : 0); if (props) apply_device_props(this, dev, props); emit_info(this, false); diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index f398fe885..c11212ce5 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -488,7 +488,7 @@ skip_channels: fmt = spa_pod_builder_pop(&b, &f[0]); - if ((res = spa_pod_filter(&b, &result.param, fmt, filter)) < 0) + if (spa_pod_filter(&b, &result.param, fmt, filter) < 0) goto next; spa_node_emit_result(&state->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result); diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index e7a9e8c8b..b987ee393 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -141,7 +141,7 @@ static uint32_t get_card_id(struct impl *this, struct udev_device *dev) if ((str = udev_device_get_property_value(dev, "SOUND_CLASS")) && spa_streq(str, "modem")) return SPA_ID_INVALID; - if ((str = udev_device_get_property_value(dev, "SOUND_INITIALIZED")) == NULL) + if (udev_device_get_property_value(dev, "SOUND_INITIALIZED") == NULL) return SPA_ID_INVALID; if ((str = udev_device_get_property_value(dev, "DEVPATH")) == NULL)