From 94cb97a03999dda5ccbc89b8f96c51bcfc677c5c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 8 Dec 2015 08:51:09 -0800 Subject: [PATCH] examples/ethtool: remove dead code 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 Acked-by: Remy Horton --- examples/ethtool/ethtool-app/ethapp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c index 57c584e90e..3863b02561 100644 --- a/examples/ethtool/ethtool-app/ethapp.c +++ b/examples/ethtool/ethtool-app/ethapp.c @@ -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 -- 2.20.1