aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorWill Schmidt <will_schmidt@vnet.ibm.com>2007-03-12 15:21:16 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-27 07:13:21 -0400
commite7273d2a0841612794dff43328d461beee95c986 (patch)
treecdbe24a374ab9d6ca1cb32b961206922b786021c /arch
parent5dd60166c22dbbb7a8684c119d28cb88b6087784 (diff)
[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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/lparcfg.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index fc1f7a949b2b..c492cee90e0f 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -130,30 +130,31 @@ static int iseries_lparcfg_data(struct seq_file *m, void *v)
130/* 130/*
131 * Methods used to fetch LPAR data when running on a pSeries platform. 131 * Methods used to fetch LPAR data when running on a pSeries platform.
132 */ 132 */
133/* find a better place for this function... */
134static void log_plpar_hcall_return(unsigned long rc, char *tag) 133static void log_plpar_hcall_return(unsigned long rc, char *tag)
135{ 134{
136 if (rc == 0) /* success, return */ 135 switch(rc) {
136 case 0:
137 return; 137 return;
138/* check for null tag ? */ 138 case H_HARDWARE:
139 if (rc == H_HARDWARE) 139 printk(KERN_INFO "plpar-hcall (%s) "
140 printk(KERN_INFO 140 "Hardware fault\n", tag);
141 "plpar-hcall (%s) failed with hardware fault\n", tag); 141 return;
142 else if (rc == H_FUNCTION) 142 case H_FUNCTION:
143 printk(KERN_INFO 143 printk(KERN_INFO "plpar-hcall (%s) "
144 "plpar-hcall (%s) failed; function not allowed\n", tag); 144 "Function not allowed\n", tag);
145 else if (rc == H_AUTHORITY) 145 return;
146 printk(KERN_INFO 146 case H_AUTHORITY:
147 "plpar-hcall (%s) failed; not authorized to this" 147 printk(KERN_INFO "plpar-hcall (%s) "
148 " function\n", tag); 148 "Not authorized to this function\n", tag);
149 else if (rc == H_PARAMETER) 149 return;
150 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", 150 case H_PARAMETER:
151 tag); 151 printk(KERN_INFO "plpar-hcall (%s) "
152 else 152 "Bad parameter(s)\n",tag);
153 printk(KERN_INFO 153 return;
154 "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n", 154 default:
155 tag, rc); 155 printk(KERN_INFO "plpar-hcall (%s) "
156 156 "Unexpected rc(0x%lx)\n", tag, rc);
157 }
157} 158}
158 159
159/* 160/*