Fix inconsistent of format with argument type
Subsystems (2)
cover Fix inconsistent of format with argument type
Ye Bin (2):
pktgen: Fix inconsistent of format with argument type in pktgen.c
net-sysfs: Fix inconsistent of format with argument type in
net-sysfs.c
net/core/net-sysfs.c | 4 ++-- net/core/pktgen.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.25.4
PATCH 1/2 pktgen: Fix inconsistent of format with argument type in pktgen.c
Fix follow warnings:
[net/core/pktgen.c:925]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:942]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:962]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:984]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:1149]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
--- net/core/pktgen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/core/pktgen.c +5 -5
@@ -922,7 +922,7 @@ static ssize_t pktgen_if_write(struct file *file, pkt_dev->min_pkt_size = value; pkt_dev->cur_pkt_size = value; } -sprintf (pg_result,"OK: min_pkt_size=%u" , +sprintf (pg_result,"OK: min_pkt_size=%d" , pkt_dev->min_pkt_size);return count; }
@@ -939,7 +939,7 @@ static ssize_t pktgen_if_write(struct file *file, pkt_dev->max_pkt_size = value; pkt_dev->cur_pkt_size = value; } -sprintf (pg_result,"OK: max_pkt_size=%u" , +sprintf (pg_result,"OK: max_pkt_size=%d" , pkt_dev->max_pkt_size);return count; }
@@ -959,7 +959,7 @@ static ssize_t pktgen_if_write(struct file *file, pkt_dev->max_pkt_size = value; pkt_dev->cur_pkt_size = value; } -sprintf (pg_result,"OK: pkt_size=%u" , pkt_dev->min_pkt_size); +sprintf (pg_result,"OK: pkt_size=%d" , pkt_dev->min_pkt_size);return count; }
@@ -981,7 +981,7 @@ static ssize_t pktgen_if_write(struct file *file, i += len; pkt_dev->nfrags = value; -sprintf (pg_result,"OK: frags=%u" , pkt_dev->nfrags); +sprintf (pg_result,"OK: frags=%d" , pkt_dev->nfrags);return count; }if (!strcmp (name,"delay" )) {
@@ -1146,7 +1146,7 @@ static ssize_t pktgen_if_write(struct file *file, (!(pkt_dev->odev->priv_flags & IFF_TX_SKB_SHARING))))) return -ENOTSUPP; pkt_dev->burst = value <1 ?1 : value; -sprintf (pg_result,"OK: burst=%d" , pkt_dev->burst); +sprintf (pg_result,"OK: burst=%u" , pkt_dev->burst);return count; }if (!strcmp (name,"node" )) {
Signature · 1 line
2.25.4
Re: [PATCH 1/2] pktgen: Fix inconsistent of format with argument type in pktgen.c
From: Ye Bin <[email protected]>
Date: Wed, 30 Sep 2020 09:08:37 +0800
Quoted 12 lines
Fix follow warnings:
[net/core/pktgen.c:925]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:942]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:962]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:984]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'signed int'.
[net/core/pktgen.c:1149]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
Quoted 2 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Ye Bin <[email protected]>
Applied.
PATCH 2/2 net-sysfs: Fix inconsistent of format with argument type in net-sysfs.c
In reply to Ye BinFix follow warnings:
[net/core/net-sysfs.c:1161]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'int'.
[net/core/net-sysfs.c:1162]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'int'.
--- net/core/net-sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/net-sysfs.c +2 -2
@@ -1158,8 +1158,8 @@ static ssize_t traffic_class_show(struct netdev_queue *queue,* belongs to the root device it will be reported with just the * traffic class, so just "0" for TC 0 for example. */ -return dev->num_tc <0 ?sprintf (buf,"%u%d\n" , tc, dev->num_tc) : -sprintf (buf,"%u\n" , tc); +return dev->num_tc <0 ?sprintf (buf,"%d%d\n" , tc, dev->num_tc) : +sprintf (buf,"%d\n" , tc); }#ifdef CONFIG_XPS
Signature · 1 line
2.25.4
Re: [PATCH 2/2] net-sysfs: Fix inconsistent of format with argument type in net-sysfs.c
From: Ye Bin <[email protected]>
Date: Wed, 30 Sep 2020 09:08:38 +0800
Quoted 8 lines
Fix follow warnings:
[net/core/net-sysfs.c:1161]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'int'.
[net/core/net-sysfs.c:1162]: (warning) %u in format string (no. 1)
requires 'unsigned int' but the argument type is 'int'.Reported-by Hulk Robot <[email protected]>Signed-off-by Ye Bin <[email protected]>
Applied.