From: Wim Van Sebroeck <wim@linux-watchdog.org>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: wim@linux-watchdog.org, linux@roeck-us.net,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/pcwd_pci:Fix the wrong format specifier
Date: Mon, 4 Nov 2024 14:59:02 +0100 [thread overview]
Message-ID: <20241104135902.GA2225@www.linux-watchdog.org> (raw)
In-Reply-To: <20241008084844.13751-1-zhujun2@cmss.chinamobile.com>
Hi Zhu,
> The format specifier of "int" in printf() should be "%d", not
> "%u".
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> drivers/watchdog/pcwd_pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
> index a489b426f2ba..3672e7f23b39 100644
> --- a/drivers/watchdog/pcwd_pci.c
> +++ b/drivers/watchdog/pcwd_pci.c
> @@ -230,7 +230,7 @@ static void pcipcwd_show_card_info(void)
> got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major,
> &fw_rev_minor);
> if (got_fw_rev)
> - sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
> + sprintf(fw_ver_str, "%d.%02d", fw_rev_major, fw_rev_minor);
> else
> sprintf(fw_ver_str, "<card no answer>");
>
> --
> 2.17.1
%d = The argument is treated as an integer and presented as a (signed) decimal number.
%u = The argument is treated as an integer and presented as an unsigned decimal number.
I do hope that version number are unsigned...
Kind regards,
Wim.
prev parent reply other threads:[~2024-11-04 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 8:48 [PATCH] drivers/pcwd_pci:Fix the wrong format specifier Zhu Jun
2024-11-04 13:59 ` Wim Van Sebroeck [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=20241104135902.GA2225@www.linux-watchdog.org \
--to=wim@linux-watchdog.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=zhujun2@cmss.chinamobile.com \
/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