[POWERPC] Replace if-then-else with a switch statement
Convert a compound if-else blob to a switch statement. This better fits the kernel coding style. Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
5dd60166c2
commit
e7273d2a08
@@ -130,30 +130,31 @@ static int iseries_lparcfg_data(struct seq_file *m, void *v)
|
|||||||
/*
|
/*
|
||||||
* Methods used to fetch LPAR data when running on a pSeries platform.
|
* Methods used to fetch LPAR data when running on a pSeries platform.
|
||||||
*/
|
*/
|
||||||
/* find a better place for this function... */
|
|
||||||
static void log_plpar_hcall_return(unsigned long rc, char *tag)
|
static void log_plpar_hcall_return(unsigned long rc, char *tag)
|
||||||
{
|
{
|
||||||
if (rc == 0) /* success, return */
|
switch(rc) {
|
||||||
|
case 0:
|
||||||
return;
|
return;
|
||||||
/* check for null tag ? */
|
case H_HARDWARE:
|
||||||
if (rc == H_HARDWARE)
|
printk(KERN_INFO "plpar-hcall (%s) "
|
||||||
printk(KERN_INFO
|
"Hardware fault\n", tag);
|
||||||
"plpar-hcall (%s) failed with hardware fault\n", tag);
|
return;
|
||||||
else if (rc == H_FUNCTION)
|
case H_FUNCTION:
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO "plpar-hcall (%s) "
|
||||||
"plpar-hcall (%s) failed; function not allowed\n", tag);
|
"Function not allowed\n", tag);
|
||||||
else if (rc == H_AUTHORITY)
|
return;
|
||||||
printk(KERN_INFO
|
case H_AUTHORITY:
|
||||||
"plpar-hcall (%s) failed; not authorized to this"
|
printk(KERN_INFO "plpar-hcall (%s) "
|
||||||
" function\n", tag);
|
"Not authorized to this function\n", tag);
|
||||||
else if (rc == H_PARAMETER)
|
return;
|
||||||
printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
|
case H_PARAMETER:
|
||||||
tag);
|
printk(KERN_INFO "plpar-hcall (%s) "
|
||||||
else
|
"Bad parameter(s)\n",tag);
|
||||||
printk(KERN_INFO
|
return;
|
||||||
"plpar-hcall (%s) failed with unexpected rc(0x%lx)\n",
|
default:
|
||||||
tag, rc);
|
printk(KERN_INFO "plpar-hcall (%s) "
|
||||||
|
"Unexpected rc(0x%lx)\n", tag, rc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user