Skip to content

Commit

Permalink
xfrm: delete duplicated functions that calls same xfrm_api_check()
Browse files Browse the repository at this point in the history
The xfrm_dev_register() and xfrm_dev_feat_change() have same
implementation of one call to xfrm_api_check(). Instead of doing such
indirection, call to xfrm_api_check() directly and delete duplicated
functions.

Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
  • Loading branch information
rleon authored and klassert committed Feb 2, 2022
1 parent 000fe94 commit 2ecda18
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions net/xfrm/xfrm_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,6 @@ static int xfrm_api_check(struct net_device *dev)
return NOTIFY_DONE;
}

static int xfrm_dev_register(struct net_device *dev)
{
return xfrm_api_check(dev);
}

static int xfrm_dev_feat_change(struct net_device *dev)
{
return xfrm_api_check(dev);
}

static int xfrm_dev_down(struct net_device *dev)
{
if (dev->features & NETIF_F_HW_ESP)
Expand All @@ -404,10 +394,10 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void

switch (event) {
case NETDEV_REGISTER:
return xfrm_dev_register(dev);
return xfrm_api_check(dev);

case NETDEV_FEAT_CHANGE:
return xfrm_dev_feat_change(dev);
return xfrm_api_check(dev);

case NETDEV_DOWN:
case NETDEV_UNREGISTER:
Expand Down

0 comments on commit 2ecda18

Please sign in to comment.