* [PATCH] tty: synclink_gt: Fix incorrect formatted output
@ 2024-11-07 3:29 liujing
2024-11-07 8:44 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: liujing @ 2024-11-07 3:29 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-serial, liujing
In the struct slgt_info structure, the type of info->tbuf_current
is unsigned int, so the output format is %u.
Signed-off-by: liujing <liujing@cmss.chinamobile.com>
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index bd8d92ee7c53..0c51c6c28080 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -519,7 +519,7 @@ static void trace_block(struct slgt_info *info, const char *data, int count, con
static void dump_tbufs(struct slgt_info *info)
{
int i;
- printk("tbuf_current=%d\n", info->tbuf_current);
+ printk("tbuf_current=%u\n", info->tbuf_current);
for (i=0 ; i < info->tbuf_count ; i++) {
printk("%d: count=%04X status=%04X\n",
i, le16_to_cpu(info->tbufs[i].count), le16_to_cpu(info->tbufs[i].status));
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tty: synclink_gt: Fix incorrect formatted output
2024-11-07 3:29 [PATCH] tty: synclink_gt: Fix incorrect formatted output liujing
@ 2024-11-07 8:44 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2024-11-07 8:44 UTC (permalink / raw)
To: liujing; +Cc: linux-kernel, linux-serial
On Thu, Nov 07, 2024 at 11:29:36AM +0800, liujing wrote:
> In the struct slgt_info structure, the type of info->tbuf_current
> is unsigned int, so the output format is %u.
>
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
>
> diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
> index bd8d92ee7c53..0c51c6c28080 100644
> --- a/drivers/tty/synclink_gt.c
> +++ b/drivers/tty/synclink_gt.c
> @@ -519,7 +519,7 @@ static void trace_block(struct slgt_info *info, const char *data, int count, con
> static void dump_tbufs(struct slgt_info *info)
> {
> int i;
> - printk("tbuf_current=%d\n", info->tbuf_current);
> + printk("tbuf_current=%u\n", info->tbuf_current);
How was this found? How was it tested? Why is this code still in here
at all? It all should be removed and if really needed, converted to use
the proper in-kernel apis for this type of thing, not a random module
parameter that does not fit in with the rest of the kernel.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-07 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 3:29 [PATCH] tty: synclink_gt: Fix incorrect formatted output liujing
2024-11-07 8:44 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).