mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
i40e: 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. Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ecc5570751
commit
43c4eb0381
@ -1732,29 +1732,15 @@ static const struct file_operations i40e_dbg_netdev_ops_fops = {
|
||||
**/
|
||||
void i40e_dbg_pf_init(struct i40e_pf *pf)
|
||||
{
|
||||
struct dentry *pfile;
|
||||
const char *name = pci_name(pf->pdev);
|
||||
const struct device *dev = &pf->pdev->dev;
|
||||
|
||||
pf->i40e_dbg_pf = debugfs_create_dir(name, i40e_dbg_root);
|
||||
if (!pf->i40e_dbg_pf)
|
||||
return;
|
||||
|
||||
pfile = debugfs_create_file("command", 0600, pf->i40e_dbg_pf, pf,
|
||||
&i40e_dbg_command_fops);
|
||||
if (!pfile)
|
||||
goto create_failed;
|
||||
debugfs_create_file("command", 0600, pf->i40e_dbg_pf, pf,
|
||||
&i40e_dbg_command_fops);
|
||||
|
||||
pfile = debugfs_create_file("netdev_ops", 0600, pf->i40e_dbg_pf, pf,
|
||||
&i40e_dbg_netdev_ops_fops);
|
||||
if (!pfile)
|
||||
goto create_failed;
|
||||
|
||||
return;
|
||||
|
||||
create_failed:
|
||||
dev_info(dev, "debugfs dir/file for %s failed\n", name);
|
||||
debugfs_remove_recursive(pf->i40e_dbg_pf);
|
||||
debugfs_create_file("netdev_ops", 0600, pf->i40e_dbg_pf, pf,
|
||||
&i40e_dbg_netdev_ops_fops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user