datapath: avoid cast-qual warning in vport_priv
authorDaniele Di Proietto <daniele.di.proietto@gmail.com>
Thu, 23 Jan 2014 22:26:05 +0000 (23:26 +0100)
committerJesse Gross <jesse@nicira.com>
Mon, 3 Feb 2014 22:05:21 +0000 (14:05 -0800)
This function must cast a const value to a non const value.
By adding an uintptr_t cast the warning is suppressed.
To avoid the cast (proper solution) several function signatures
must be changed.

Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/vport.h

index de79d8c..18b723e 100644 (file)
@@ -173,7 +173,7 @@ void ovs_vport_deferred_free(struct vport *vport);
  */
 static inline void *vport_priv(const struct vport *vport)
 {
-       return (u8 *)vport + ALIGN(sizeof(struct vport), VPORT_ALIGN);
+       return (u8 *)(uintptr_t)vport + ALIGN(sizeof(struct vport), VPORT_ALIGN);
 }
 
 /**