From 9529ed33af0ca22c1716ab8e9628f7cb70733cc0 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 30 Jan 2017 16:47:26 +0100 Subject: user_call: Fix warning about void pointer arithmetic. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit user_io.c user_io.c: In function ‘flush_output’: user_io.c:70:7: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] buf += paclen_out; ^~ Signed-off-by: Ralf Baechle --- user_call/user_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'user_call') diff --git a/user_call/user_io.c b/user_call/user_io.c index 0a25136..3c7e9d5 100644 --- a/user_call/user_io.c +++ b/user_call/user_io.c @@ -62,12 +62,13 @@ void end_compress(void) static int flush_output(int fd, const void *buf, size_t count) { + const unsigned char *byte = buf; int cnt = count; while (cnt > 0) { - if (write(fd, buf, min(paclen_out, cnt)) < 0) + if (write(fd, byte, min(paclen_out, cnt)) < 0) return -1; - buf += paclen_out; + byte += paclen_out; cnt -= paclen_out; } -- cgit v1.2.3