Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7273d2a0841612794dff43328d461beee95c986
Commit:     e7273d2a0841612794dff43328d461beee95c986
Parent:     5dd60166c22dbbb7a8684c119d28cb88b6087784
Author:     Will Schmidt <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 06:21:16 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 21:13:21 2007 +1000

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/lparcfg.c |   43 +++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index fc1f7a9..c492cee 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)
 /*
  * 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)
 {
-       if (rc == 0)            /* success, return */
+       switch(rc) {
+       case 0:
                return;
-/* check for null tag ? */
-       if (rc == H_HARDWARE)
-               printk(KERN_INFO
-                      "plpar-hcall (%s) failed with hardware fault\n", tag);
-       else if (rc == H_FUNCTION)
-               printk(KERN_INFO
-                      "plpar-hcall (%s) failed; function not allowed\n", tag);
-       else if (rc == H_AUTHORITY)
-               printk(KERN_INFO
-                      "plpar-hcall (%s) failed; not authorized to this"
-                      " function\n", tag);
-       else if (rc == H_PARAMETER)
-               printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
-                      tag);
-       else
-               printk(KERN_INFO
-                      "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n",
-                      tag, rc);
-
+       case H_HARDWARE:
+               printk(KERN_INFO "plpar-hcall (%s) "
+                               "Hardware fault\n", tag);
+               return;
+       case H_FUNCTION:
+               printk(KERN_INFO "plpar-hcall (%s) "
+                               "Function not allowed\n", tag);
+               return;
+       case H_AUTHORITY:
+               printk(KERN_INFO "plpar-hcall (%s) "
+                               "Not authorized to this function\n", tag);
+               return;
+       case H_PARAMETER:
+               printk(KERN_INFO "plpar-hcall (%s) "
+                               "Bad parameter(s)\n",tag);
+               return;
+       default:
+               printk(KERN_INFO "plpar-hcall (%s) "
+                               "Unexpected rc(0x%lx)\n", tag, rc);
+       }
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to