[haiku-commits] Re: r35889 - haiku/trunk/src/system/boot/platform/bios_ia32

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Mar 2010 13:25:21 +0100

stefano.ceccherini@xxxxxxxxx wrote:
>  
>  static acpi_descriptor_header *sAcpiRsdt; // System Description Table
> +static int32 sNumEntries = -1;
>  
> -
>  static status_t

Two blank lines.

> -     // Tried to keep numEntries a static variable; kept turning up 
> 0 on table
> -     // scan
> -     // TODO: This calculates numEntries for every acpi probe.
> -     int32 numEntries = (sAcpiRsdt->length - 
> sizeof(acpi_descriptor_header)) / 4;
> -     if (numEntries <= 0) {
> +     if (sNumEntries == -1)
> +             sNumEntries = (sAcpiRsdt->length - 
> sizeof(acpi_descriptor_header)) / 4;

I don't know how often the function is called, but unless its hundreds 
of times, this looks like a pretty superfluous optimization.

Bye,
   Axel.


Other related posts: