Skip to content

Commit 09ceb8d

Browse files
andy-shevsergey-senozhatsky
authored andcommitted
lib/vsprintf: Replace custom spec to print decimals with generic one
When printing phandle via %pOFp the custom spec is used. First of all, it has a SMALL flag which makes no sense for decimal numbers. Second, we have already default spec for decimal numbers. Use the latter in the %pOFp case as well. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Cc: Pantelis Antoniou <[email protected]> Cc: Rob Herring <[email protected]> Cc: Joe Perches <[email protected]> Cc: Grant Likely <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sergey Senozhatsky <[email protected]>
1 parent b886690 commit 09ceb8d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/vsprintf.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,12 +1979,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
19791979
char *buf_start = buf;
19801980
struct property *prop;
19811981
bool has_mult, pass;
1982-
static const struct printf_spec num_spec = {
1983-
.flags = SMALL,
1984-
.field_width = -1,
1985-
.precision = -1,
1986-
.base = 10,
1987-
};
19881982

19891983
struct printf_spec str_spec = spec;
19901984
str_spec.field_width = -1;
@@ -2024,7 +2018,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
20242018
str_spec.precision = precision;
20252019
break;
20262020
case 'p': /* phandle */
2027-
buf = number(buf, end, (unsigned int)dn->phandle, num_spec);
2021+
buf = number(buf, end, (unsigned int)dn->phandle, default_dec_spec);
20282022
break;
20292023
case 'P': /* path-spec */
20302024
p = fwnode_get_name(of_fwnode_handle(dn));

0 commit comments

Comments
 (0)