From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@barebox.org>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] clk: make use of %pC format specifier for printing name
Date: Tue, 10 Jun 2025 08:31:04 +0200 [thread overview]
Message-ID: <aEfRKL3id-cjl_2m@pengutronix.de> (raw)
In-Reply-To: <20250609063127.3165440-1-a.fatoum@barebox.org>
On Mon, Jun 09, 2025 at 08:31:27AM +0200, Ahmad Fatoum wrote:
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index ba87f6c210d2..b2eeb2702f3d 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -16,6 +16,7 @@
> #include <linux/string.h>
> #include <linux/ctype.h>
> #include <linux/math64.h>
> +#include <linux/clk.h>
> #include <malloc.h>
> #include <kallsyms.h>
> #include <wchar.h>
> @@ -310,7 +311,7 @@ char *ip4_addr_string(char *buf, const char *end, const u8 *addr, int field_widt
> }
>
> static
> -char *error_string(char *buf, const char *end, const u8 *errptr, int field_width,
> +char *error_string(char *buf, const char *end, const void *errptr, int field_width,
> int precision, int flags, const char *fmt)
> {
> if (!IS_ERR(errptr))
> @@ -477,6 +478,16 @@ char *device_node_string(char *buf, const char *end, const struct device_node *n
> precision, flags);
> }
>
> +static noinline_for_stack
> +char *clock(char *buf, const char *end, const struct clk *clk,
> + int field_width, int precision, int flags, const char *fmt)
> +{
> + if (IS_ERR_OR_NULL(clk))
> + return error_string(buf, end, clk, field_width, precision, flags, fmt);
> +
> + return string(buf, end, clk->name, field_width, precision, flags);
> +}
struct clk is declared inside #ifdef CONFIG_COMMON_CLK. Without some
ifdef here you'll likely hit compile errors.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-06-10 6:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 6:31 Ahmad Fatoum
2025-06-10 6:31 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aEfRKL3id-cjl_2m@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox