Commit 10e6f32bdf02448f787d78647e75cf98a02f19a4
Committed by
Linus Torvalds
1 parent
fa7303e22c
Exists in
master
and in
39 other branches
getdelays: fix gcc warnings
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> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
Documentation/accounting/getdelays.c
... | ... | @@ -168,7 +168,7 @@ |
168 | 168 | char buf[256]; |
169 | 169 | } ans; |
170 | 170 | |
171 | - int id, rc; | |
171 | + int id = 0, rc; | |
172 | 172 | struct nlattr *na; |
173 | 173 | int rep_len; |
174 | 174 | |
... | ... | @@ -209,7 +209,7 @@ |
209 | 209 | void task_context_switch_counts(struct taskstats *t) |
210 | 210 | { |
211 | 211 | printf("\n\nTask %15s%15s\n" |
212 | - " %15lu%15lu\n", | |
212 | + " %15llu%15llu\n", | |
213 | 213 | "voluntary", "nonvoluntary", |
214 | 214 | t->nvcsw, t->nivcsw); |
215 | 215 | } |
... | ... | @@ -399,7 +399,7 @@ |
399 | 399 | goto done; |
400 | 400 | } |
401 | 401 | |
402 | - PRINTF("nlmsghdr size=%d, nlmsg_len=%d, rep_len=%d\n", | |
402 | + PRINTF("nlmsghdr size=%zu, nlmsg_len=%d, rep_len=%d\n", | |
403 | 403 | sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); |
404 | 404 | |
405 | 405 |