[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH] net: Include iov.h in checksum.h
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH] net: Include iov.h in checksum.h |
Date: |
Fri, 07 Feb 2014 11:05:41 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 |
06.02.2014 19:30, Alexander Graf wrote:
> The checksum calculation header exports a function that refers to struct
> iov which is defined in iov.h. Include the header so that the compiler
> knows what this struct is about.
Alternatively (and I sometimes prefer it this way), one can just
declare `struct iovec;' instead of including whole header, because
we don't actually use any definitions from there, and users of
checksum.h wont be including extra dependencies which they don't
use... Like this:
--- cut ---
Subject: net: declare struct iovec in checksum.h to fix compiler warning
From: Michael Tokarev <address@hidden>
The checksum calculation header exports a function that refers to
struct iov defined in iov.h. Without including the former, build
fails like this:
In file included from hw/net/fsl_etsec/rings.c:24:0:
include/net/checksum.h:51:31: error: ‘struct iovec’ declared inside parameter
list [-Werror]
include/net/checksum.h:51:31: error: its scope is only this definition or
declaration, which is probably not what you want [-Werror]
Mention struct iovec there.
Signed-off-by: Michael Tokarev <address@hidden>
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 80203fb..2d7a363 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -19,6 +19,7 @@
#define QEMU_NET_CHECKSUM_H
#include <stdint.h>
+struct iovec;
uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq);
uint16_t net_checksum_finish(uint32_t sum);
--- cut ---
BTW, this is a -trivial matherial ;)
/mjt
- Re: [Qemu-trivial] [Qemu-devel] [PATCH] net: Include iov.h in checksum.h,
Michael Tokarev <=