From: Nathan Chancellor <natechancellor@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: Remove ACPI table declaration
Date: Tue, 25 Sep 2018 23:44:37 -0700 [thread overview]
Message-ID: <20180926064437.GA29417@flashbox> (raw)
In-Reply-To: <20180926062245.GA5937@kroah.com>
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 <natechancellor@gmail.com>
> > ---
> > 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?
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.
> Not good :(
>
> I think you need to fix up your scripts, this is valid code...
>
No scripts here, just a human interpreting warnings manually.
> greg k-h
Thanks for the review,
Nathan
next prev parent reply other threads:[~2018-09-26 6:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-26 5:39 [PATCH] staging: rtl8723bs: Remove ACPI table declaration Nathan Chancellor
2018-09-26 6:22 ` Greg Kroah-Hartman
2018-09-26 6:44 ` Nathan Chancellor [this message]
2018-09-26 6:49 ` Greg Kroah-Hartman
2018-09-26 6:59 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180926064437.GA29417@flashbox \
--to=natechancellor@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox