Skip to content

Commit 40b73e1

Browse files
anholtgregkh
authored andcommitted
staging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.
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 <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6166045 commit 40b73e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static int vidioc_enum_fmt_vid_overlay(struct file *file, void *priv,
693693

694694
fmt = &formats[f->index];
695695

696-
strlcpy(f->description, fmt->name, sizeof(f->description));
696+
strlcpy((char *)f->description, fmt->name, sizeof(f->description));
697697
f->pixelformat = fmt->fourcc;
698698
f->flags = fmt->flags;
699699

@@ -851,7 +851,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
851851
return -EINVAL;
852852

853853
inp->type = V4L2_INPUT_TYPE_CAMERA;
854-
sprintf(inp->name, "Camera %u", inp->index);
854+
sprintf((char *)inp->name, "Camera %u", inp->index);
855855
return 0;
856856
}
857857

@@ -879,11 +879,11 @@ static int vidioc_querycap(struct file *file, void *priv,
879879

880880
vchiq_mmal_version(dev->instance, &major, &minor);
881881

882-
strcpy(cap->driver, "bm2835 mmal");
883-
snprintf(cap->card, sizeof(cap->card), "mmal service %d.%d",
882+
strcpy((char *)cap->driver, "bm2835 mmal");
883+
snprintf((char *)cap->card, sizeof(cap->card), "mmal service %d.%d",
884884
major, minor);
885885

886-
snprintf(cap->bus_info, sizeof(cap->bus_info),
886+
snprintf((char *)cap->bus_info, sizeof(cap->bus_info),
887887
"platform:%s", dev->v4l2_dev.name);
888888
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY |
889889
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
@@ -902,7 +902,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
902902

903903
fmt = &formats[f->index];
904904

905-
strlcpy(f->description, fmt->name, sizeof(f->description));
905+
strlcpy((char *)f->description, fmt->name, sizeof(f->description));
906906
f->pixelformat = fmt->fourcc;
907907
f->flags = fmt->flags;
908908

0 commit comments

Comments
 (0)