HAL on OLPC (removing acpi, apm and pmu)

Johannes Berg johannes at sipsolutions.net
Sun Dec 10 11:48:08 PST 2006


On Sun, 2006-12-10 at 19:28 +0000, Richard Hughes wrote:

> Adding ugly ifdef's is never a thing I like doing to source-code, but
> for a trivial 12% space saving on embedded devices I think it's
> worthwhile.
> 
> Comments?

Wouldn't it make more sense to do a kernel-style ifdef where for example
acpi_synthesize_hotplug_events is a static inline returning 0 in the
non-ACPI case and similar? That'd get rid of at least all the ifdefs
that are sprinkled in the code with this. You could do that in the
respective header (acpi.h) and then unconditionally include that header
removing two ifdefs at once and excluding the code by not linking it
from the Makefile.

Same for apm_generate_remove_hotplug_event and family, let them simply
return NULL.

Yes, it'll make the code slightly larger than this because the compares
will still be compiled, but maybe that's worth it?

Just a thought.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/hal/attachments/20061210/2664b691/attachment.pgp


More information about the hal mailing list