diff mbox

[v7,05/18] ACPI: Correct return value of acpi_dev_resource_address_space()

Message ID 1414387308-27148-6-git-send-email-jiang.liu@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Jiang Liu Oct. 27, 2014, 5:21 a.m. UTC
Change acpi_dev_resource_address_space() to return failure if the
acpi_resource structure can't be converted to an ACPI address64
structure, so caller could correctly detect failure.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 drivers/acpi/resource.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki Oct. 27, 2014, 10:30 p.m. UTC | #1
On Monday, October 27, 2014 01:21:35 PM Jiang Liu wrote:
> Change acpi_dev_resource_address_space() to return failure if the
> acpi_resource structure can't be converted to an ACPI address64
> structure, so caller could correctly detect failure.
> 
> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>

ACK

> ---
>  drivers/acpi/resource.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index 2ba8f02ced36..782a0d15c25f 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -200,7 +200,7 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
>  
>  	status = acpi_resource_to_address64(ares, &addr);
>  	if (ACPI_FAILURE(status))
> -		return true;
> +		return false;
>  
>  	res->start = addr.minimum;
>  	res->end = addr.maximum;
>
Bjorn Helgaas Oct. 27, 2014, 10:49 p.m. UTC | #2
On Sun, Oct 26, 2014 at 11:21 PM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
> Change acpi_dev_resource_address_space() to return failure if the
> acpi_resource structure can't be converted to an ACPI address64
> structure, so caller could correctly detect failure.

Fixes: 046d9ce6820e ("ACPI: Move device resources interpretation code
from PNP to ACPI core")

Possible stable candidate?  046d9ce6820e appeared in v3.8.

> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
> ---
>  drivers/acpi/resource.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index 2ba8f02ced36..782a0d15c25f 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -200,7 +200,7 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
>
>         status = acpi_resource_to_address64(ares, &addr);
>         if (ACPI_FAILURE(status))
> -               return true;
> +               return false;
>
>         res->start = addr.minimum;
>         res->end = addr.maximum;
> --
> 1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Oct. 27, 2014, 11:11 p.m. UTC | #3
On Monday, October 27, 2014 04:49:06 PM Bjorn Helgaas wrote:
> On Sun, Oct 26, 2014 at 11:21 PM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
> > Change acpi_dev_resource_address_space() to return failure if the
> > acpi_resource structure can't be converted to an ACPI address64
> > structure, so caller could correctly detect failure.
> 
> Fixes: 046d9ce6820e ("ACPI: Move device resources interpretation code
> from PNP to ACPI core")
> 
> Possible stable candidate?  046d9ce6820e appeared in v3.8.

Well, are we seeing problems with it?

> > Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
> > ---
> >  drivers/acpi/resource.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> > index 2ba8f02ced36..782a0d15c25f 100644
> > --- a/drivers/acpi/resource.c
> > +++ b/drivers/acpi/resource.c
> > @@ -200,7 +200,7 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
> >
> >         status = acpi_resource_to_address64(ares, &addr);
> >         if (ACPI_FAILURE(status))
> > -               return true;
> > +               return false;
> >
> >         res->start = addr.minimum;
> >         res->end = addr.maximum;
> > --
> > 1.7.10.4
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Oct. 28, 2014, 1:13 a.m. UTC | #4
On Mon, Oct 27, 2014 at 5:11 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Monday, October 27, 2014 04:49:06 PM Bjorn Helgaas wrote:
>> On Sun, Oct 26, 2014 at 11:21 PM, Jiang Liu <jiang.liu@linux.intel.com> wrote:
>> > Change acpi_dev_resource_address_space() to return failure if the
>> > acpi_resource structure can't be converted to an ACPI address64
>> > structure, so caller could correctly detect failure.
>>
>> Fixes: 046d9ce6820e ("ACPI: Move device resources interpretation code
>> from PNP to ACPI core")
>>
>> Possible stable candidate?  046d9ce6820e appeared in v3.8.
>
> Well, are we seeing problems with it?

Not to my knowledge.  I only raised the possibility because it seems
like we are seeing more and more things backported to stable.  But if
we we're not seeing a problem, I agree we probably shouldn't push it.

>> > Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
>> > ---
>> >  drivers/acpi/resource.c |    2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
>> > index 2ba8f02ced36..782a0d15c25f 100644
>> > --- a/drivers/acpi/resource.c
>> > +++ b/drivers/acpi/resource.c
>> > @@ -200,7 +200,7 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
>> >
>> >         status = acpi_resource_to_address64(ares, &addr);
>> >         if (ACPI_FAILURE(status))
>> > -               return true;
>> > +               return false;
>> >
>> >         res->start = addr.minimum;
>> >         res->end = addr.maximum;
>> > --
>> > 1.7.10.4
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 2ba8f02ced36..782a0d15c25f 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -200,7 +200,7 @@  bool acpi_dev_resource_address_space(struct acpi_resource *ares,
 
 	status = acpi_resource_to_address64(ares, &addr);
 	if (ACPI_FAILURE(status))
-		return true;
+		return false;
 
 	res->start = addr.minimum;
 	res->end = addr.maximum;