• Paul Mackerras's avatar
    [PATCH] ppc64: clean up prom.c and related files · fe3a3a65
    Paul Mackerras authored
    Somebody back in the mists of time decided that call_prom and rtas_call
    should return longs even though both of those bits of firmware run in
    32-bit mode and produce a 32-bit result.  To make life more interesting,
    the 32-bit result gets zero-extended to 64 bits, which makes checking
    for a -1 return value more complicated than it should be.
    
    This patch changes call_prom and rtas_call to return an int, and makes
    the corresponding changes to use ints for the variables used to hold
    those return values. 
    
    While I was doing this I finally got annoyed enough with the strings of
    prom_print() and prom_print_hex() calls that we do to write a simple
    prom_printf.  I deliberately didn't use snprintf because the execution
    environment is weird at this point - we aren't running at the address we
    are linked at just yet - and I didn't want to inflict that on any code
    outside this file.  I also did a prom_debug() macro, which eliminated a
    few ifdefs. 
    
    There are also a bunch of other minor cleanups.  This patch makes very
    few algorithmic changes but does get rid of a lot of casts.  :)
    
    I have been running with this patch for a couple of weeks, and Anton has
    tested it too.
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    fe3a3a65
rtas.c 13 KB