Re: Propose WMI patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 30 September 2008 12:29:17 Duarte Silva wrote:
> For instance, it would be nice to be able to do this,
>
> for (i = 0; i < ARRAY_SIZE(laptop->methods); i++)
>         laptop->methods[i].status =
> wmi_is_guid_present(laptop->methods[i].guid);
>
> instead of
>
> for (i = 0; i < ARRAY_SIZE(laptop->methods); i++)
>         if (wmi_has_guid(laptop->methods[i].guid))
>                 laptop->methods[i].status = AE_OK;
>         else
>                 laptop->methods[i].status = AE_NOT_FOUND;

Why not just do:

for (i = 0; i < ARRAY_SIZE(laptop->methods); i++)
         laptop->methods[i].exists =
                 wmi_is_guid_present(laptop->methods[i].guid);

I don't see why you need an ACPI status here, when a simple bool will do just 
fine?

Otherwise, instead of being able to do this:

if (laptop->methods[i].exists) {
        /* do something */
}

you end up having to use one of the ACPI status wrappers all the time:

if (ACPI_SUCCESS(laptop->methods[i].status)) {
         /* do something */
}

-Carlos
-- 
E-Mail: carlos@xxxxxxxxxxxxxxxxxxx
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux