* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-01 20:20 Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-02-01 20:20 UTC (permalink / raw)
To: dmaengine, Rafael J . Wysocki, linux-acpi
Cc: Andy Shevchenko, Sinan Kaya, Sakari Ailus, Vinod Koul
As well as its sibling of_device_get_match_data() has no such checks,
no need to do it in acpi_get_match_data().
First of all, we are not supposed to call fwnode API like this without
driver attached.
Second, since __acpi_match_device() does check input parameter there is
no need to duplicate it outside.
Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data() function")
Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: rebase on top of new patches, rephrase commit message
drivers/acpi/bus.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f3a7c29e9190..413e4b1cb1be 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -791,12 +791,6 @@ void *acpi_get_match_data(const struct device *dev)
{
const struct acpi_device_id *match;
- if (!dev->driver)
- return NULL;
-
- if (!dev->driver->acpi_match_table)
- return NULL;
-
match = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!match)
return NULL;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-01 20:46 Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-02-01 20:46 UTC (permalink / raw)
To: dmaengine, Rafael J . Wysocki, linux-acpi
Cc: Sinan Kaya, Sakari Ailus, Vinod Koul
On Thu, 2018-02-01 at 22:20 +0200, Andy Shevchenko wrote:
> As well as its sibling of_device_get_match_data() has no such checks,
> no need to do it in acpi_get_match_data().
>
> First of all, we are not supposed to call fwnode API like this without
> driver attached.
>
> Second, since __acpi_match_device() does check input parameter there
> is
> no need to duplicate it outside.
>
> Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data()
> function")
> Cc: Sinan Kaya <okaya@codeaurora.org>
> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: rebase on top of new patches, rephrase commit message
> drivers/acpi/bus.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index f3a7c29e9190..413e4b1cb1be 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -791,12 +791,6 @@ void *acpi_get_match_data(const struct device
> *dev)
> {
> const struct acpi_device_id *match;
>
> - if (!dev->driver)
> - return NULL;
> -
> - if (!dev->driver->acpi_match_table)
> - return NULL;
> -
Perhaps I have to add that this conditional prevents
device_get_match_data() to work on PRP0001 devices AFAIU.
> match = acpi_match_device(dev->driver->acpi_match_table,
> dev);
> if (!match)
> return NULL;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-04 7:21 Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2018-02-04 7:21 UTC (permalink / raw)
To: Andy Shevchenko
Cc: dmaengine, Rafael J . Wysocki, ACPI Devel Maling List, Sinan Kaya,
Sakari Ailus, Vinod Koul
On Thu, Feb 1, 2018 at 9:46 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Thu, 2018-02-01 at 22:20 +0200, Andy Shevchenko wrote:
>> As well as its sibling of_device_get_match_data() has no such checks,
>> no need to do it in acpi_get_match_data().
>>
>> First of all, we are not supposed to call fwnode API like this without
>> driver attached.
>>
>> Second, since __acpi_match_device() does check input parameter there
>> is
>> no need to duplicate it outside.
>>
>> Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data()
>> function")
>> Cc: Sinan Kaya <okaya@codeaurora.org>
>> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
>> Cc: Vinod Koul <vinod.koul@intel.com>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> v2: rebase on top of new patches, rephrase commit message
>> drivers/acpi/bus.c | 6 ------
>> 1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
>> index f3a7c29e9190..413e4b1cb1be 100644
>> --- a/drivers/acpi/bus.c
>> +++ b/drivers/acpi/bus.c
>> @@ -791,12 +791,6 @@ void *acpi_get_match_data(const struct device
>> *dev)
>> {
>> const struct acpi_device_id *match;
>>
>> - if (!dev->driver)
>> - return NULL;
>> -
>
>> - if (!dev->driver->acpi_match_table)
>> - return NULL;
>> -
>
> Perhaps I have to add that this conditional prevents
> device_get_match_data() to work on PRP0001 devices AFAIU.
Yes, please.
I'm also not sure if the Fixes: tag is really applicable to this.
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-05 16:04 Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-02-05 16:04 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: dmaengine, Rafael J . Wysocki, ACPI Devel Maling List, Sinan Kaya,
Sakari Ailus, Vinod Koul
On Sun, 2018-02-04 at 08:21 +0100, Rafael J. Wysocki wrote:
> On Thu, Feb 1, 2018 at 9:46 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Thu, 2018-02-01 at 22:20 +0200, Andy Shevchenko wrote:
> > > As well as its sibling of_device_get_match_data() has no such
> > > checks,
> > > no need to do it in acpi_get_match_data().
> > >
> > > First of all, we are not supposed to call fwnode API like this
> > > without
> > > driver attached.
> > >
> > > Second, since __acpi_match_device() does check input parameter
> > > there
> > > is
> > > no need to duplicate it outside.
> > >
> > > Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data()
> > > function")
> > > Cc: Sinan Kaya <okaya@codeaurora.org>
> > > Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > Cc: Vinod Koul <vinod.koul@intel.com>
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > >
> > rhaps I have to add that this conditional prevents
> > device_get_match_data() to work on PRP0001 devices AFAIU.
>
> Yes, please.
OK.
> I'm also not sure if the Fixes: tag is really applicable to this.
We can of course drop it, I put it here in a hope that this series would
be material to v4.16-rc2 to fix an introduced API.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-05 16:54 Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2018-02-05 16:54 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, dmaengine, ACPI Devel Maling List, Sinan Kaya,
Sakari Ailus, Vinod Koul
On Monday, February 5, 2018 5:04:22 PM CET Andy Shevchenko wrote:
> On Sun, 2018-02-04 at 08:21 +0100, Rafael J. Wysocki wrote:
> > On Thu, Feb 1, 2018 at 9:46 PM, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Thu, 2018-02-01 at 22:20 +0200, Andy Shevchenko wrote:
> > > > As well as its sibling of_device_get_match_data() has no such
> > > > checks,
> > > > no need to do it in acpi_get_match_data().
> > > >
> > > > First of all, we are not supposed to call fwnode API like this
> > > > without
> > > > driver attached.
> > > >
> > > > Second, since __acpi_match_device() does check input parameter
> > > > there
> > > > is
> > > > no need to duplicate it outside.
> > > >
> > > > Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data()
> > > > function")
> > > > Cc: Sinan Kaya <okaya@codeaurora.org>
> > > > Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
> > > > Cc: Vinod Koul <vinod.koul@intel.com>
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > >
>
> > > rhaps I have to add that this conditional prevents
> > > device_get_match_data() to work on PRP0001 devices AFAIU.
> >
> > Yes, please.
>
> OK.
>
> > I'm also not sure if the Fixes: tag is really applicable to this.
>
> We can of course drop it, I put it here in a hope that this series would
> be material to v4.16-rc2 to fix an introduced API.
I can still take it for -rc1 even if ready, these tags aren't necessary for that.
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-06 12:51 Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2018-02-06 12:51 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Rafael J. Wysocki, dmaengine, ACPI Devel Maling List, Sinan Kaya,
Sakari Ailus, Vinod Koul
On Mon, 2018-02-05 at 17:54 +0100, Rafael J. Wysocki wrote:
> On Monday, February 5, 2018 5:04:22 PM CET Andy Shevchenko wrote:
> > On Sun, 2018-02-04 at 08:21 +0100, Rafael J. Wysocki wrote:
> > > On Thu, Feb 1, 2018 at 9:46 PM, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > I'm also not sure if the Fixes: tag is really applicable to this.
> >
> > We can of course drop it, I put it here in a hope that this series
> > would
> > be material to v4.16-rc2 to fix an introduced API.
>
> I can still take it for -rc1 even if ready, these tags aren't
> necessary for that.
Noted.
I'll remove tags and resend.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-06 12:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 16:04 [v2,3/6] ACPI / bus: Remove checks in acpi_get_match_data() Andy Shevchenko
-- strict thread matches above, loose matches on Subject: below --
2018-02-06 12:51 Andy Shevchenko
2018-02-05 16:54 Rafael J. Wysocki
2018-02-04 7:21 Rafael J. Wysocki
2018-02-01 20:46 Andy Shevchenko
2018-02-01 20:20 Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).