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] [day] [month] [year] [list]
Date:   Fri, 18 Sep 2020 15:09:08 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>, Chris Healy <cphealy@...il.com>,
        Jiri Pirko <jiri@...dia.com>,
        Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH v3 net-next 7/9] net: dsa: mv88e6xxx: Add devlink regions

> > +static int mv88e6xxx_region_global_snapshot(struct devlink *dl,
> > +					    const struct devlink_region_ops *ops,
> > +					    struct netlink_ext_ack *extack,
> > +					    u8 **data)
> > +{
> > +	struct dsa_switch *ds = dsa_devlink_to_ds(dl);
> > +	struct mv88e6xxx_chip *chip = ds->priv;
> > +	u16 *registers;
> > +	int i, err;
> > +
> > +	registers = kmalloc_array(32, sizeof(u16), GFP_KERNEL);
> > +	if (!registers)
> > +		return -ENOMEM;
> > +
> > +	mv88e6xxx_reg_lock(chip);
> > +	for (i = 0; i < 32; i++) {
> > +		switch ((long)ops->priv) {
> > +		case 1:
> > +			err = mv88e6xxx_g1_read(chip, i, &registers[i]);
> > +			break;
> > +		case 2:
> > +			err = mv88e6xxx_g1_read(chip, i, &registers[i]);
> 
> Should this be mv88e6xxx_g2_read() here?

Doh! Thanks.

> Can you use the region IDs you defined above?

Yes. That would be more readable. I probably need to make ops->priv
point to a real structure, to avoid compiler warnings about down
sizing types on casts.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ