]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: Extract boilerplate around switchdev_port_obj_*()
authorPetr Machata <petrm@mellanox.com>
Wed, 30 May 2018 00:56:03 +0000 (02:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 May 2018 18:13:42 +0000 (14:13 -0400)
commitea5fc43f8caf32b000b1b5530afdf8a18cee9f06
tree2e8a43ebe208fe6cfa5f1a1dd3fc8ec9b8480fed
parent5e76ac84d81f236e3d9883291cd7f1f1b7aabf90
net: bridge: Extract boilerplate around switchdev_port_obj_*()

A call to switchdev_port_obj_add() or switchdev_port_obj_del() involves
initializing a struct switchdev_obj_port_vlan, a piece of code that
repeats on each call site almost verbatim. While in the current codebase
there is just one duplicated add call, the follow-up patches add more of
both add and del calls.

Thus to remove the duplication, extract the repetition into named
functions and reuse.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_private.h
net/bridge/br_switchdev.c
net/bridge/br_vlan.c