[media] m5mols: Fix cast warnings from m5mols_[set/get]_ctrl_mode
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Tue, 7 Aug 2012 07:58:35 +0000 (04:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 1 Oct 2012 17:56:29 +0000 (14:56 -0300)
Fixes following warnings on 64-bit architectures:

m5mols.h: In function 'm5mols_set_ctrl_mode':
m5mols.h:326:15: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]

m5mols.h: In function 'm5mols_get_ctrl_mode':
m5mols.h:331:9: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]

drivers/media/i2c/m5mols/m5mols_controls.c:466:2: warning: cast
from pointer to integer of different size

Cc: Heungjun Kim <riverful.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/m5mols/m5mols.h
drivers/media/i2c/m5mols/m5mols_controls.c

index bb589917b65b26b743744ed1c78234060238fb2d..527e7b2965df3a351dc3d5d1ff48614adb4a7eeb 100644 (file)
@@ -323,12 +323,12 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
 static inline void m5mols_set_ctrl_mode(struct v4l2_ctrl *ctrl,
                                        unsigned int mode)
 {
-       ctrl->priv = (void *)mode;
+       ctrl->priv = (void *)(uintptr_t)mode;
 }
 
 static inline unsigned int m5mols_get_ctrl_mode(struct v4l2_ctrl *ctrl)
 {
-       return (unsigned int)ctrl->priv;
+       return (unsigned int)(uintptr_t)ctrl->priv;
 }
 
 #endif /* M5MOLS_H */
index fdbc205a29698a1836b94d1fb9b6d9f8de0e798a..f34429e452abf4e01dfd71d38ceb690d3c5ab021 100644 (file)
@@ -463,8 +463,8 @@ static int m5mols_s_ctrl(struct v4l2_ctrl *ctrl)
                return 0;
        }
 
-       v4l2_dbg(1, m5mols_debug, sd, "%s: %s, val: %d, priv: %#x\n",
-                __func__, ctrl->name, ctrl->val, (int)ctrl->priv);
+       v4l2_dbg(1, m5mols_debug, sd, "%s: %s, val: %d, priv: %p\n",
+                __func__, ctrl->name, ctrl->val, ctrl->priv);
 
        if (ctrl_mode && ctrl_mode != info->mode) {
                ret = m5mols_set_mode(info, ctrl_mode);