* [PATCH] drivers/rtc:Fix the wrong format specifier
@ 2024-10-08 9:25 Zhu Jun
2024-10-08 9:54 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2024-10-08 9:25 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc, zhujun2, linux-kernel
The format specifier of "int" in sprintf() should be "%d", not
"%u".
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
drivers/rtc/rtc-rv3028.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index 2f001c59c61d..c79fad316119 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -162,7 +162,7 @@ static ssize_t timestamp0_count_show(struct device *dev,
if (ret)
return ret;
- return sprintf(buf, "%u\n", count);
+ return sprintf(buf, "%d\n", count);
};
static DEVICE_ATTR_RO(timestamp0_count);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/rtc:Fix the wrong format specifier
2024-10-08 9:25 [PATCH] drivers/rtc:Fix the wrong format specifier Zhu Jun
@ 2024-10-08 9:54 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2024-10-08 9:54 UTC (permalink / raw)
To: Zhu Jun; +Cc: linux-rtc, linux-kernel
Hello,
Please fix the subject line, it has to be in the subsystem style.
On 08/10/2024 02:25:17-0700, Zhu Jun wrote:
> The format specifier of "int" in sprintf() should be "%d", not
> "%u".
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> drivers/rtc/rtc-rv3028.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
> index 2f001c59c61d..c79fad316119 100644
> --- a/drivers/rtc/rtc-rv3028.c
> +++ b/drivers/rtc/rtc-rv3028.c
> @@ -162,7 +162,7 @@ static ssize_t timestamp0_count_show(struct device *dev,
> if (ret)
> return ret;
>
> - return sprintf(buf, "%u\n", count);
> + return sprintf(buf, "%d\n", count);
> };
>
> static DEVICE_ATTR_RO(timestamp0_count);
> --
> 2.17.1
>
>
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-08 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 9:25 [PATCH] drivers/rtc:Fix the wrong format specifier Zhu Jun
2024-10-08 9:54 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox