4cdef53f98e471e5488c0e83efbc165ea90a34dd
[openwrt/staging/chunkeey.git] /
1 From 2c6ce48e18a2a95743de7a84faefd52d090c2a56 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Thu, 10 May 2018 12:42:18 -0700
4 Subject: [PATCH 377/454] staging: bcm2835-camera: Fix warnings about string
5 ops on v4l2 uapi.
6
7 commit 40b73e16675ee2e77358ed1cfc3364c8bf000e4f upstream.
8
9 The v4l2 uapi uses u8[] for strings, so cast those to char * to avoid
10 compiler warnings about unsigned vs signed with sprintf() and friends.
11
12 Signed-off-by: Eric Anholt <eric@anholt.net>
13 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14 ---
15 .../vc04_services/bcm2835-camera/bcm2835-camera.c | 12 ++++++------
16 1 file changed, 6 insertions(+), 6 deletions(-)
17
18 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
19 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
20 @@ -726,7 +726,7 @@ static int vidioc_enum_fmt_vid_overlay(s
21
22 fmt = &formats[f->index];
23
24 - strlcpy(f->description, fmt->name, sizeof(f->description));
25 + strlcpy((char *)f->description, fmt->name, sizeof(f->description));
26 f->pixelformat = fmt->fourcc;
27 f->flags = fmt->flags;
28
29 @@ -884,7 +884,7 @@ static int vidioc_enum_input(struct file
30 return -EINVAL;
31
32 inp->type = V4L2_INPUT_TYPE_CAMERA;
33 - sprintf(inp->name, "Camera %u", inp->index);
34 + sprintf((char *)inp->name, "Camera %u", inp->index);
35 return 0;
36 }
37
38 @@ -912,11 +912,11 @@ static int vidioc_querycap(struct file *
39
40 vchiq_mmal_version(dev->instance, &major, &minor);
41
42 - strcpy(cap->driver, "bm2835 mmal");
43 - snprintf(cap->card, sizeof(cap->card), "mmal service %d.%d",
44 + strcpy((char *)cap->driver, "bm2835 mmal");
45 + snprintf((char *)cap->card, sizeof(cap->card), "mmal service %d.%d",
46 major, minor);
47
48 - snprintf(cap->bus_info, sizeof(cap->bus_info),
49 + snprintf((char *)cap->bus_info, sizeof(cap->bus_info),
50 "platform:%s", dev->v4l2_dev.name);
51 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY |
52 V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
53 @@ -935,7 +935,7 @@ static int vidioc_enum_fmt_vid_cap(struc
54
55 fmt = &formats[f->index];
56
57 - strlcpy(f->description, fmt->name, sizeof(f->description));
58 + strlcpy((char *)f->description, fmt->name, sizeof(f->description));
59 f->pixelformat = fmt->fourcc;
60 f->flags = fmt->flags;
61