From 2c6ce48e18a2a95743de7a84faefd52d090c2a56 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 May 2018 12:42:18 -0700 Subject: [PATCH 377/454] staging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi. commit 40b73e16675ee2e77358ed1cfc3364c8bf000e4f upstream. The v4l2 uapi uses u8[] for strings, so cast those to char * to avoid compiler warnings about unsigned vs signed with sprintf() and friends. Signed-off-by: Eric Anholt Signed-off-by: Greg Kroah-Hartman --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -726,7 +726,7 @@ static int vidioc_enum_fmt_vid_overlay(s fmt = &formats[f->index]; - strlcpy(f->description, fmt->name, sizeof(f->description)); + strlcpy((char *)f->description, fmt->name, sizeof(f->description)); f->pixelformat = fmt->fourcc; f->flags = fmt->flags; @@ -884,7 +884,7 @@ static int vidioc_enum_input(struct file return -EINVAL; inp->type = V4L2_INPUT_TYPE_CAMERA; - sprintf(inp->name, "Camera %u", inp->index); + sprintf((char *)inp->name, "Camera %u", inp->index); return 0; } @@ -912,11 +912,11 @@ static int vidioc_querycap(struct file * vchiq_mmal_version(dev->instance, &major, &minor); - strcpy(cap->driver, "bm2835 mmal"); - snprintf(cap->card, sizeof(cap->card), "mmal service %d.%d", + strcpy((char *)cap->driver, "bm2835 mmal"); + snprintf((char *)cap->card, sizeof(cap->card), "mmal service %d.%d", major, minor); - snprintf(cap->bus_info, sizeof(cap->bus_info), + snprintf((char *)cap->bus_info, sizeof(cap->bus_info), "platform:%s", dev->v4l2_dev.name); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; @@ -935,7 +935,7 @@ static int vidioc_enum_fmt_vid_cap(struc fmt = &formats[f->index]; - strlcpy(f->description, fmt->name, sizeof(f->description)); + strlcpy((char *)f->description, fmt->name, sizeof(f->description)); f->pixelformat = fmt->fourcc; f->flags = fmt->flags;