* [PATCH] getdelays: fix gcc warnings
@ 2008-01-16 0:05 Randy Dunlap
2008-01-17 17:58 ` Balbir Singh
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2008-01-16 0:05 UTC (permalink / raw)
To: lkml; +Cc: jlan, balbir, nagar, akpm
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix gcc warnings in getdelays.c:
Documentation/accounting/getdelays.c: In function 'task_context_switch_counts':
Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 4 has type '__u64'
Documentation/accounting/getdelays.c:214: warning: format '%15lu' expects type 'long unsigned int', but argument 5 has type '__u64'
Documentation/accounting/getdelays.c: In function 'main':
Documentation/accounting/getdelays.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
Documentation/accounting/getdelays.c: In function 'get_family_id':
Documentation/accounting/getdelays.c:171: warning: 'id' may be used uninitialized in this function
One warning is not a problem and can be dismissed:
Documentation/accounting/getdelays.c: In function 'main':
Documentation/accounting/getdelays.c:236: warning: 'cmd_type' may be used uninitialized in this function
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
Documentation/accounting/getdelays.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- linux-2.6.24-rc7.orig/Documentation/accounting/getdelays.c
+++ linux-2.6.24-rc7/Documentation/accounting/getdelays.c
@@ -168,7 +168,7 @@ int get_family_id(int sd)
char buf[256];
} ans;
- int id, rc;
+ int id = 0, rc;
struct nlattr *na;
int rep_len;
@@ -209,7 +209,7 @@ void print_delayacct(struct taskstats *t
void task_context_switch_counts(struct taskstats *t)
{
printf("\n\nTask %15s%15s\n"
- " %15lu%15lu\n",
+ " %15llu%15llu\n",
"voluntary", "nonvoluntary",
t->nvcsw, t->nivcsw);
}
@@ -399,7 +399,7 @@ int main(int argc, char *argv[])
goto done;
}
- PRINTF("nlmsghdr size=%d, nlmsg_len=%d, rep_len=%d\n",
+ PRINTF("nlmsghdr size=%zu, nlmsg_len=%d, rep_len=%d\n",
sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] getdelays: fix gcc warnings
2008-01-16 0:05 [PATCH] getdelays: fix gcc warnings Randy Dunlap
@ 2008-01-17 17:58 ` Balbir Singh
0 siblings, 0 replies; 2+ messages in thread
From: Balbir Singh @ 2008-01-17 17:58 UTC (permalink / raw)
To: Randy Dunlap; +Cc: lkml, jlan, nagar, akpm
* Randy Dunlap <randy.dunlap@oracle.com> [2008-01-15 16:05:06]:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Fix gcc warnings in getdelays.c:
Hi, Randy,
Thanks for finding these problems and fixing them. The fixes look
quite straight forward.
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-18 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-16 0:05 [PATCH] getdelays: fix gcc warnings Randy Dunlap
2008-01-17 17:58 ` Balbir Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®