[Patch] kexec: remove redundant if-else

From: WANG Cong
Date: Fri Jul 18 2008 - 11:06:44 EST



These if-else's can be removed.

Signed-off-by: WANG Cong <wangcong@xxxxxxxxx>
Cc: ebiederm@xxxxxxxxxxxx

---
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 1c5fcac..ea6fa9b 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -203,13 +203,11 @@ static int do_kimage_alloc(struct kimage **rimage, unsigned long entry,
goto out;
}

- result = 0;
-out:
- if (result == 0)
- *rimage = image;
- else
- kfree(image);
+ *rimage = image;
+ return 0;

+out:
+ kfree(image);
return result;

}
@@ -242,13 +240,11 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry,
goto out;
}

- result = 0;
- out:
- if (result == 0)
- *rimage = image;
- else
- kfree(image);
+ *rimage = image;
+ return 0;

+ out:
+ kfree(image);
return result;
}

@@ -311,13 +307,11 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry,
goto out;
}

- result = 0;
-out:
- if (result == 0)
- *rimage = image;
- else
- kfree(image);
+ *rimage = image;
+ return 0;

+out:
+ kfree(image);
return result;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/