[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150908205841.GF29184@lunn.ch>
Date: Tue, 8 Sep 2015 22:58:41 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc: netdev@...r.kernel.org, Jiri Pirko <jiri@...nulli.us>,
Scott Feldman <sfeldma@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
kernel@...oirfairelinux.com
Subject: Re: [RFC PATCH net-next 1/3] net: switchdev: extract
switchdev_obj_vlan
> +/* SWITCHDEV_OBJ_PORT_VLAN */
> +struct switchdev_obj_vlan {
> + struct switchdev_obj obj; /* must be first */
> + u16 flags;
> + u16 vid_begin;
> + u16 vid_end;
> +};
I know you give a few examples for where this is done in network code,
but i think container_of() is used much more. You can then place the
struct switchdev_obj anywhere in the structure, and it will work.
#define to_switchdev_obj_vlan(o) container_of(o, struct switchdev_obj_vlan, obj)
Andrew
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists