From patchwork Tue Sep 14 11:27:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12492795 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6F99C433EF for ; Tue, 14 Sep 2021 11:28:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CF77610E6 for ; Tue, 14 Sep 2021 11:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232227AbhINL3f (ORCPT ); Tue, 14 Sep 2021 07:29:35 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:45587 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232187AbhINL3a (ORCPT ); Tue, 14 Sep 2021 07:29:30 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id CA9865805A9; Tue, 14 Sep 2021 07:28:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 14 Sep 2021 07:28:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Y2MBCAQ2jQEtDQ0uaBisEZ1yTBQijJXAFFk/J1keLdM=; b=TcdhUgun sao8WhZwwD5LUlgKT9X4oKHREUfEp1A4XI/rnhXGRW7Y0dFp7dy67z8C6SgUVJ02 67bCusdBUYooFUjDq9NJZBRiNFb8PYU7ZT7TKqOMZaWaRIHO4S68XN120E2KDgjL /NMQ8VvRJewwNnnlI17T2DaCHl5kabxl8offNgbuxExMp5T2JmedNuuwKtLhJDfu SP4/XtjeWy7SEkFC2MFxstJ0DCULgdloCV+Xk4ZKNrBxwQ1OTIg2bI67TBfsI3Mr VbUekqv+mHHPnoCQs28XPwbJBvh66sJOcA7O/1vBIjzBhB4ZOshaEgfHNnZ4pVIt jXwg11dZYEfCZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegledgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Sep 2021 07:28:10 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, kuba@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, vadimp@nvidia.com, mlxsw@nvidia.com, vladyslavt@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, Ido Schimmel Subject: [PATCH ethtool 5/5] netlink: eeprom: Fix compilation when pretty dump is disabled Date: Tue, 14 Sep 2021 14:27:38 +0300 Message-Id: <20210914112738.358627-6-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914112738.358627-1-idosch@idosch.org> References: <20210914112738.358627-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel When pretty dump is disabled (i.e., configure --disable-pretty-dump), the following errors are emitted: /usr/bin/ld: netlink/module-eeprom.o: in function `decoder_print': netlink/module-eeprom.c:330: undefined reference to `sff8636_show_all_paged' netlink/module-eeprom.c:334: undefined reference to `cmis_show_all' netlink/module-eeprom.c:325: undefined reference to `sff8079_show_all' The else clause is unreachable when pretty dump is disabled, so wrap it with ifdef directive. This will be re-worked in future patches where the netlink code only queries the SFF-8024 Identifier Value and defers page requests to individual parsers. Signed-off-by: Ido Schimmel --- netlink/module-eeprom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c index e9a122df3259..48cd2cc55bee 100644 --- a/netlink/module-eeprom.c +++ b/netlink/module-eeprom.c @@ -275,6 +275,7 @@ static int page_fetch(struct nl_context *nlctx, const struct ethtool_module_eepr return nlsock_process_reply(nlsock, nomsg_reply_cb, NULL); } +#ifdef ETHTOOL_ENABLE_PRETTY_DUMP static int decoder_prefetch(struct nl_context *nlctx) { struct ethtool_module_eeprom *page_zero_lower = cache_get(0, 0, ETH_I2C_ADDRESS_LOW); @@ -338,6 +339,7 @@ static void decoder_print(void) break; } } +#endif int nl_getmodule(struct cmd_context *ctx) { @@ -414,10 +416,12 @@ int nl_getmodule(struct cmd_context *ctx) else dump_hex(stdout, eeprom_data, dump_length, request.offset); } else { +#ifdef ETHTOOL_ENABLE_PRETTY_DUMP ret = decoder_prefetch(nlctx); if (ret) goto cleanup; decoder_print(); +#endif } cleanup: