Skip to content

Commit

Permalink
efi/printf: Drop %n format and L qualifier
Browse files Browse the repository at this point in the history
%n is unused and deprecated.

The L qualifer is parsed but not actually implemented.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Link: https://lore.kernel.org/r/20200518190716.751506-7-nivedita@alum.mit.edu
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
Arvind Sankar authored and Ard Biesheuvel committed May 19, 2020
1 parent bbf8e8b commit 29a2806
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/firmware/efi/libstub/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
int field_width; /* width of output field */
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier; /* 'h', 'l', or 'L' for integer fields */
int qualifier; /* 'h' or 'l' for integer fields */

for (str = buf; *fmt; ++fmt) {
if (*fmt != '%') {
Expand Down Expand Up @@ -188,7 +188,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)

/* get the conversion qualifier */
qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
if (*fmt == 'h' || *fmt == 'l') {
qualifier = *fmt;
++fmt;
}
Expand Down Expand Up @@ -229,16 +229,6 @@ int vsprintf(char *buf, const char *fmt, va_list args)
field_width, precision, flags);
continue;

case 'n':
if (qualifier == 'l') {
long *ip = va_arg(args, long *);
*ip = (str - buf);
} else {
int *ip = va_arg(args, int *);
*ip = (str - buf);
}
continue;

case '%':
*str++ = '%';
continue;
Expand Down

0 comments on commit 29a2806

Please sign in to comment.