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]
Date:   Fri, 3 May 2019 19:14:21 -0400
From:   Vivien Didelot <vivien.didelot@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: refine SMI support

Hi Florian,

On Fri, 3 May 2019 16:01:38 -0700, Florian Fainelli <f.fainelli@...il.com> wrote:

> [snip]
> 
> >  	assert_reg_lock(chip);
> >  
> > -	err = mv88e6xxx_smi_read(chip, addr, reg, val);
> > +	if (chip->smi_ops)
> > +		err = chip->smi_ops->read(chip, addr, reg, val);
> > +	else
> 
> You might want to check for smi_ops && smi_ops->read here to be safe.
> You could also keep that code unchanged, and just make
> mv88e6xxx_smi_read() an inline helper within smi.h:
> 
> static inline int mv88e6xxx_smi_read(struct mv88e6xxx_chip *chip, int
> addr, int reg, int *val)
> {
> 	if (chip->smi_ops && chip->smi_ops->read)
> 		return chip->smi_ops->read(chip, addr, reg, val);
> 
> 	return -EOPNOTSUPP;
> }

I've written it that way to simplify the check for an alternative
mv88e6xxx_bus_ops pointer implemented in a future patch, but your approach
is simpler, let's make it inline for the moment.

I'll respin a v2 right away with the subject prefix this time ;-)

Thanks,
Vivien

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ