Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp739813imb; Fri, 1 Mar 2019 12:41:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwzlT6FrLnkatAhLu+TaQUPxVpKpqjOYrpI3cVFozMMswbugxHEMwkyBdlUBZBVfLXphRCB X-Received: by 2002:a17:902:822:: with SMTP id 31mr7452155plk.290.1551472903667; Fri, 01 Mar 2019 12:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551472903; cv=none; d=google.com; s=arc-20160816; b=gxxTa9/4/bWO98hKR6laW+2nMuX+JcuLxB1TLvlxheXYutbzRSCTfU9o4+GrtXakFW 2IrxxeStatMlH/COLHltg9F7xjdij4AQONlyYoPKlDMDxL7piM6VDxlp9LYgvrCRhvBj ZsXabd5hEDkF/YHN9ryv31/3i+CLVbAZoRmaLBF/BTwplRieZENX1dxUx/uyDZKIj39d bbpuLV6lv5+hZEPXjbjOt+j3XpfZlNw3ifBXvSjAvKEWO1jet9j3u7iQordyfeQZlRPY FuJoG0oi3ZoazFWQeops4k+AJEJRDYO5mQk5qwbLL9Cl1KknCIwgEQlyUwZilsKCNLEY QHgg== 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=SRWcj88p1bhZ5oCwJtTqHrrO423AqYapwwbmq3m2xYg=; b=zVrDFWqUht/EyeQzaZz+YMKBt8mpy9dP4JAF0axCZRWNT0mYG+nPbRFgN0V0oys668 v7J8sESFVv2x0J3B87BywUOKaBAdBNri+BTKXxtSimRouqsfpMa4KVYO23Z/248BlorZ bkwdJzB8OM0hpbaVuFijEDIZzTEVMfJ+DMfsbmZOznXLvCgBc5fdMtslNnXWWfXxwMLh qbpqTrKbfKlp6rpqUv7vF6L31HJdbSBO+9tGY+av8HhCnSTduewRxIO2OyVGR8pxyMGO WtH7ZYFwp6L1Rl3RpcWqBkfTH3myHDEXYTiET/yAsC5k/KjbLT8b87NaNmuR68LCFxg4 EO2w== 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 i1si3841217pfi.256.2019.03.01.12.41.28; Fri, 01 Mar 2019 12:41:43 -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 S1726437AbfCAUko (ORCPT + 99 others); Fri, 1 Mar 2019 15:40:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:42486 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725862AbfCAUko (ORCPT ); Fri, 1 Mar 2019 15:40:44 -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 32B2EB16F; Fri, 1 Mar 2019 20:40:43 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 7F883E00AD; Fri, 1 Mar 2019 21:40:42 +0100 (CET) Date: Fri, 1 Mar 2019 21:40:42 +0100 From: Michal Kubecek To: Nick Desaulniers Cc: netdev@vger.kernel.org, Nathan Chancellor , Sasha Neftin , Jeff Kirsher , Aaron Brown , intel-wired-lan@lists.osuosl.org, LKML Subject: Re: Clang warning in drivers/net/ethernet/intel/igc/igc_ethtool.c Message-ID: <20190301204042.GM29992@unicorn.suse.cz> References: <20190208050921.GA8758@archlinux-ryzen> <20190208143403.GD7035@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Mar 01, 2019 at 10:28:35AM -0800, Nick Desaulniers wrote: > On Fri, Feb 8, 2019 at 6:34 AM Michal Kubecek wrote: > > > > 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. > > So the variable declaration should get a `__unused` annotation then > (and maybe a comment)? I would rather suggest to add missing ethtool_ops handlers so that the flag can be actually shown and set using ethtool. Michal Kubecek