Commit b47bea2b authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Jakub Kicinski

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/20150815160730.GB25186@kroah.com/

Fixes: fbfb8031 ("ionic: Add hardware init and device commands")
Link: https://github.com/ClangBuiltLinux/linux/issues/658Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Acked-by: default avatarShannon Nelson <snelson@pensando.io>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 280ceaed
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment