From: Daniele Di Proietto Date: Mon, 3 Feb 2014 22:07:43 +0000 (-0800) Subject: openvswitch: avoid warnings in vport_from_priv X-Git-Tag: v4.14-rc1~7383^2~201^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0b4da137508db3d38998eae7f62c0f9699ee08c;p=platform%2Fkernel%2Flinux-rpi.git openvswitch: 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/net/openvswitch/vport.h b/net/openvswitch/vport.h index d7e50a1..3e12940 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -185,9 +185,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 *,