Skip to content

Commit 29a2806

Browse files
nivedita76ardbiesheuvel
authored andcommitted
efi/printf: Drop %n format and L qualifier
%n is unused and deprecated. The L qualifer is parsed but not actually implemented. Signed-off-by: Arvind Sankar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent bbf8e8b commit 29a2806

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/firmware/efi/libstub/vsprintf.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
127127
int field_width; /* width of output field */
128128
int precision; /* min. # of digits for integers; max
129129
number of chars for from string */
130-
int qualifier; /* 'h', 'l', or 'L' for integer fields */
130+
int qualifier; /* 'h' or 'l' for integer fields */
131131

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

189189
/* get the conversion qualifier */
190190
qualifier = -1;
191-
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
191+
if (*fmt == 'h' || *fmt == 'l') {
192192
qualifier = *fmt;
193193
++fmt;
194194
}
@@ -229,16 +229,6 @@ int vsprintf(char *buf, const char *fmt, va_list args)
229229
field_width, precision, flags);
230230
continue;
231231

232-
case 'n':
233-
if (qualifier == 'l') {
234-
long *ip = va_arg(args, long *);
235-
*ip = (str - buf);
236-
} else {
237-
int *ip = va_arg(args, int *);
238-
*ip = (str - buf);
239-
}
240-
continue;
241-
242232
case '%':
243233
*str++ = '%';
244234
continue;

0 commit comments

Comments
 (0)