[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2060405.LLBHa7GSGR@sven-edge>
Date: Fri, 14 Jun 2019 20:16:45 +0200
From: Sven Eckelmann <sven@...fation.org>
To: b.a.t.m.a.n@...ts.open-mesh.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Marek Lindner <mareklindner@...mailbox.ch>,
Simon Wunderlich <sw@...onwunderlich.de>,
Antonio Quartulli <a@...table.cc>, netdev@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] batman-adv: no need to check return value of debugfs_create functions
On Friday, 14 June 2019 09:11:23 CEST Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Because we don't care if debugfs works or not, this trickles back a bit
> so we can clean things up by making some functions return void instead
> of an error value that is never going to fail.
>
> Cc: Marek Lindner <mareklindner@...mailbox.ch>
> Cc: Simon Wunderlich <sw@...onwunderlich.de>
> Cc: Antonio Quartulli <a@...table.cc>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: b.a.t.m.a.n@...ts.open-mesh.org
> Cc: netdev@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
Applied with minor modifications
> /**
> @@ -333,42 +315,24 @@ void batadv_debugfs_destroy(void)
> * batadv_debugfs_add_hardif() - creates the base directory for a hard interface
> * in debugfs.
> * @hard_iface: hard interface which should be added.
> - *
> - * Return: 0 on success or negative error number in case of failure
> */
> -int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
> +void batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)
> {
> struct net *net = dev_net(hard_iface->net_dev);
> struct batadv_debuginfo **bat_debug;
> struct dentry *file;
The file variable should be removed here (it is now unused).
> @@ -421,42 +382,28 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
> struct net *net = dev_net(dev);
> struct dentry *file;
Same here
> --- a/net/batman-adv/log.c
> +++ b/net/batman-adv/log.c
> @@ -192,25 +192,16 @@ int batadv_debug_log_setup(struct batadv_priv *bat_priv)
> {
> struct dentry *d;
Same here
Thanks,
Sven
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists