Skip to content

Commit

Permalink
[PATCH] initrd: remove unused false condition for initrd_start
Browse files Browse the repository at this point in the history
After LOADER_TYPE && INITRD_START are true, the short if-condition
for INITRD_START can never be false.

Remove unused code from the else condition.

Signed-off-by: Henry Nestler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
HenryNe authored and Linus Torvalds committed Dec 7, 2006
1 parent 319e799 commit 19e5d9c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion arch/frv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ static void __init setup_linux_memory(void)
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (low_top_pfn << PAGE_SHIFT)) {
reserve_bootmem(INITRD_START, INITRD_SIZE);
initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
initrd_start = INITRD_START + PAGE_OFFSET;
initrd_end = initrd_start + INITRD_SIZE;
}
else {
Expand Down
3 changes: 1 addition & 2 deletions arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,7 @@ void __init setup_bootmem_allocator(void)
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
reserve_bootmem(INITRD_START, INITRD_SIZE);
initrd_start =
INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
initrd_start = INITRD_START + PAGE_OFFSET;
initrd_end = initrd_start+INITRD_SIZE;
}
else {
Expand Down
4 changes: 1 addition & 3 deletions arch/m32r/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ static unsigned long __init setup_memory(void)
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
reserve_bootmem(INITRD_START, INITRD_SIZE);
initrd_start = INITRD_START ?
INITRD_START + PAGE_OFFSET : 0;

initrd_start = INITRD_START + PAGE_OFFSET;
initrd_end = initrd_start + INITRD_SIZE;
printk("initrd:start[%08lx],size[%08lx]\n",
initrd_start, INITRD_SIZE);
Expand Down
4 changes: 1 addition & 3 deletions arch/m32r/mm/discontig.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ unsigned long __init setup_memory(void)
if (INITRD_START + INITRD_SIZE <= PFN_PHYS(max_low_pfn)) {
reserve_bootmem_node(NODE_DATA(0), INITRD_START,
INITRD_SIZE);
initrd_start = INITRD_START ?
INITRD_START + PAGE_OFFSET : 0;

initrd_start = INITRD_START + PAGE_OFFSET;
initrd_end = initrd_start + INITRD_SIZE;
printk("initrd:start[%08lx],size[%08lx]\n",
initrd_start, INITRD_SIZE);
Expand Down
3 changes: 1 addition & 2 deletions arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ void __init setup_arch(char **cmdline_p)
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
reserve_bootmem_node(NODE_DATA(0), INITRD_START+__MEMORY_START, INITRD_SIZE);
initrd_start =
INITRD_START ? INITRD_START + PAGE_OFFSET + __MEMORY_START : 0;
initrd_start = INITRD_START + PAGE_OFFSET + __MEMORY_START;
initrd_end = initrd_start + INITRD_SIZE;
} else {
printk("initrd extends beyond end of memory "
Expand Down
4 changes: 1 addition & 3 deletions arch/sh64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ void __init setup_arch(char **cmdline_p)
if (INITRD_START + INITRD_SIZE <= (PFN_PHYS(last_pfn))) {
reserve_bootmem_node(NODE_DATA(0), INITRD_START + __MEMORY_START, INITRD_SIZE);

initrd_start =
(long) INITRD_START ? INITRD_START + PAGE_OFFSET + __MEMORY_START : 0;

initrd_start = (long) INITRD_START + PAGE_OFFSET + __MEMORY_START;
initrd_end = initrd_start + INITRD_SIZE;
} else {
printk("initrd extends beyond end of memory "
Expand Down
3 changes: 1 addition & 2 deletions arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,7 @@ void __init setup_arch(char **cmdline_p)
if (LOADER_TYPE && INITRD_START) {
if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) {
reserve_bootmem_generic(INITRD_START, INITRD_SIZE);
initrd_start =
INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
initrd_start = INITRD_START + PAGE_OFFSET;
initrd_end = initrd_start+INITRD_SIZE;
}
else {
Expand Down

0 comments on commit 19e5d9c

Please sign in to comment.