From f66800e243906dd91363ac7f8b33641b529c9f25 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Sun, 17 Nov 2019 22:27:16 +0100 Subject: [PATCH 1/3] lkl: fs2tar: Fix -Wimplicit-fallthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fs2tar.c: In function ‘parse_opt’: fs2tar.c:71:26: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Andreas Gnau --- tools/lkl/fs2tar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lkl/fs2tar.c b/tools/lkl/fs2tar.c index de769ee048b260..d10fa0303bda16 100644 --- a/tools/lkl/fs2tar.c +++ b/tools/lkl/fs2tar.c @@ -70,6 +70,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) case ARGP_KEY_END: if (state->arg_num < 2 || !cla->fsimg_type) argp_usage(state); + break; default: return ARGP_ERR_UNKNOWN; } From 27aab0b785707002192393c2f3574932e2c72388 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Sun, 17 Nov 2019 22:27:46 +0100 Subject: [PATCH 2/3] lkl: Fix -Wstringop-truncation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lib/virtio_net_tap.c: In function ‘lkl_netdev_tap_create’: lib/virtio_net_tap.c:107:2: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] Signed-off-by: Andreas Gnau --- tools/lkl/lib/virtio_net_tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lkl/lib/virtio_net_tap.c b/tools/lkl/lib/virtio_net_tap.c index e5302a375aeef8..b8ad42b5890a3a 100644 --- a/tools/lkl/lib/virtio_net_tap.c +++ b/tools/lkl/lib/virtio_net_tap.c @@ -104,7 +104,7 @@ struct lkl_netdev *lkl_netdev_tap_create(const char *ifname, int offload) #endif }; - strncpy(ifr.ifr_name, ifname, IFNAMSIZ); + snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", ifname); return lkl_netdev_tap_init(path, offload, &ifr); } From 3c72f4ae14910ca8c08652bfe7893359178109c7 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Sun, 17 Nov 2019 22:30:13 +0100 Subject: [PATCH 3/3] lkl: posix-host: Fix -Wcast-function-type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lib/posix-host.c:189:49: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type] lib/posix-host.c:270:28: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(union sigval)’ [-Wcast-function-type] Signed-off-by: Andreas Gnau --- tools/lkl/lib/posix-host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lkl/lib/posix-host.c b/tools/lkl/lib/posix-host.c index db63ed7e35fb19..f1ae3a2e6dbb37 100644 --- a/tools/lkl/lib/posix-host.c +++ b/tools/lkl/lib/posix-host.c @@ -186,7 +186,7 @@ static void mutex_free(struct lkl_mutex *_mutex) static lkl_thread_t thread_create(void (*fn)(void *), void *arg) { pthread_t thread; - if (WARN_PTHREAD(pthread_create(&thread, NULL, (void* (*)(void *))fn, arg))) + if (WARN_PTHREAD(pthread_create(&thread, NULL, (void *)fn, arg))) return 0; else return (lkl_thread_t) thread; @@ -267,7 +267,7 @@ static void *timer_alloc(void (*fn)(void *), void *arg) .sigev_value = { .sival_ptr = arg, }, - .sigev_notify_function = (void (*)(union sigval))fn, + .sigev_notify_function = (void (*)())fn, }; err = timer_create(CLOCK_REALTIME, &se, &timer);