ionic: Remove unnecessary ternary operator in ionic_debugfs_add_ident
Subsystems (3)
PATCH 1/1 ionic: Remove unnecessary ternary operator in ionic_debugfs_add_ident
clang warns:
../drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: warning:
expression result unused [-Wunused-value]
ionic, &identity_fops) ? 0 : -EOPNOTSUPP;
^~~~~~~~~~~1 warning generated.
The return value of debugfs_create_file does not need to be checked [1] and the function returns void so get rid of the ternary operator, it is unnecessary.
[1]: https://lore.kernel.org/linux-mm/[email protected]/
--- drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +1 -1
@@ -57,7 +57,7 @@ DEFINE_SHOW_ATTRIBUTE(identity);void ionic_debugfs_add_ident (struct ionic *ionic) {debugfs_create_file ("identity" ,0400 , ionic->dentry, - ionic, &identity_fops) ?0 : -EOPNOTSUPP ; + ionic, &identity_fops); }void ionic_debugfs_add_sizes (struct ionic *ionic)
Signature · 1 line
2.23.0
Quoted 12 lines · Nathan Chancellor
clang warns:
../drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: warning:
expression result unused [-Wunused-value]ionic, &identity_fops) ? 0 : -EOPNOTSUPP; ^~~~~~~~~~~1 warning generated.
The return value of
debugfs_create_filedoes not need to be checked [1] and the function returns void so get rid of the ternary operator, it is unnecessary.
Quoted 5 lines
[1]: https://lore.kernel.org/linux-mm/[email protected]/
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")Signed-off-by Nathan Chancellor <[email protected]>
Quoted 17 lines
--- drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +1
-1@@ -57,7 +57,7 @@ DEFINE_SHOW_ATTRIBUTE(identity);void ionic_debugfs_add_ident (struct ionic *ionic) {debugfs_create_file ("identity" ,0400 , ionic->dentry, - ionic, &identity_fops) ?0 : -EOPNOTSUPP ; + ionic, &identity_fops); }void ionic_debugfs_add_sizes (struct ionic *ionic)
Quoted 12 lines · Nathan Chancellor
clang warns:
../drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: warning:
expression result unused [-Wunused-value]ionic, &identity_fops) ? 0 : -EOPNOTSUPP; ^~~~~~~~~~~1 warning generated.
The return value of
debugfs_create_filedoes not need to be checked [1] and the function returns void so get rid of the ternary operator, it is unnecessary.
Quoted 8 lines
[1]: https://lore.kernel.org/linux-mm/[email protected]/
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Jakub Kicinski
AppliedQuoted 12 lines · Nathan Chancellor
clang warns:
../drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: warning:
expression result unused [-Wunused-value]ionic, &identity_fops) ? 0 : -EOPNOTSUPP; ^~~~~~~~~~~1 warning generated.
The return value of
debugfs_create_filedoes not need to be checked [1] and the function returns void so get rid of the ternary operator, it is unnecessary.
Quoted 5 lines
[1]: https://lore.kernel.org/linux-mm/[email protected]/
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")Signed-off-by Nathan Chancellor <[email protected]>
Applied, thank you!