From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: unneeded internal declaration Date: Wed, 27 Sep 2017 14:38:33 +0200 Message-ID: <308883ad-e4e6-d2a9-7117-c45d524c04d0@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kay@vrfy.org, avi@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Nick Desaulniers , josh@joshtriplett.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 26/09/2017 05:07, Nick Desaulniers wrote: > today I noticed I was getting the warning: > > arch/x86/kvm/vmx.c:64:32: warning: variable 'vmx_cpu_id' is not needed > and will not be emitted [-Wunneeded-internal-declaration] > > seems like this was added in commit: e9bda3b3d0ce7 "KVM: VMX: > Auto-load on CPUs with VMX" > > seems like other call sites of the MODULE_DEVICE_TABLE typically get > added to an id_table of various driver structs. Should that be the > case here, or would a `__unused` modifier be a way forward (if so, > please confirm, would be a good first bug for a friend)? It would be __used, not __unused. But I'm not sure then why things are working for everyone, wouldn't the MODULE_DEVICE_TABLE cause a linking error? What compiler is emitting this warning? Paolo