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: <20200416065014.7umocf2aohz6q2nn@pengutronix.de>
Date:   Thu, 16 Apr 2020 08:50:14 +0200
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Tang Bin <tangbin@...s.chinamobile.com>
Cc:     wsa@...-dreams.de, o.rempel@...gutronix.de, ardb@...nel.org,
        linux-i2c@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: drivers: Avoid unnecessary check inefm32_i2c_probe()

On Thu, Apr 16, 2020 at 09:30:22AM +0800, Tang Bin wrote:
> Hi Uwe:
> 
> On 2020/4/15 22:31, Uwe Kleine-König wrote:
> > Same things apply as in the previous patch. (space after punctuation,
> > Sob of sender should be last)
> I will notice this problem next time, thanks.
> > > ---
> > >   drivers/i2c/busses/i2c-efm32.c | 3 ---
> > >   1 file changed, 3 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/busses/i2c-efm32.c b/drivers/i2c/busses/i2c-efm32.c
> > > index 4de31fae7..4786ef6b2 100644
> > > --- a/drivers/i2c/busses/i2c-efm32.c
> > > +++ b/drivers/i2c/busses/i2c-efm32.c
> > > @@ -312,9 +312,6 @@ static int efm32_i2c_probe(struct platform_device *pdev)
> > >   	int ret;
> > >   	u32 clkdiv;
> > > -	if (!np)
> > > -		return -EINVAL;
> > > -
> > I don't care much about this change. While the statement that this
> > driver is only instantiated on dt platforms is probably right,
> > explicitly checking for it might still prevent surprises later, serves
> > as explicit statement for the driver reader that non-dt isn't supposed
> > to work and given that the check is cheap I tend slightly to just keep
> > it.
> > 
> In this driver, the function efm32_i2c_probe() can be triggered only if the
> platform_device and platform_driver matches,  and the matching condition is
> DTS. It's my opinion.

I admit I didn't recheck, but I think the driver will also be matched on
non-dt platforms that provide an "efm32-i2c" device.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ