Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705AbdI0Mip (ORCPT ); Wed, 27 Sep 2017 08:38:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37666 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbdI0Mio (ORCPT ); Wed, 27 Sep 2017 08:38:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D2E36272C0 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: unneeded internal declaration To: Nick Desaulniers , josh@joshtriplett.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: kay@vrfy.org, avi@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Paolo Bonzini Message-ID: <308883ad-e4e6-d2a9-7117-c45d524c04d0@redhat.com> Date: Wed, 27 Sep 2017 14:38:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 27 Sep 2017 12:38:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 794 Lines: 21 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