diff options
author | Daniele Di Proietto <daniele.di.proietto@gmail.com> | 2014-02-03 14:07:43 -0800 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2014-05-16 13:40:28 -0700 |
commit | d0b4da137508db3d38998eae7f62c0f9699ee08c (patch) | |
tree | ef820a32b1e1e263e0175df766f584e910c32072 | |
parent | 7085130bab2f9c5b8d61bff73b01dc8195d0f974 (diff) | |
download | linux-d0b4da137508db3d38998eae7f62c0f9699ee08c.tar.bz2 |
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 <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r-- | net/openvswitch/vport.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index d7e50a17396c..3e12940985a2 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 *, |