]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 1 Jul 2024 07:39:36 +0000 (09:39 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 3 Jul 2024 20:43:40 +0000 (21:43 +0100)
Number of widgets in array passed to snd_soc_dapm_new_controls() cannot
be negative, so make it explicit by using 'unsigned int', just like
snd_soc_add_component_controls() is doing.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-4-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dapm.h
sound/soc/soc-dapm.c

index 667ecd4daa68b0b905df81060a76499fc3300825..12cd7b5a2202e0cc4548c3ce1579e9e2d4cca092 100644 (file)
@@ -457,7 +457,7 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
 int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *uncontrol);
 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
-       const struct snd_soc_dapm_widget *widget, int num);
+       const struct snd_soc_dapm_widget *widget, unsigned int num);
 struct snd_soc_dapm_widget *snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
                const struct snd_soc_dapm_widget *widget);
 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
index 16dad4a454434d8279dce9d6e6ad1cfd4e506151..32cc90d09bc2516097ac0fba622e5127d2e9b090 100644 (file)
@@ -3857,7 +3857,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_new_control);
  */
 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
        const struct snd_soc_dapm_widget *widget,
-       int num)
+       unsigned int num)
 {
        int i;
        int ret = 0;