diff mbox series

ionic: remove useless return code

Message ID 20190918195745.2158829-1-arnd@arndb.de
State New
Headers show
Series ionic: remove useless return code | expand

Commit Message

Arnd Bergmann Sept. 18, 2019, 7:57 p.m. UTC
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.0

Comments

Shannon Nelson Sept. 18, 2019, 8:46 p.m. UTC | #1
On 9/18/19 12:57 PM, Arnd Bergmann wrote:
> 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")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>   drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> index 7afc4a365b75..bc03cecf80cc 100644

> --- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> +++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> @@ -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 
<natechancellor@gmail.com>

Either way,

Acked-by: Shannon Nelson <snelson@pensando.io>


sln
Jakub Kicinski Sept. 20, 2019, 12:21 a.m. UTC | #2
On Wed, 18 Sep 2019 13:46:34 -0700, Shannon Nelson wrote:
> On 9/18/19 12:57 PM, Arnd Bergmann wrote:

> > 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")

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > ---

> >   drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 2 +-

> >   1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> > index 7afc4a365b75..bc03cecf80cc 100644

> > --- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> > +++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

> > @@ -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 

> <natechancellor@gmail.com>


Yup, should be in the net tree now.

> Either way,

> 

> Acked-by: Shannon Nelson <snelson@pensando.io>


Thanks for quick reviews!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
index 7afc4a365b75..bc03cecf80cc 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
@@ -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)