* [PATCH ipsec-next] xfrm: delete duplicated functions that calls same xfrm_api_check()
@ 2022-01-27 9:08 Leon Romanovsky
2022-02-01 7:07 ` Steffen Klassert
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2022-01-27 9:08 UTC (permalink / raw)
To: Steffen Klassert, Herbert Xu, David S . Miller
Cc: Leon Romanovsky, netdev, Shannon Nelson
From: Leon Romanovsky <leonro@nvidia.com>
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.
Fixes: 92a2320697f7 ("xfrm: check for xdo_dev_ops add and delete")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
net/xfrm/xfrm_device.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 3fa066419d37..36d6c1835844 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -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)
@@ -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:
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH ipsec-next] xfrm: delete duplicated functions that calls same xfrm_api_check()
2022-01-27 9:08 [PATCH ipsec-next] xfrm: delete duplicated functions that calls same xfrm_api_check() Leon Romanovsky
@ 2022-02-01 7:07 ` Steffen Klassert
2022-02-01 7:31 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Steffen Klassert @ 2022-02-01 7:07 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Herbert Xu, David S . Miller, Leon Romanovsky, netdev,
Shannon Nelson
On Thu, Jan 27, 2022 at 11:08:40AM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> 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.
>
> Fixes: 92a2320697f7 ("xfrm: check for xdo_dev_ops add and delete")
There was nothing broken here, just a suboptimal implementation.
So please remove the Fixes tag, otherwise it gets backported
without a need.
Thanks!
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> net/xfrm/xfrm_device.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
> index 3fa066419d37..36d6c1835844 100644
> --- a/net/xfrm/xfrm_device.c
> +++ b/net/xfrm/xfrm_device.c
> @@ -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)
> @@ -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:
> --
> 2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH ipsec-next] xfrm: delete duplicated functions that calls same xfrm_api_check()
2022-02-01 7:07 ` Steffen Klassert
@ 2022-02-01 7:31 ` Leon Romanovsky
0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2022-02-01 7:31 UTC (permalink / raw)
To: Steffen Klassert; +Cc: Herbert Xu, David S . Miller, netdev, Shannon Nelson
On Tue, Feb 01, 2022 at 08:07:01AM +0100, Steffen Klassert wrote:
> On Thu, Jan 27, 2022 at 11:08:40AM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> >
> > 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.
> >
> > Fixes: 92a2320697f7 ("xfrm: check for xdo_dev_ops add and delete")
>
> There was nothing broken here, just a suboptimal implementation.
> So please remove the Fixes tag, otherwise it gets backported
> without a need.
No problem, I will remove.
>
> Thanks!
>
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > ---
> > net/xfrm/xfrm_device.c | 14 ++------------
> > 1 file changed, 2 insertions(+), 12 deletions(-)
> >
> > diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
> > index 3fa066419d37..36d6c1835844 100644
> > --- a/net/xfrm/xfrm_device.c
> > +++ b/net/xfrm/xfrm_device.c
> > @@ -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)
> > @@ -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:
> > --
> > 2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-01 7:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27 9:08 [PATCH ipsec-next] xfrm: delete duplicated functions that calls same xfrm_api_check() Leon Romanovsky
2022-02-01 7:07 ` Steffen Klassert
2022-02-01 7:31 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox