Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1246659

Re: [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function
Date 2015-10-14 15:00 +0200
Message-ID <qjtOW-7od-1@gated-at.bofh.it> (permalink)
References <qjaVX-3T8-3@gated-at.bofh.it> <qjaVY-3T8-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Tue, 13 Oct 2015 12:46:18 -0400

> @@ -198,7 +198,9 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
>  }
>  
>  struct switchdev_trans;
> +struct switchdev_obj;
>  struct switchdev_obj_port_fdb;
> +typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
>  
>  struct dsa_switch_driver {
>  	struct list_head	list;
 ...
> @@ -382,6 +382,9 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev,
>  	u16 vid = 0;
>  	int ret;
>  
> +	if (ds->drv->port_fdb_dump)
> +		return ds->drv->port_fdb_dump(ds, p->port, fdb, cb);
> +
>  	if (!ds->drv->port_fdb_getnext)

I realize you're fighting include file dependency issues, but this is
rediculous.  Now you're using two different typedefs for this callback
function pointer.

This is why typedef's suck.

We should just opencode "int (*cb)(struct switchdev_obj *)" everywhere
and kill these typedefs which are obviously just getting in the way
and making us do silly things.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next v2 0/6] net: dsa: implement port_fdb_dump in drivers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200
  [PATCH net-next v2 4/6] net: dsa: mv88e6xxx: implement port_fdb_dump Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200
    Re: [PATCH net-next v2 4/6] net: dsa: mv88e6xxx: implement port_fdb_dump Scott Feldman <sfeldma@gmail.com> - 2015-10-14 19:40 +0200
  [PATCH net-next v2 5/6] net: dsa: mv88e6xxx: remove port_fdb_getnext Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200
  [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200
    Re: [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function David Miller <davem@davemloft.net> - 2015-10-14 15:00 +0200
    Re: [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function Florian Fainelli <f.fainelli@gmail.com> - 2015-10-14 21:00 +0200
  [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: write VID outside of VTU Get Next code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-13 18:50 +0200

csiph-web