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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALprXBZ+NmR8Y4sMkh4Y-N_FG+rGEOhUBVTKXRXNFp8H+f0btw@mail.gmail.com>
Date:   Fri, 30 Oct 2020 18:55:16 +0800
From:   Ajye Huang <ajye_huang@...pal.corp-partner.google.com>
To:     Tzung-Bi Shih <tzungbi@...gle.com>
Cc:     Ajye Huang <ajye.huang@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mark Brown <broonie@...nel.org>,
        Rohit kumar <rohitkr@...eaurora.org>,
        Banajit Goswami <bgoswami@...eaurora.org>,
        Patrick Lai <plai@...eaurora.org>,
        Srinivasa Rao Mandadapu <srivasam@...eaurora.org>,
        Srini Kandagatla <srinivas.kandagatla@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Cheng-Yi Chiang <cychiang@...omium.org>,
        Tzung-Bi Shih <tzungbi@...omium.org>,
        Douglas Anderson <dianders@...omium.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-arm-kernel@...ts.infradead.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        ALSA development <alsa-devel@...a-project.org>
Subject: Re: [PATCH v2 2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic

On Fri, Oct 30, 2020 at 5:23 PM Tzung-Bi Shih <tzungbi@...gle.com> wrote:
>
> On Fri, Oct 30, 2020 at 3:57 PM Ajye Huang <ajye.huang@...il.com> wrote:
> > +static struct gpio_desc *dmic_sel;
> > +static int dmic_switch;
>
> If you really need them, you should put them in struct sc7180_snd_data.
>
Thank you, I will do it.
> > +static int dmic_set(struct snd_kcontrol *kcontrol,
> > +                   struct snd_ctl_elem_value *ucontrol)
> > +{
> > +       if (dmic_sel) {
>
> if (IS_ERR(dmic_sel))
> But I think you don't need to check dmic_sel.  Suppose your _probe()
> already returned error, the code here shouldn't be called.
>
OK, I will remove the discriminant if (dmic_sel) {
> > +               dmic_switch = ucontrol->value.integer.value[0];
>
> Looks like it can be a local variable.  You don't need to save dmic_switch.
But dmic_get() will need dmic_switch, should i keep dmic_switch?
static int dmic_get(struct snd_kcontrol *kcontrol,
    struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.integer.value[0] = dmic_switch;
return 0;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ