From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7AC0F45AAF; Fri, 4 Oct 2024 18:25:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10B5F42E72; Fri, 4 Oct 2024 18:24:38 +0200 (CEST) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id B1E1542DE3 for ; Fri, 4 Oct 2024 18:24:32 +0200 (CEST) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7e6d04f74faso1971540a12.1 for ; Fri, 04 Oct 2024 09:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728059072; x=1728663872; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6DoWKsPawX0ADAsmdz5tNGJJfkkJV2pCzLGO3zRa2Y8=; b=cmXJI8bpk+p32VC98+OokIgsCnyIDUXgQIhJD+YoHLzMc75M6jxptGzqVfvw1xqnEg KLh/c7OABwOHwtk5NGLOMHqU3OcCEpnPkO6Njs5s8oC3dxm7wZCFsRGQMa21qfPAhj3A oPh6SoLiETZ4ptqdyQb85XMynSYJ1a/WG+gL+v19iITQ2ZlGgmB0RBMd/pzDvL7j4S0A IV0kzkmvFexFz/RhQ6wLYw9OXL7T7bV613PpEBEoW0Cc/lQDBaAOIu3EpGZQ8usac9cv VUawZ4Y8GMEBdnivMUPNHJSGD7j0wotTuBrwDnynksOM9Fey0tGlAoFCTVV34pBKsYdQ Os+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059072; x=1728663872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6DoWKsPawX0ADAsmdz5tNGJJfkkJV2pCzLGO3zRa2Y8=; b=bgrcRvxO8zGBUQAwNe2lbdH4BcQTmJdT0gMOQ1nrQlq1y5/u42F578FPwqMperC1On eChVBvDFHDUaPhwogK/fUSC50PfQQMbYRl+MoBR+nhvZ79T5Boj9516oaRxfnHrU6nKb A2pcRpEq4wRuZXFK2dO4XAo43B2v7RU57F+tA4AshujRQIfvjowoddMV8lesFhRRUWGF NAc/3KgP9WRnvb8B3IZoRdKXeh9yoM1AkMZZVUE4kXasZgcaYBMTgJBxd08qiSAU7NDT mEovoq/y6bPixPadxgbz13/b2hXi66RNTd9HtSbAqQ62uzTJx5fds+8OuULD0uxONVxt OQoQ== X-Gm-Message-State: AOJu0YzFZ8eoWcyHOMChcNkSGXsgXvhQSCJ1qC8eBp3Lh7UUSTzmBrwP 7woscrhMe+KTq3tstZz25pBzwHuXeE0wid5lgM62FFyTX9nupKNbe51q0+fhqPox80Ak0HuQWBd p2MUF+g== X-Google-Smtp-Source: AGHT+IFCX26j1BmrVee+0CFZANKRLPX+QIyxYBHVr5bEyTCT8utLfIdaHn5q+SpcEsicD4hFcm2GCA== X-Received: by 2002:a05:6a21:888c:b0:1d6:cbc2:135 with SMTP id adf61e73a8af0-1d6d3b0dc39mr9183889637.24.1728059071855; Fri, 04 Oct 2024 09:24:31 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f680d7a1sm139231a12.19.2024.10.04.09.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 09:24:31 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 04/10] examples/ethtool: handle devices without registers Date: Fri, 4 Oct 2024 09:21:51 -0700 Message-ID: <20241004162418.52940-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162418.52940-1-stephen@networkplumber.org> References: <20241004162418.52940-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If device does not support reading registers then call to rte_eth_dev_get_reg_info will return an error. This fixes compiler warning when warn unused result is set. Signed-off-by: Stephen Hemminger --- examples/ethtool/lib/rte_ethtool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index edc28d5c63..0b88a27e7d 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -53,10 +53,8 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) sizeof(drvinfo->bus_info)); memset(®_info, 0, sizeof(reg_info)); - rte_eth_dev_get_reg_info(port_id, ®_info); - n = reg_info.length; - if (n > 0) - drvinfo->regdump_len = n; + if (rte_eth_dev_get_reg_info(port_id, ®_info) == 0) + drvinfo->regdump_len = reg_info.length; else drvinfo->regdump_len = 0; -- 2.45.2