From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT 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 37500C43382 for ; Wed, 26 Sep 2018 06:49:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D9230208E4 for ; Wed, 26 Sep 2018 06:49:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9230208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbeIZNAn (ORCPT ); Wed, 26 Sep 2018 09:00:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52194 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbeIZNAm (ORCPT ); Wed, 26 Sep 2018 09:00:42 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 613A5102E; Wed, 26 Sep 2018 06:49:18 +0000 (UTC) Date: Wed, 26 Sep 2018 08:49:15 +0200 From: Greg Kroah-Hartman To: Nathan Chancellor Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: Remove ACPI table declaration Message-ID: <20180926064915.GA20241@kroah.com> References: <20180926053910.26833-1-natechancellor@gmail.com> <20180926062245.GA5937@kroah.com> <20180926064437.GA29417@flashbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180926064437.GA29417@flashbox> 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 Tue, Sep 25, 2018 at 11:44:37PM -0700, Nathan Chancellor wrote: > On Wed, Sep 26, 2018 at 08:22:45AM +0200, Greg Kroah-Hartman wrote: > > On Tue, Sep 25, 2018 at 10:39:10PM -0700, Nathan Chancellor wrote: > > > Clang warns that the acpi_id declaration is not going to be emitted > > > in the final assembly: > > > > > > drivers/staging/rtl8723bs/os_dep/sdio_intf.c:25:36: warning: variable > > > 'acpi_ids' is not needed and will not be emitted > > > [-Wunneeded-internal-declaration] > > > static const struct acpi_device_id acpi_ids[] = { > > > ^ > > > 1 warning generated. > > > > > > This is because it's marked as static const and it is not used anywhere > > > in this file. Doing a git grep on this driver for 'acpi' shows that this > > > declaration has been unused since the driver's initial induction. Remove > > > it since it's not doing anything. > > > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/169 > > > Signed-off-by: Nathan Chancellor > > > --- > > > drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 6 ------ > > > 1 file changed, 6 deletions(-) > > > > > > diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c > > > index 6d02904de63f..d473f9bd08c3 100644 > > > --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c > > > +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c > > > @@ -22,13 +22,7 @@ static const struct sdio_device_id sdio_ids[] = > > > { SDIO_DEVICE(0x024c, 0xb723), }, > > > { /* end: all zeroes */ }, > > > }; > > > -static const struct acpi_device_id acpi_ids[] = { > > > - {"OBDA8723", 0x0000}, > > > - {} > > > -}; > > > - > > > MODULE_DEVICE_TABLE(sdio, sdio_ids); > > > -MODULE_DEVICE_TABLE(acpi, acpi_ids); > > > > You just removed the ability for the driver to be automatically loaded > > if that acpi id is present. > > > > I am not sure I understand. Every instance of acpi_device_id that I > looked at in the kernel before sending this patch uses MODULE_DEVICE_TABLE > but then that acpi_device_id declaration is always used in the driver > definition either under the acpi_match_table member or ids member > depending on what type of driver it is. Should this one do that as well? I don't know, but it's not always necessary. > Is that even possible with an sdio driver? I apologize if I am not > making sense, I'm not super familiar with these interfaces. > > I also read 'Documentation/acpi/enumeration.txt' which makes it seem > like the declaration needs to be added to the device definition as well. If it is a real acpi driver, yes, you need to actually register it with the acpi core. But, if it is just using the auto-load functionality of "if this acpi string is found, load the module!" then the code is correct as-is. Yeah, it's a hack, but does work and helps out for auto-loading drivers for "odd" hardware that is not always self-describing. thanks, greg k-h