From: Daniele Di Proietto Date: Thu, 23 Jan 2014 22:25:37 +0000 (+0100) Subject: datapath: avoid warnings in vport_from_priv X-Git-Tag: sliver-openvswitch-2.1.90-1~8^2~18 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=38b5f1e78a0001fae9a52bc4db2a41c022f7b36d;p=sliver-openvswitch.git datapath: avoid warnings in vport_from_priv This change, firstly, avoids declaring the formal parameter const, since it is treated as non const. (to avoid -Wcast-qual) Secondly, it cast the pointer from void* to u8*, since it is used in arithmetic (to avoid -Wpointer-arith) Signed-off-by: Daniele Di Proietto Signed-off-by: Jesse Gross --- diff --git a/datapath/vport.h b/datapath/vport.h index 2cf2b183b..de79d8c12 100644 --- a/datapath/vport.h +++ b/datapath/vport.h @@ -186,9 +186,9 @@ static inline void *vport_priv(const struct vport *vport) * the result of a hash table lookup. @priv must point to the start of the * private data area. */ -static inline struct vport *vport_from_priv(const void *priv) +static inline struct vport *vport_from_priv(void *priv) { - return (struct vport *)(priv - ALIGN(sizeof(struct vport), VPORT_ALIGN)); + return (struct vport *)((u8 *)priv - ALIGN(sizeof(struct vport), VPORT_ALIGN)); } void ovs_vport_receive(struct vport *, struct sk_buff *,