Make enter_rtas() take unsigned long arg
PATCH 1/1 Make enter_rtas() take unsigned long arg
We declare enter_rtas with a struct rtas_args * argument, though it is supposed to be a physical address, and then every time we call it we cast the unsigned long result from __pa() to a void *. This patch changes the declaration of enter_rtas to make it take an unsigned long argument, and removes the cast from all the callers. The actual enter_rtas() routine is in assembler and doesn't need to be changed.
Please apply.
Thanks,
Paul.
arch/ppc64/kernel/rtas.c +8 -8
@@ -79,7 +79,7 @@ args->rets = (rtas_arg_t *)&(args->args[1 ]); args->args[0 ] = (int )c; -enter_rtas ((void *)__pa ((unsigned long )args)); +enter_rtas (__pa (args));spin_unlock_irqrestore (&rtas.lock, s); }
@@ -115,9 +115,9 @@get_paca ()->xRtas = err_args;PPCDBG (PPCDBG_RTAS ,"\tentering rtas with 0x%lx\n" , - (void *)__pa ((unsigned long )&err_args)); -enter_rtas ((void *)__pa ((unsigned long )&get_paca ()->xRtas)); -PPCDBG (PPCDBG_RTAS ,"\treturned from rtas ...\n" ); +__pa (&err_args)); +enter_rtas (__pa (&get_paca ()->xRtas)); +PPCDBG (PPCDBG_RTAS ,"\treturned from rtas ...\n" ); err_args =get_paca ()->xRtas;get_paca ()->xRtas = temp_args;
@@ -174,8 +174,8 @@ rtas_args->rets[i] =0 ;PPCDBG (PPCDBG_RTAS ,"\tentering rtas with 0x%lx\n" , - (void *)__pa ((unsigned long )rtas_args)); -enter_rtas ((void *)__pa ((unsigned long )rtas_args)); +__pa (rtas_args)); +enter_rtas (__pa (rtas_args));PPCDBG (PPCDBG_RTAS ,"\treturned from rtas ...\n" );if (rtas_args->rets[0 ] ==-1 )
@@ -480,7 +480,7 @@spin_lock_irqsave (&rtas.lock, flags);get_paca ()->xRtas = args; -enter_rtas ((void *)__pa ((unsigned long )&get_paca ()->xRtas)); +enter_rtas (__pa (&get_paca ()->xRtas)); args =get_paca ()->xRtas;spin_unlock_irqrestore (&rtas.lock, flags);
@@ -515,7 +515,7 @@printk ("%u %u Ready to die...\n" ,smp_processor_id (),hard_smp_processor_id ()); -enter_rtas ((void *)__pa (rtas_args)); +enter_rtas (__pa (rtas_args));panic ("Alas, I survived.\n" ); }
include/asm-ppc64/rtas.h +1 -1
@@ -166,7 +166,7 @@extern struct rtas_t rtas; -extern void enter_rtas (struct rtas_args *); +extern void enter_rtas (unsigned long );extern int rtas_token (const char *service);extern long rtas_call (int token,int ,int ,unsigned long *, ...);extern void call_rtas_display_status (char );