Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1736636imj; Fri, 8 Feb 2019 06:34:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IbEwgpsq01p/Absm3kHcFOJnHSAimSXfrlUQN+ADtuhkOx96hXEStd9X3/S5kTbjAdiYDLl X-Received: by 2002:a63:f552:: with SMTP id e18mr10872600pgk.239.1549636473456; Fri, 08 Feb 2019 06:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549636473; cv=none; d=google.com; s=arc-20160816; b=NUoS8nxocs7gs/vCcaqhuuWKaD+Stu/fnn3KNZz/JKOtS6dVOZ9KVYmu60ZR61dH0Y cnIMh6MF84heb0xOatZzhVjaiOCuYGuqjNxPQuyKlTTEQFRc1CvpHgXe15RGCrbMzYxE hKZORBvdqgl/qCmg0VDCTOhertMaOxEj7xxcALvBSpLURQ2/XuPSoKOk4ZY+okWt0gwl afvFKfzjItSH3fFzI2jRQTkp0MkR1ombvYWblpXBNcAEmoC+hveXMtozGGF8+38d9U82 ADqMYoNutxW2VgLEFm/44MAmaL8DBQYnt25szG/ByVQQ0EFcgZcbdAI+y/PjJ0kfe23y IgJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NFd0C+cjWyDb2ApgiMxqw57pQ6Xt8SVdjs/E1uKXltw=; b=j0krdhbwq1loOpg/D+S84MsYQ9i2kVnr7pIOTL7rkhKDYCUb4d+pGQszIcKDWoMxAc DMVrW4TN+H2OCTa20ZapII3dHHJ1uYo3HLk5m0JdAnaTrBe0Om4zxKTJIlpiCx8LuihI yPD848ElIFiqQdFkzE1phA9/WsCPpSPRWa8cnDZf5UBEpnlRQkvGjwmYTMiVPsNV8kzh VMjAOKT4pNP3a9x2sjpL+3BvsjaLzrpwFi7agoqAofjgS3FDKS7ejlMje6bY30Tc/4p7 hQ/wcYV060joa5PsYK92VSms9DRdvwvgFAxaQNrYa0dG+cvY4oD1VWvxEPXDwNOCWXx6 0M6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e67si2320379pfa.15.2019.02.08.06.34.16; Fri, 08 Feb 2019 06:34:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727619AbfBHOeF (ORCPT + 99 others); Fri, 8 Feb 2019 09:34:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:51598 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726600AbfBHOeF (ORCPT ); Fri, 8 Feb 2019 09:34:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E3E96AE25; Fri, 8 Feb 2019 14:34:03 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 43F7CE0142; Fri, 8 Feb 2019 15:34:03 +0100 (CET) Date: Fri, 8 Feb 2019 15:34:03 +0100 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Nathan Chancellor , Sasha Neftin , Jeff Kirsher , Aaron Brown , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Nick Desaulniers Subject: Re: Clang warning in drivers/net/ethernet/intel/igc/igc_ethtool.c Message-ID: <20190208143403.GD7035@unicorn.suse.cz> References: <20190208050921.GA8758@archlinux-ryzen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208050921.GA8758@archlinux-ryzen> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 10:09:21PM -0700, Nathan Chancellor wrote: > Hi all, > > After commit 8c5ad0dae93c ("igc: Add ethtool support"), Clang warns: > > drivers/net/ethernet/intel/igc/igc_ethtool.c:9:19: warning: variable 'igc_priv_flags_strings' is not needed and will not be emitted [-Wunneeded-internal-declaration] > static const char igc_priv_flags_strings[][ETH_GSTRING_LEN] = { > ^ > 1 warning generated. > > igc_priv_flags_strings is only used in an ARRAY_SIZE macro, which is a > compile time evaluation, so no reference to it is being emitted in the > final assembly. Is it actually needed and was forgotten to be used > somewhere or could it be eliminated so that Clang no longer warns? That's because the driver provides get_priv_flags() and set_priv_flags() callbacks in its ethtool_ops to allow querying and setting legacy-rx private flag but it does not provide get_sset_count() and get_strings() to provide list of private flags to userspace ethtool. Michal Kubecek