switchdev: don't use anonymous union on switchdev attr/obj structs
Older gcc versions (e.g. gcc version 4.4.6) don't like anonymous unions which was causing build issues on the newly added switchdev attr/obj structs. Fix this by using named union on structs. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Reported-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1f7bd29bc0
commit
42275bd8fc
7 changed files with 39 additions and 37 deletions
|
@ -353,7 +353,7 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
|
|||
switch (attr->id) {
|
||||
case SWITCHDEV_ATTR_PORT_STP_STATE:
|
||||
if (attr->trans == SWITCHDEV_TRANS_COMMIT)
|
||||
ret = dsa_slave_stp_update(dev, attr->stp_state);
|
||||
ret = dsa_slave_stp_update(dev, attr->u.stp_state);
|
||||
break;
|
||||
default:
|
||||
ret = -EOPNOTSUPP;
|
||||
|
@ -408,8 +408,8 @@ static int dsa_slave_port_attr_get(struct net_device *dev,
|
|||
|
||||
switch (attr->id) {
|
||||
case SWITCHDEV_ATTR_PORT_PARENT_ID:
|
||||
attr->ppid.id_len = sizeof(ds->index);
|
||||
memcpy(&attr->ppid.id, &ds->index, attr->ppid.id_len);
|
||||
attr->u.ppid.id_len = sizeof(ds->index);
|
||||
memcpy(&attr->u.ppid.id, &ds->index, attr->u.ppid.id_len);
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue