Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1649006
| From | Jonathan Woithe <jwoithe@just42.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 5/8] platform/x86: fujitsu-laptop: track the last instantiated FUJ02E3 ACPI device |
| Date | 2017-05-24 02:00 +0200 |
| Message-ID | <tKrSx-2bI-3@gated-at.bofh.it> (permalink) |
| References | <tIKPE-7om-3@gated-at.bofh.it> <tIKPE-7om-5@gated-at.bofh.it> <tJIsp-5RN-1@gated-at.bofh.it> <tKpQL-KR-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, May 23, 2017 at 11:47:06PM +0200, Micha?? K??pie?? wrote:
> > On Fri, May 19, 2017 at 09:44:45AM +0200, Micha?? K??pie?? wrote:
> > > It is easier to simply store a module-wide
> > > pointer to the last (most likely only) FUJ02E3 ACPI device found, make
> > > the aforementioned API use it and cover our bases by warning the user if
> > > firmware exposes multiple FUJ02E3 ACPI devices.
> > > :
> > > @@ -788,6 +789,9 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
> > > if (!priv)
> > > return -ENOMEM;
> > >
> > > + WARN_ONCE(fext, "More than one FUJ02E3 ACPI device was found. Driver may not work as intended.");
> > > + fext = device;
> > > +
> > > fujitsu_laptop = priv;
> > > fujitsu_laptop->acpi_handle = device->handle;
> > > sprintf(acpi_device_name(device), "%s",
> >
> > I thought WARN_ONCE() printed the warning when it was encountered for the
> > first time and then suppressed it on all other occasions.
>
> Correct.
>
> > If this is true
> > then we'll get the warning even when there is only one FUJ02E3 in the
> > system. Am I missing something?
>
> Probably the fact that the first argument of the macro is a conditional
> expression ...
Ah (having now had an opportunity to look at the source of WARN_ONCE()),
it's tested within WARN_ONCE.
> ("fext" is functionally equivalent to "fext != NULL" in this case).
Indeed, by virtue of the test done in WARN_ONCE(). Ok, that makes sense.
Regards
jonathan
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 5/8] platform/x86: fujitsu-laptop: track the last instantiated FUJ02E3 ACPI device Michał Kępień <kernel@kempniu.pl> - 2017-05-19 09:50 +0200
Re: [PATCH v2 5/8] platform/x86: fujitsu-laptop: track the last instantiated FUJ02E3 ACPI device Jonathan Woithe <jwoithe@just42.net> - 2017-05-22 01:30 +0200
Re: [PATCH v2 5/8] platform/x86: fujitsu-laptop: track the last instantiated FUJ02E3 ACPI device Michał Kępień <kernel@kempniu.pl> - 2017-05-23 23:50 +0200
Re: [PATCH v2 5/8] platform/x86: fujitsu-laptop: track the last instantiated FUJ02E3 ACPI device Jonathan Woithe <jwoithe@just42.net> - 2017-05-24 02:00 +0200
csiph-web