Skip to content

Commit

Permalink
initramfs: avoid "label at end of compound statement" error
Browse files Browse the repository at this point in the history
Commit 17a9be3 ("initramfs: Always do fput() and load modules after
rootfs populate") introduced an error for the

    CONFIG_BLK_DEV_RAM=y

case, because even though the code looks fine, the compiler really wants
a statement after a label, or you'll get complaints:

  init/initramfs.c: In function 'populate_rootfs':
  init/initramfs.c:644:2: error: label at end of compound statement

That commit moved the subsequent statements to outside the compound
statement, leaving the label without any associated statements.

Reported-by: Jörg Otte <[email protected]>
Fixes: 17a9be3 ("initramfs: Always do fput() and load modules after rootfs populate")
Cc: Al Viro <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: [email protected]  # if 17a9be3 gets backported
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed May 6, 2017
1 parent 3ef2bc0 commit 394e4f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions init/initramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ static int __init populate_rootfs(void)
free_initrd();
}
done:
/* empty statement */;
#else
printk(KERN_INFO "Unpacking initramfs...\n");
err = unpack_to_rootfs((char *)initrd_start,
Expand Down

0 comments on commit 394e4f5

Please sign in to comment.