2018-09-08 14:08:56

by zhong jiang

[permalink] [raw]
Subject: [PATCH] xen-netback: remove unecessary condition check before debugfs_remove_recursive

debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just
remove the condition check before debugfs_remove_recursive.

Signed-off-by: zhong jiang <[email protected]>
---
drivers/net/xen-netback/netback.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 3621e05..80aae3a 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1660,8 +1660,7 @@ static int __init netback_init(void)
static void __exit netback_fini(void)
{
#ifdef CONFIG_DEBUG_FS
- if (!IS_ERR_OR_NULL(xen_netback_dbg_root))
- debugfs_remove_recursive(xen_netback_dbg_root);
+ debugfs_remove_recursive(xen_netback_dbg_root);
#endif /* CONFIG_DEBUG_FS */
xenvif_xenbus_fini();
}
--
1.7.12.4



2018-09-11 08:01:08

by Paul Durrant

[permalink] [raw]
Subject: RE: [PATCH] xen-netback: remove unecessary condition check before debugfs_remove_recursive

> -----Original Message-----
> From: zhong jiang [mailto:[email protected]]
> Sent: 08 September 2018 14:54
> To: [email protected]; Paul Durrant <[email protected]>; Wei Liu
> <[email protected]>
> Cc: [email protected]; [email protected]; linux-
> [email protected]
> Subject: [PATCH] xen-netback: remove unecessary condition check before
> debugfs_remove_recursive
>
> debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just
> remove the condition check before debugfs_remove_recursive.
>
> Signed-off-by: zhong jiang <[email protected]>

Reviewed-by: Paul Durrant <[email protected]>

> ---
> drivers/net/xen-netback/netback.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-
> netback/netback.c
> index 3621e05..80aae3a 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -1660,8 +1660,7 @@ static int __init netback_init(void)
> static void __exit netback_fini(void)
> {
> #ifdef CONFIG_DEBUG_FS
> - if (!IS_ERR_OR_NULL(xen_netback_dbg_root))
> - debugfs_remove_recursive(xen_netback_dbg_root);
> + debugfs_remove_recursive(xen_netback_dbg_root);
> #endif /* CONFIG_DEBUG_FS */
> xenvif_xenbus_fini();
> }
> --
> 1.7.12.4


2018-09-12 06:02:51

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] xen-netback: remove unecessary condition check before debugfs_remove_recursive

From: zhong jiang <[email protected]>
Date: Sat, 8 Sep 2018 21:53:42 +0800

> debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just
> remove the condition check before debugfs_remove_recursive.
>
> Signed-off-by: zhong jiang <[email protected]>

Applied to net-next.