lkml.org 
[lkml]   [2013]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] PCI: acpiphp: look _RMV method a bit deeper in the hierarhcy
On Tue, Jun 25, 2013 at 09:15:47PM +0300, Andy Shevchenko wrote:
> On Tue, Jun 25, 2013 at 7:22 PM, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
>
> > The acpiphp driver finds out whether the device is hotpluggable by checking
> > whether it has _RMV method behind it (and if it returns 1). However, at
> > least Acer Aspire S5 with Thunderbolt host router has this method placed
> > behind device called EPUP (endpoint upstream port?) and not directly behind
> > the root port as can be seen from the ASL code below:
>
> []
>
>
> > +static acpi_status pcihp_evaluate_rmv(acpi_handle handle, u32 lvl,
> > + void *context, void **return_not_used)
> > +{
> > + unsigned long long *removable = context;
> > + unsigned long long value;
> > + acpi_status status;
> > +
> > + status = acpi_evaluate_integer(handle, "_RMV", NULL, &value);
> > + if (ACPI_SUCCESS(status) && value) {
>
> So, there is a chance the caller gets back uninitialized *context.
> Let's assume that is by design.
>
> > + *removable = value;
> > + return AE_CTRL_TERMINATE;
> > + }
> > + return AE_OK;
> > +}
>
>
> > +static bool pcihp_is_removable(acpi_handle handle, size_t depth)
> > +{
> > + unsigned long long removable = 0;
> > + acpi_status status;
> > +
> > + status = pcihp_evaluate_rmv(handle, 0, &removable, NULL);
> > + if ((status == AE_CTRL_TERMINATE) && removable)
>
> Here you already have removable not equal zero.

Hmm, removable is initialized to zero just few lines above... Did I miss
something obvious?

> Internal braces could be removed, but it's up top you.

I'll remove them in the next revision.

Thanks.


\
 
 \ /
  Last update: 2013-06-25 20:41    [W:0.350 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site