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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZR7fXpps3V2mmiMf@ashyti-mobl2.lan>
Date:   Thu, 5 Oct 2023 18:07:58 +0200
From:   Andi Shyti <andi.shyti@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Andi Shyti <andi.shyti@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
        Al Cooper <alcooperx@...il.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH v2 1/1] serial: 8250_bcm7271: Use
 devm_clk_get_optional_enabled()

Hi Andy,

On Thu, Oct 05, 2023 at 06:37:16PM +0300, Andy Shevchenko wrote:
> On Thu, Oct 05, 2023 at 05:19:38PM +0200, Andi Shyti wrote:
> 
> [...]
> 
> > > -	baud_mux_clk = devm_clk_get(dev, "sw_baud");
> > > -	if (IS_ERR(baud_mux_clk)) {
> > > -		if (PTR_ERR(baud_mux_clk) == -EPROBE_DEFER) {
> > > -			ret = -EPROBE_DEFER;
> > > -			goto release_dma;
> > > -		}
> > > -		dev_dbg(dev, "BAUD MUX clock not specified\n");
> > > -	} else {
> > > +	baud_mux_clk = devm_clk_get_optional_enabled(dev, "sw_baud");
> > > +	ret = PTR_ERR_OR_ZERO(baud_mux_clk);
> > > +	if (ret)
> > > +		goto release_dma;
> > > +	if (baud_mux_clk) {
> > >  		dev_dbg(dev, "BAUD MUX clock found\n");
> > > -		ret = clk_prepare_enable(baud_mux_clk);
> > > -		if (ret)
> > > -			goto release_dma;
> > > +
> > >  		priv->baud_mux_clk = baud_mux_clk;
> > >  		init_real_clk_rates(dev, priv);
> > >  		clk_rate = priv->default_mux_rate;
> > > +	} else {
> > > +		dev_dbg(dev, "BAUD MUX clock not specified\n");
> > 
> > little behavioral change here, but I don't think this is a
> > problem.
> 
> You meant that "if (!x) else" had been changed to "if (x) else" semantics?
> Otherwise I don't see any difference.

If devm_clk_get() fails with anything but -EPROBE_DEFER
originally the code was not returning, while now it returns.

But still... this is perfectly fine.

Andi

> > Reviewed-by: Andi Shyti <andi.shyti@...ux.intel.com>
> 
> Thank you!
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ