netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values
@ 2018-03-19 17:50 Roman Mashak
  2018-03-19 17:55 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Mashak @ 2018-03-19 17:50 UTC (permalink / raw)
  To: stephen; +Cc: netdev, jhs, xiyou.wangcong, jiri, Roman Mashak

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
 tc/m_action.c     | 2 +-
 tc/m_gact.c       | 2 +-
 tc/m_ife.c        | 2 +-
 tc/m_pedit.c      | 2 +-
 tc/m_sample.c     | 6 +++---
 tc/m_tunnel_key.c | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tc/m_action.c b/tc/m_action.c
index 148f1372d414..85c9d44c7e50 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -408,7 +408,7 @@ int print_action(const struct sockaddr_nl *who,
 	if (tb[TCA_ROOT_COUNT])
 		tot_acts = RTA_DATA(tb[TCA_ROOT_COUNT]);
 
-	fprintf(fp, "total acts %d\n", tot_acts ? *tot_acts:0);
+	fprintf(fp, "total acts %u\n", tot_acts ? *tot_acts:0);
 	if (tb[TCA_ACT_TAB] == NULL) {
 		if (n->nlmsg_type != RTM_GETACTION)
 			fprintf(stderr, "print_action: NULL kind\n");
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 16c4413f4217..52022415db48 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -194,7 +194,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
 	print_string(PRINT_ANY, "random_type", "\n\t random type %s",
 		     prob_n2a(pp->ptype));
 	print_action_control(f, " ", pp->paction, " ");
-	print_int(PRINT_ANY, "val", "val %d", pp->pval);
+	print_int(PRINT_ANY, "val", "val %u", pp->pval);
 	close_json_object();
 #endif
 	print_uint(PRINT_ANY, "index", "\n\t index %u", p->index);
diff --git a/tc/m_ife.c b/tc/m_ife.c
index 205efc9f1d9a..e1dbd3a79649 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -280,7 +280,7 @@ static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
 			if (len) {
 				mtcindex =
 					rta_getattr_u16(metalist[IFE_META_TCINDEX]);
-				fprintf(f, "use tcindex %d ", mtcindex);
+				fprintf(f, "use tcindex %u ", mtcindex);
 			} else
 				fprintf(f, "allow tcindex ");
 		}
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 26549eeea899..151dfe1a230a 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -817,7 +817,7 @@ int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg)
 				(unsigned int)ntohl(key->mask));
 		}
 	} else {
-		fprintf(f, "\npedit %x keys %d is not LEGIT", sel->index,
+		fprintf(f, "\npedit %x keys %u is not LEGIT", sel->index,
 			sel->nkeys);
 	}
 
diff --git a/tc/m_sample.c b/tc/m_sample.c
index 01763cb4c356..d42a6a327965 100644
--- a/tc/m_sample.c
+++ b/tc/m_sample.c
@@ -155,17 +155,17 @@ static int print_sample(struct action_util *au, FILE *f, struct rtattr *arg)
 	}
 	p = RTA_DATA(tb[TCA_SAMPLE_PARMS]);
 
-	fprintf(f, "sample rate 1/%d group %d",
+	fprintf(f, "sample rate 1/%u group %u",
 		rta_getattr_u32(tb[TCA_SAMPLE_RATE]),
 		rta_getattr_u32(tb[TCA_SAMPLE_PSAMPLE_GROUP]));
 
 	if (tb[TCA_SAMPLE_TRUNC_SIZE])
-		fprintf(f, " trunc_size %d",
+		fprintf(f, " trunc_size %u",
 			rta_getattr_u32(tb[TCA_SAMPLE_TRUNC_SIZE]));
 
 	print_action_control(f, " ", p->action, "");
 
-	fprintf(f, "\n\tindex %d ref %d bind %d", p->index, p->refcnt,
+	fprintf(f, "\n\tindex %u ref %d bind %d", p->index, p->refcnt,
 		p->bindcnt);
 
 	if (show_stats) {
diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c
index 1cdd03560c35..dd8f8e8c635b 100644
--- a/tc/m_tunnel_key.c
+++ b/tc/m_tunnel_key.c
@@ -292,7 +292,7 @@ static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg)
 	}
 	print_action_control(f, " ", parm->action, "");
 
-	fprintf(f, "\n\tindex %d ref %d bind %d", parm->index, parm->refcnt,
+	fprintf(f, "\n\tindex %u ref %d bind %d", parm->index, parm->refcnt,
 		parm->bindcnt);
 
 	if (show_stats) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values
  2018-03-19 17:50 [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values Roman Mashak
@ 2018-03-19 17:55 ` Stephen Hemminger
  2018-03-19 18:14   ` Roman Mashak
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-03-19 17:55 UTC (permalink / raw)
  To: Roman Mashak; +Cc: netdev, jhs, xiyou.wangcong, jiri

On Mon, 19 Mar 2018 13:50:07 -0400
Roman Mashak <mrv@mojatatu.com> wrote:

> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
>  tc/m_action.c     | 2 +-
>  tc/m_gact.c       | 2 +-
>  tc/m_ife.c        | 2 +-
>  tc/m_pedit.c      | 2 +-
>  tc/m_sample.c     | 6 +++---
>  tc/m_tunnel_key.c | 2 +-
>  6 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tc/m_action.c b/tc/m_action.c
> index 148f1372d414..85c9d44c7e50 100644
> --- a/tc/m_action.c
> +++ b/tc/m_action.c
> @@ -408,7 +408,7 @@ int print_action(const struct sockaddr_nl *who,
>  	if (tb[TCA_ROOT_COUNT])
>  		tot_acts = RTA_DATA(tb[TCA_ROOT_COUNT]);
>  
> -	fprintf(fp, "total acts %d\n", tot_acts ? *tot_acts:0);
> +	fprintf(fp, "total acts %u\n", tot_acts ? *tot_acts:0);

Please add spaces around : in trigraph.

When fixing code, it has to pass style checkers.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values
  2018-03-19 17:55 ` Stephen Hemminger
@ 2018-03-19 18:14   ` Roman Mashak
  0 siblings, 0 replies; 3+ messages in thread
From: Roman Mashak @ 2018-03-19 18:14 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, jhs, xiyou.wangcong, jiri

Stephen Hemminger <stephen@networkplumber.org> writes:

> On Mon, 19 Mar 2018 13:50:07 -0400
> Roman Mashak <mrv@mojatatu.com> wrote:
>
>> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
>> ---
>>  tc/m_action.c     | 2 +-
>>  tc/m_gact.c       | 2 +-
>>  tc/m_ife.c        | 2 +-
>>  tc/m_pedit.c      | 2 +-
>>  tc/m_sample.c     | 6 +++---
>>  tc/m_tunnel_key.c | 2 +-
>>  6 files changed, 8 insertions(+), 8 deletions(-)
>> 
>> diff --git a/tc/m_action.c b/tc/m_action.c
>> index 148f1372d414..85c9d44c7e50 100644
>> --- a/tc/m_action.c
>> +++ b/tc/m_action.c
>> @@ -408,7 +408,7 @@ int print_action(const struct sockaddr_nl *who,
>>  	if (tb[TCA_ROOT_COUNT])
>>  		tot_acts = RTA_DATA(tb[TCA_ROOT_COUNT]);
>>  
>> -	fprintf(fp, "total acts %d\n", tot_acts ? *tot_acts:0);
>> +	fprintf(fp, "total acts %u\n", tot_acts ? *tot_acts:0);
>
> Please add spaces around : in trigraph.
>
> When fixing code, it has to pass style checkers.

Thanks, I will send v2.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-19 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 17:50 [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values Roman Mashak
2018-03-19 17:55 ` Stephen Hemminger
2018-03-19 18:14   ` Roman Mashak

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).