From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 3B081569C for ; Tue, 8 Dec 2015 17:51:04 +0100 (CET) Received: by pfdd184 with SMTP id d184so14659822pfd.3 for ; Tue, 08 Dec 2015 08:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QcyyiJlDvYgS5Jz1HVw/gWypOkWkti1CkuqZ/uBnkQs=; b=t4wh7q3iVI/AZ3e4ZBFChkw9yENUEIMEBbr+Z/SGf1a9oIR2PiHLHOZLMP9YCXoV5s fxeDORN0P2XLasWbnYWauIVKTk/AljWLc5PKXG9kM7TVoh/HlgVqJeianmGpt3g2sLwx 5ruHqMsV0iIhCPUX4IBFNPohscyrK29CAAXtROjoTj7ivsXc+hLdSnVh5paGtJeSCXaz A+i65KuSNImG5IbYCvFRYtBl36rxy86H7hRlpVeVC/paXlWd9W3e2AQuOnewj3xr+So6 BwF/9qSiyyWElVQqn3BnC0xKF+6i2jDW90c6eiZVqeuldhwkxikknMR9QAAKE8suZkRw PGEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QcyyiJlDvYgS5Jz1HVw/gWypOkWkti1CkuqZ/uBnkQs=; b=URmlfNludVeYWqm6mAJv1WjuOmGpuZ1m4IVzYaSDr/yPzG9oXVMiGk93DGsbQloZof ZKTskIjmdOL2u5ball56tTAlZBstS+OuKajaGTuHZR7XpGgJNsFFs8f8FV6iHtJdq79X drcODFWdoUfcbogFodbG5OikZWi9n5SgCu9FefuWG0Vw0wPCiRZKssga5mGBRfYDtN1O m+fU4omSLlft6y3GHrUkvgdYWrMyJOH7ld/eWW7W2RM823ngDcmB/5wGvTLGgEJwBXCR vLD3n1trhRYezmoupSjQIrWu8+3J8R2ZzqbNC7Qlusuy1ljynW/P2se7xqSQ3HlXvro1 OKZQ== X-Gm-Message-State: ALoCoQmQdVvXK2ST4WLTVu3oHyKqKUakwSH8a5fs+rkTc60Pv4szunCnvDRmLKzp1eiwQPivwmcSGPQxA8YZvRFZdxf0LuyUwA== X-Received: by 10.98.15.193 with SMTP id 62mr6230715pfp.62.1449593463621; Tue, 08 Dec 2015 08:51:03 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id rz10sm5987206pac.29.2015.12.08.08.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 08:51:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Date: Tue, 8 Dec 2015 08:51:09 -0800 Message-Id: <1449593469-16954-3-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449593469-16954-1-git-send-email-stephen@networkplumber.org> References: <1449593469-16954-1-git-send-email-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 2/2] ethtool: fix dead code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 16:51:04 -0000 Remove dead code, and print better return for other errors. Signed-off-by: Stephen Hemminger *** CID 120411: Control flow issues (DEADCODE) /examples/ethtool/ethtool-app/ethapp.c: 484 in pcmd_macaddr_callback() 478 mac_addr.addr_bytes[4], 479 mac_addr.addr_bytes[5]); 480 return; 481 } 482 } 483 if (stat == 0) >>> CID 120411: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "return;". 484 return; 485 else if (stat == -ENOTSUP) 486 printf("Port %i: Operation not supported\n", params->port); 487 else 488 printf("Port %i: Error %i\n", params->port, stat); 489 } ** CID 120410: Error handling issues (CHECKED_RETURN) --- 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 57c584e..3863b02 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.1.4