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 <andriy.shevchenko@linux.intel.com> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Rob Herring <robh@kernel.org> Cc: Joe Perches <joe@perches.com> Cc: Grant Likely <grant.likely@arm.com> Link: https://lore.kernel.org/r/20200731180825.30575-2-andriy.shevchenko@linux.intel.com Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
1 parent b886690 commit 09ceb8d

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

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)