[ovs-dev] [PATCH 2/3] datapath: avoid cast-qual warning in vport_priv

Daniele Di Proietto daniele.di.proietto at gmail.com
Thu Jan 23 22:26:05 UTC 2014


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 at gmail.com>
---
 datapath/vport.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/vport.h b/datapath/vport.h
index de79d8c..18b723e 100644
--- a/datapath/vport.h
+++ b/datapath/vport.h
@@ -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);
 }
 
 /**
-- 
1.8.0




More information about the dev mailing list