batman-adv: no need to check return value of debugfs_create functions
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@neomailbox.ch> Cc: Simon Wunderlich <sw@simonwunderlich.de> Cc: Antonio Quartulli <a@unstable.cc> Cc: "David S. Miller" <davem@davemloft.net> Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [sven@narfation.org: drop unused variables] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
This commit is contained in:

committed by
Simon Wunderlich

parent
390dcd48cd
commit
3bcacd1e06
@@ -1951,34 +1951,19 @@ out:
|
||||
/**
|
||||
* batadv_nc_init_debugfs() - create nc folder and related files in debugfs
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
*
|
||||
* Return: 0 on success or negative error number in case of failure
|
||||
*/
|
||||
int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
void batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct dentry *nc_dir, *file;
|
||||
struct dentry *nc_dir;
|
||||
|
||||
nc_dir = debugfs_create_dir("nc", bat_priv->debug_dir);
|
||||
if (!nc_dir)
|
||||
goto out;
|
||||
|
||||
file = debugfs_create_u8("min_tq", 0644, nc_dir, &bat_priv->nc.min_tq);
|
||||
if (!file)
|
||||
goto out;
|
||||
debugfs_create_u8("min_tq", 0644, nc_dir, &bat_priv->nc.min_tq);
|
||||
|
||||
file = debugfs_create_u32("max_fwd_delay", 0644, nc_dir,
|
||||
&bat_priv->nc.max_fwd_delay);
|
||||
if (!file)
|
||||
goto out;
|
||||
debugfs_create_u32("max_fwd_delay", 0644, nc_dir,
|
||||
&bat_priv->nc.max_fwd_delay);
|
||||
|
||||
file = debugfs_create_u32("max_buffer_time", 0644, nc_dir,
|
||||
&bat_priv->nc.max_buffer_time);
|
||||
if (!file)
|
||||
goto out;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
return -ENOMEM;
|
||||
debugfs_create_u32("max_buffer_time", 0644, nc_dir,
|
||||
&bat_priv->nc.max_buffer_time);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user