diff options
author | Sudeep Dutt <sudeep.dutt@intel.com> | 2013-10-02 19:09:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-03 19:02:35 -0400 |
commit | 6078e0bef2236f323377c53e77e26288fb52ee23 (patch) | |
tree | 2722bcd8afaede82bae2862de3e30025c879fa72 /Documentation/mic/mpssd | |
parent | af68fb65557dee58918822a470cd64fd76ed837e (diff) |
misc: mic: Fix build issues in sample daemon.
Specifying gcc format function attribute for mpsslog(..) and
building on 32 bit systems exposed a few build issues in the
sample MIC daemon which are fixed by this patch. Some of these
changes were authored by Joe Perches @
https://lkml.org/lkml/2013/9/27/419
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Caz Yokoyama <Caz.Yokoyama@intel.com>
Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/mic/mpssd')
-rw-r--r-- | Documentation/mic/mpssd/mpssd.c | 22 | ||||
-rw-r--r-- | Documentation/mic/mpssd/mpssd.h | 1 |
2 files changed, 12 insertions, 11 deletions
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c index f9327a29ae4c..82c6bc2e3cb6 100644 --- a/Documentation/mic/mpssd/mpssd.c +++ b/Documentation/mic/mpssd/mpssd.c | |||
@@ -362,9 +362,9 @@ static inline void verify_out_len(struct mic_info *mic, | |||
362 | struct mic_copy_desc *copy) | 362 | struct mic_copy_desc *copy) |
363 | { | 363 | { |
364 | if (copy->out_len != sum_iovec_len(copy)) { | 364 | if (copy->out_len != sum_iovec_len(copy)) { |
365 | mpsslog("%s %s %d BUG copy->out_len 0x%x len 0x%x\n", | 365 | mpsslog("%s %s %d BUG copy->out_len 0x%x len 0x%zx\n", |
366 | mic->name, __func__, __LINE__, | 366 | mic->name, __func__, __LINE__, |
367 | copy->out_len, sum_iovec_len(copy)); | 367 | copy->out_len, sum_iovec_len(copy)); |
368 | assert(copy->out_len == sum_iovec_len(copy)); | 368 | assert(copy->out_len == sum_iovec_len(copy)); |
369 | } | 369 | } |
370 | } | 370 | } |
@@ -377,7 +377,7 @@ disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy, | |||
377 | int i; | 377 | int i; |
378 | 378 | ||
379 | for (i = 0; i < copy->iovcnt; i++) | 379 | for (i = 0; i < copy->iovcnt; i++) |
380 | mpsslog("%s %s %d copy->iov[%d] addr %p len 0x%lx\n", | 380 | mpsslog("%s %s %d copy->iov[%d] addr %p len 0x%zx\n", |
381 | mic->name, s, line, i, | 381 | mic->name, s, line, i, |
382 | copy->iov[i].iov_base, copy->iov[i].iov_len); | 382 | copy->iov[i].iov_base, copy->iov[i].iov_len); |
383 | } | 383 | } |
@@ -630,7 +630,7 @@ virtio_net(void *arg) | |||
630 | disp_iovec(mic, ©, __func__, __LINE__); | 630 | disp_iovec(mic, ©, __func__, __LINE__); |
631 | mpsslog("%s %s %d read failed %s ", mic->name, | 631 | mpsslog("%s %s %d read failed %s ", mic->name, |
632 | __func__, __LINE__, strerror(errno)); | 632 | __func__, __LINE__, strerror(errno)); |
633 | mpsslog("cnt %d sum %d\n", | 633 | mpsslog("cnt %d sum %zd\n", |
634 | copy.iovcnt, sum_iovec_len(©)); | 634 | copy.iovcnt, sum_iovec_len(©)); |
635 | } | 635 | } |
636 | } | 636 | } |
@@ -680,8 +680,8 @@ virtio_net(void *arg) | |||
680 | if (len != sum_iovec_len(©)) { | 680 | if (len != sum_iovec_len(©)) { |
681 | mpsslog("Tun write failed %s ", | 681 | mpsslog("Tun write failed %s ", |
682 | strerror(errno)); | 682 | strerror(errno)); |
683 | mpsslog("len 0x%x ", len); | 683 | mpsslog("len 0x%zx ", len); |
684 | mpsslog("read_len 0x%x\n", | 684 | mpsslog("read_len 0x%zx\n", |
685 | sum_iovec_len(©)); | 685 | sum_iovec_len(©)); |
686 | } else { | 686 | } else { |
687 | #ifdef DEBUG | 687 | #ifdef DEBUG |
@@ -827,7 +827,7 @@ virtio_console(void *arg) | |||
827 | mpsslog("%s %s %d read failed %s ", | 827 | mpsslog("%s %s %d read failed %s ", |
828 | mic->name, __func__, __LINE__, | 828 | mic->name, __func__, __LINE__, |
829 | strerror(errno)); | 829 | strerror(errno)); |
830 | mpsslog("cnt %d sum %d\n", | 830 | mpsslog("cnt %d sum %zd\n", |
831 | copy.iovcnt, sum_iovec_len(©)); | 831 | copy.iovcnt, sum_iovec_len(©)); |
832 | } | 832 | } |
833 | } | 833 | } |
@@ -859,8 +859,8 @@ virtio_console(void *arg) | |||
859 | if (len != sum_iovec_len(©)) { | 859 | if (len != sum_iovec_len(©)) { |
860 | mpsslog("Tun write failed %s ", | 860 | mpsslog("Tun write failed %s ", |
861 | strerror(errno)); | 861 | strerror(errno)); |
862 | mpsslog("len 0x%x ", len); | 862 | mpsslog("len 0x%zx ", len); |
863 | mpsslog("read_len 0x%x\n", | 863 | mpsslog("read_len 0x%zx\n", |
864 | sum_iovec_len(©)); | 864 | sum_iovec_len(©)); |
865 | } else { | 865 | } else { |
866 | #ifdef DEBUG | 866 | #ifdef DEBUG |
@@ -953,7 +953,7 @@ set_backend_file(struct mic_info *mic) | |||
953 | return false; | 953 | return false; |
954 | mic->mic_virtblk.backend_file = malloc(strlen(evv) + 1); | 954 | mic->mic_virtblk.backend_file = malloc(strlen(evv) + 1); |
955 | if (mic->mic_virtblk.backend_file == NULL) { | 955 | if (mic->mic_virtblk.backend_file == NULL) { |
956 | mpsslog("can't allocate memory\n", mic->name, mic->id); | 956 | mpsslog("%s %d can't allocate memory\n", mic->name, mic->id); |
957 | return false; | 957 | return false; |
958 | } | 958 | } |
959 | strcpy(mic->mic_virtblk.backend_file, evv + 1); | 959 | strcpy(mic->mic_virtblk.backend_file, evv + 1); |
@@ -1026,7 +1026,7 @@ close_backend(struct mic_info *mic) | |||
1026 | static bool | 1026 | static bool |
1027 | start_virtblk(struct mic_info *mic, struct mic_vring *vring) | 1027 | start_virtblk(struct mic_info *mic, struct mic_vring *vring) |
1028 | { | 1028 | { |
1029 | if (((__u64)&virtblk_dev_page.blk_config % 8) != 0) { | 1029 | if (((unsigned long)&virtblk_dev_page.blk_config % 8) != 0) { |
1030 | mpsslog("%s: blk_config is not 8 byte aligned.\n", | 1030 | mpsslog("%s: blk_config is not 8 byte aligned.\n", |
1031 | mic->name); | 1031 | mic->name); |
1032 | return false; | 1032 | return false; |
diff --git a/Documentation/mic/mpssd/mpssd.h b/Documentation/mic/mpssd/mpssd.h index b6dee38ca5b1..ccd589ff9146 100644 --- a/Documentation/mic/mpssd/mpssd.h +++ b/Documentation/mic/mpssd/mpssd.h | |||
@@ -94,6 +94,7 @@ struct mic_info { | |||
94 | struct mic_info *next; | 94 | struct mic_info *next; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | __attribute__((format(printf, 1, 2))) | ||
97 | void mpsslog(char *format, ...); | 98 | void mpsslog(char *format, ...); |
98 | char *readsysfs(char *dir, char *entry); | 99 | char *readsysfs(char *dir, char *entry); |
99 | int setsysfs(char *dir, char *entry, char *value); | 100 | int setsysfs(char *dir, char *entry, char *value); |