Skip to contentSkip to conversation

ionic: remove useless return code

PATCH In review Arnd Bergmann 3 participants 3 messages Sep 18, 2019 – Sep 20, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ionic: remove useless return code

The debugfs function was apparently changed from returning an error code to a void return, but the return code left in place, causing a warning from clang:

drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: error: expression result unused [-Werror,-Wunused-value]

                            ionic, &identity_fops) ? 0 : -EOPNOTSUPP;
                                                         ^~~~~~~~~~~
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")
---
 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
index 7afc4a365b75..bc03cecf80cc 100644
@@ -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.20.0
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Arnd Bergmann

The debugfs function was apparently changed from returning an error code to a void return, but the return code left in place, causing a warning from clang:

drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: error: expression result unused [-Werror,-Wunused-value]

                             ionic, &identity_fops) ? 0 : -EOPNOTSUPP;
                                                          ^~~~~~~~~~~
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")
---
  drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +0 -0
index 7afc4a365b75..bc03cecf80cc 100644

drivers/net/ethernet/pensando/ionic/ionic_debugfs.c DEFINE_SHOW_ATTRIBUTE(identity); · line 63

Quoted 8 lines
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)

This has just recently been addressed by Nathan Chancellor <[email protected]>

Either way,

sln

#2 lore raw
Quoted 27 lines · Shannon Nelson
Quoted 26 lines · Arnd Bergmann

The debugfs function was apparently changed from returning an error code to a void return, but the return code left in place, causing a warning from clang:

drivers/net/ethernet/pensando/ionic/ionic_debugfs.c:60:37: error: expression result unused [-Werror,-Wunused-value]

                             ionic, &identity_fops) ? 0 : -EOPNOTSUPP;
                                                          ^~~~~~~~~~~
Fixes fbfb8031533c ("ionic: Add hardware init and device commands")
---
  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
index 7afc4a365b75..bc03cecf80cc 100644
@@ -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);
  }
 
Quoted 4 lines

drivers/net/ethernet/pensando/ionic/ionic_debugfs.c DEFINE_SHOW_ATTRIBUTE(identity); · line 63

Quoted 1 line
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +0 -0
  void ionic_debugfs_add_sizes(struct ionic *ionic)  

This has just recently been addressed by Nathan Chancellor <[email protected]>

Yup, should be in the net tree now.

Quoted 3 lines

Either way,

Thanks for quick reviews!