Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

infiniband: ipoib: 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.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Greg Kroah-Hartman and committed by
Jason Gunthorpe
2e061c69 316bcda8

+4 -11
+2 -2
drivers/infiniband/ulp/ipoib/ipoib.h
··· 781 781 #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG 782 782 void ipoib_create_debug_files(struct net_device *dev); 783 783 void ipoib_delete_debug_files(struct net_device *dev); 784 - int ipoib_register_debugfs(void); 784 + void ipoib_register_debugfs(void); 785 785 void ipoib_unregister_debugfs(void); 786 786 #else 787 787 static inline void ipoib_create_debug_files(struct net_device *dev) { } 788 788 static inline void ipoib_delete_debug_files(struct net_device *dev) { } 789 - static inline int ipoib_register_debugfs(void) { return 0; } 789 + static inline void ipoib_register_debugfs(void) { } 790 790 static inline void ipoib_unregister_debugfs(void) { } 791 791 #endif 792 792
+1 -6
drivers/infiniband/ulp/ipoib/ipoib_fs.c
··· 267 267 snprintf(name, sizeof(name), "%s_mcg", dev->name); 268 268 priv->mcg_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, 269 269 ipoib_root, dev, &ipoib_mcg_fops); 270 - if (!priv->mcg_dentry) 271 - ipoib_warn(priv, "failed to create mcg debug file\n"); 272 270 273 271 snprintf(name, sizeof(name), "%s_path", dev->name); 274 272 priv->path_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, 275 273 ipoib_root, dev, &ipoib_path_fops); 276 - if (!priv->path_dentry) 277 - ipoib_warn(priv, "failed to create path debug file\n"); 278 274 } 279 275 280 276 void ipoib_delete_debug_files(struct net_device *dev) ··· 282 286 priv->mcg_dentry = priv->path_dentry = NULL; 283 287 } 284 288 285 - int ipoib_register_debugfs(void) 289 + void ipoib_register_debugfs(void) 286 290 { 287 291 ipoib_root = debugfs_create_dir("ipoib", NULL); 288 - return ipoib_root ? 0 : -ENOMEM; 289 292 } 290 293 291 294 void ipoib_unregister_debugfs(void)
+1 -3
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 2577 2577 */ 2578 2578 BUILD_BUG_ON(IPOIB_CM_COPYBREAK > IPOIB_CM_HEAD_SIZE); 2579 2579 2580 - ret = ipoib_register_debugfs(); 2581 - if (ret) 2582 - return ret; 2580 + ipoib_register_debugfs(); 2583 2581 2584 2582 /* 2585 2583 * We create a global workqueue here that is used for all flush