On 4/6/07, Tim Dijkstra <[EMAIL PROTECTED]> wrote:
> A while back I proposed a patch to support powerpc. The comments where
> that it was a bit ugly with all those #ifdef's. Now the question is how
> do I do this neatly?
[...]
> I could solve this as Stefan suggested like this:
>
> #ifdef CONFIG_PPC
> int s2ram_hacks(void) return 0;
> #else
> int s2ram_hacks(void)
> {
> .
> }
> #end
>
> for a few functions. Still I would put a large part in #ifdef/#end
> blocks, just because it is not used. Also there will be some #ifdefs left
> in main.Looking at the older patch: - move PMU check into s2ram_is_supported, return error on failure - rename s2ram_do_pmu to s2ram_hacks (and maybe find a better name for both); this would be the hook for doing platform-specific black magic (PMU_IOC_SLEEP for PPC) - nop for s2ram_resume() - not sure about command line arguments... Then maybe split s2ram.c into s2ram, s2ram-x86.c and s2ram-ppc.c; this will ease the addition of a new platform. Luca ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Suspend-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/suspend-devel
