soc_camera.h compiler warning: should be fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guennadi,

The daily build gives these compiler warnings when compiling on a 64-bit
platform:

In file included from drivers/media/video/imx074.c:19:0:
include/media/soc_camera.h: In function ‘soc_camera_i2c_to_vdev’:
include/media/soc_camera.h:257:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
In file included from drivers/media/video/mt9m111.c:18:0:
include/media/soc_camera.h: In function ‘soc_camera_i2c_to_vdev’:
include/media/soc_camera.h:257:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

(and a whole bunch more of these warnings).

The culprit is this inline function:

static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client)
{
        struct v4l2_subdev *sd = i2c_get_clientdata(client);
        struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id;
        return icd ? icd->vdev : NULL;
}

sd->grp_id is a u32, so obviously this will fail on a 64-bit arch.

Since ARM is moving to 64-bits as well we should fix this.

Instead of abusing grp_id it is better to use the relatively new v4l2_subdev
'host_priv' field. This is a proper void pointer, and can be used by the host
driver as it pleases.

Can you make a patch for this? It would be nice to get rid of these warnings.

Regards,

	Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux