From: Jens Axboe Date: Fri, 7 Sep 2018 18:09:24 +0000 (-0600) Subject: log: use __log_buf() if we know buf != NULL X-Git-Tag: fio-3.10~13 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c2fcb6bcecf0d4208154178de55d918d2a4abf61 log: use __log_buf() if we know buf != NULL This apparently causes complaints on cygwin: CC stat.o In file included from os/os-windows.h:18:0, from os/os.h:54, from thread_options.h:5, from fio.h:18, from init.c:19: init.c: In function ‘add_job’: os/../log.h:24:12: error: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Werror=address] if ((buf) != NULL) \ ^ os/../log.h:24:12: note: in definition of macro ‘log_buf’ if ((buf) != NULL) \ which is utterly stupid, but hey... Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index 00fc29a4..314d6e33 100644 --- a/backend.c +++ b/backend.c @@ -2216,17 +2216,17 @@ static void run_threads(struct sk_out *sk_out) struct buf_output out; buf_output_init(&out); - log_buf(&out, "Starting "); + __log_buf(&out, "Starting "); if (nr_thread) - log_buf(&out, "%d thread%s", nr_thread, + __log_buf(&out, "%d thread%s", nr_thread, nr_thread > 1 ? "s" : ""); if (nr_process) { if (nr_thread) - log_buf(&out, " and "); - log_buf(&out, "%d process%s", nr_process, + __log_buf(&out, " and "); + __log_buf(&out, "%d process%s", nr_process, nr_process > 1 ? "es" : ""); } - log_buf(&out, "\n"); + __log_buf(&out, "\n"); log_info_buf(out.buf, out.buflen); } diff --git a/client.c b/client.c index 2d8a2bb1..0f28cf63 100644 --- a/client.c +++ b/client.c @@ -1151,8 +1151,8 @@ static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd) name = client->name ? client->name : client->hostname; if (!client->skip_newline && !(output_format & FIO_OUTPUT_TERSE)) - log_buf(&out, "<%s> ", name); - log_buf(&out, "%s", buf); + __log_buf(&out, "<%s> ", name); + __log_buf(&out, "%s", buf); log_info_buf(out.buf, out.buflen); client->skip_newline = strchr(buf, '\n') == NULL; }