Re: [1/2] ACPI: make _OSI strings static

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

 



On Tuesday 18 April 2006 16:29, Moore, Robert wrote:
> Actually, I find this even more readable:
> #define ACPI_NUM_OSI_STRINGS    ACPI_ARRAY_SIZE (acpi_valid_osi_strings)
> 
> and leave the existing code as: 
> for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) {

The typical Linux style is to use

    for (i = 0; i < ARRAY_SIZE(acpi_valid_osi_strings); i++) {

rather than

    for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) {

because you can easily verify the loop bounds without having
to look up ACPI_NUM_OSI_STRINGS, which is defined elsewhere.
But you have to use your own judgment.
-
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