Re: [PATCH net-next v6 03/10] net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct
From: Andrew Lunn
Date: Sat Apr 24 2021 - 11:43:25 EST
> static void ksz8_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt)
> {
> + struct ksz8 *ksz8 = dev->priv;
> + const u32 *masks = ksz8->masks;
> + const u8 *regs = ksz8->regs;
Reverse christmas tree.
> u16 ctrl_addr;
> u32 data;
> u8 check;
> @@ -150,6 +204,9 @@ static void ksz8_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt)
> static void ksz8_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
> u64 *dropped, u64 *cnt)
> {
> + struct ksz8 *ksz8 = dev->priv;
> + const u32 *masks = ksz8->masks;
> + const u8 *regs = ksz8->regs;
Reverse christmas tree.
> static void ksz8_w_table(struct ksz_device *dev, int table, u16 addr, u64 data)
> {
> + struct ksz8 *ksz8 = dev->priv;
> + const u8 *regs = ksz8->regs;
...
> static int ksz8_valid_dyn_entry(struct ksz_device *dev, u8 *data)
> {
> + struct ksz8 *ksz8 = dev->priv;
> + const u32 *masks = ksz8->masks;
> + const u8 *regs = ksz8->regs;
> int timeout = 100;
Please fix them all.
Once you have fixed them, you can add my Reviewed-by.
Andrew