Subject: Re: [PATCH V4 net-next 4/4] net: marvell: prestera: implement software MDB entries allocation

From: Jakub Kicinski <[email-masked]>
Date: Fri, 8 Jul 2022 20:39:07 -0700

On Fri,  8 Jul 2022 20:43:24 +0300 Oleksandr Mazur wrote:
> +static int
> +prestera_mdb_port_addr_obj_add(const struct switchdev_obj_port_mdb *mdb);
> +static int
> +prestera_mdb_port_addr_obj_del(struct prestera_port *port,
> +			       const struct switchdev_obj_port_mdb *mdb);
> +
> +static void
> +prestera_mdb_flush_bridge_port(struct prestera_bridge_port *br_port);
> +static int
> +prestera_mdb_port_add(struct prestera_mdb_entry *br_mdb,
> +		      struct net_device *orig_dev,
> +		      const unsigned char addr[ETH_ALEN], u16 vid);
> +
> +static void
> +prestera_br_mdb_entry_put(struct prestera_br_mdb_entry *br_mdb_entry);
> +static int prestera_br_mdb_mc_enable_sync(struct prestera_bridge *br_dev);
> +static int prestera_br_mdb_sync(struct prestera_bridge *br_dev);
> +static int prestera_br_mdb_port_add(struct prestera_br_mdb_entry *br_mdb,
> +				    struct prestera_bridge_port *br_port);
> +static void
> +prestera_mdb_port_del(struct prestera_mdb_entry *mdb,
> +		      struct net_device *orig_dev);

No forward declarations in the kernel, unless the there is a circular
dependency. You should be able to just order the functions correctly.

> +	list_for_each_entry(br_mdb, &br_dev->br_mdb_entry_list,
> +			    br_mdb_entry_node)
> +		if ((err = prestera_mdb_enable_set(br_mdb, enable)))
> +			return err;

Like checkpatch says, no assignments in the if statements.