lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXc8j14PwNnO2e3sPDCeS9fXx01qoMJHxWjxtuT3DrDNQ@mail.gmail.com>
Date: Tue, 18 Feb 2025 14:52:46 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: broonie@...nel.org, Martin Povišer <povik+lin@...ebit.org>
Cc: Liam Girdwood <lgirdwood@...il.com>, linux-sound@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: ops: Enforce platform maximum on initial value

Hi Mark, Martin,

On Sat, 8 Feb 2025 at 01:57, <broonie@...nel.org> wrote:
> From: Martin Povišer <povik+lin@...ebit.org>
>
> Lower the volume if it is violating the platform maximum at its initial
> value (i.e. at the time of the 'snd_soc_limit_volume' call).
>
> Signed-off-by: Martin Povišer <povik+lin@...ebit.org>
> [Cherry picked from the Asahi kernel with fixups -- broonie]
> Signed-off-by: Mark Brown <broonie@...nel.orG>

Thanks for your patch, which is now commit 783db6851c1821d8 ("ASoC:
ops: Enforce platform maximum on initial value") in linux-next/master
next-20250218 sound-asoc/for-next

> --- a/sound/soc/soc-ops.c
> +++ b/sound/soc/soc-ops.c
> @@ -640,6 +640,33 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
>  }
>  EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);
>
> +static int snd_soc_clip_to_platform_max(struct snd_kcontrol *kctl)
> +{
> +       struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value;
> +       struct snd_ctl_elem_value uctl;

sizeof(snd_ctl_elem_value) = 1224, causing:

    sound/soc/soc-ops.c:657:1: error: the frame size of 1232 bytes is
larger than 1024 bytes [-Werror=frame-larger-than=]

> +       int ret;
> +
> +       if (!mc->platform_max)
> +               return 0;
> +
> +       ret = kctl->get(kctl, &uctl);
> +       if (ret < 0)
> +               return ret;
> +
> +       if (uctl.value.integer.value[0] > mc->platform_max)
> +               uctl.value.integer.value[0] = mc->platform_max;
> +
> +       if (snd_soc_volsw_is_stereo(mc) &&
> +           uctl.value.integer.value[1] > mc->platform_max)
> +               uctl.value.integer.value[1] = mc->platform_max;
> +
> +       ret = kctl->put(kctl, &uctl);
> +       if (ret < 0)
> +               return ret;
> +
> +       return 0;
> +}
> +
>  /**
>   * snd_soc_limit_volume - Set new limit to an existing volume control.
>   *

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ