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: <7dbddf9f-f8fc-f223-7f94-1e1f6382bc7e@gmail.com>
Date:   Fri, 3 Dec 2021 16:46:20 +0200
From:   Péter Ujfalusi <peter.ujfalusi@...il.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Peter Ujfalusi <peter.ujfalusi@...com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary
 conditional



On 02/12/2021 22:56, Andy Shevchenko wrote:
> Instead of double validating of_node, return value of
> the boolean property directly.

Nice cleanup, thanks,
Acked-by: Peter Ujfalusi <peter.ujfalusi@...il.com>

> We can't remove ifdeffery, because in OF_GPIO=n cases
> it might bring unwanted surprises.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  sound/soc/ti/davinci-mcasp.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index 81c1ccec5904..3e105caac95e 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -1870,12 +1870,10 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
>  static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
>  {
>  #ifdef CONFIG_OF_GPIO
> -	if (mcasp->dev->of_node &&
> -	    of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
> -		return true;
> -#endif
> -
> +	return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
> +#else
>  	return false;
> +#endif
>  }
>  
>  static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
> 

-- 
Péter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ