lkml.org 
[lkml]   [2015]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next v2 1/6] net: dsa: add port_fdb_dump function
From
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.


\
 
 \ /
  Last update: 2015-10-14 15:21    [W:0.044 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site