efi/printf: Factor out flags parsing and handle '%' earlier
authorArvind Sankar <nivedita@alum.mit.edu>
Mon, 18 May 2020 19:07:00 +0000 (15:07 -0400)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 19 May 2020 08:31:25 +0000 (10:31 +0200)
commit3b8350959cba0df4070741618e50c367319793bb
tree20848673ffad3046d8369a5edf11ab0ff742ec16
parentce5e3f909fc0ed67e58367b9c56a54c20a51080b
efi/printf: Factor out flags parsing and handle '%' earlier

Move flags parsing code out into a helper function.

The '%%' case can be handled up front: it is not allowed to have flags,
width etc.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Link: https://lore.kernel.org/r/20200518190716.751506-9-nivedita@alum.mit.edu
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/vsprintf.c