examples/ethtool: remove dead code
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 8 Dec 2015 16:51:09 +0000 (08:51 -0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 9 Dec 2015 21:02:33 +0000 (22:02 +0100)
Remove dead code, and print better return for other errors.

>>>     CID 120411:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "return;".

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Remy Horton <remy.horton@intel.com>
examples/ethtool/ethtool-app/ethapp.c

index 57c584e..3863b02 100644 (file)
@@ -480,12 +480,9 @@ pcmd_macaddr_callback(void *ptr_params,
                        return;
                }
        }
-       if (stat == 0)
-               return;
-       else if (stat == -ENOTSUP)
-               printf("Port %i: Operation not supported\n", params->port);
-       else
-               printf("Port %i: Error %i\n", params->port, stat);
+
+       printf("Port %i: Error %s\n", params->port,
+              strerror(-stat));
 }
 
 static void