diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-05-25 07:47:48 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-05-25 07:47:48 +0000 |
commit | 2bb33be3f61e19ed98077eeb17cf20de10556487 (patch) | |
tree | cede9cb5a810d869e9eb3fb11e7081bf448ceee3 | |
parent | 57ca846a119b68e6a0c20f8ae08b6bd07e0345bf (diff) |
Spacing. Comments. strncpy() -> strlcpy().
-rw-r--r-- | sys/dev/usb/uvideo.c | 32 | ||||
-rw-r--r-- | sys/dev/video.c | 10 | ||||
-rw-r--r-- | sys/dev/video_if.h | 3 | ||||
-rw-r--r-- | sys/dev/videovar.h | 16 |
4 files changed, 33 insertions, 28 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 1ca14d2fdf2..f28b433c610 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.17 2008/05/24 19:37:34 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.18 2008/05/25 07:47:47 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -97,8 +97,7 @@ void uvideo_vs_start(struct uvideo_softc *); void uvideo_vs_cb(usbd_xfer_handle, usbd_private_handle, usbd_status); int uvideo_vs_decode_stream_header(struct uvideo_softc *, - uint8_t *, int); - + uint8_t *, int); #ifdef UVIDEO_DEBUG void uvideo_dump_desc_all(struct uvideo_softc *); void uvideo_dump_desc_vc_header(struct uvideo_softc *, @@ -128,6 +127,9 @@ int uvideo_debug_file_open(struct uvideo_softc *); void uvideo_debug_file_write_sample(void *); #endif +/* + * IOCTL's + */ int uvideo_querycap(void *, struct v4l2_capability *); int uvideo_s_fmt(void *, struct v4l2_format *); int uvideo_g_fmt(void *, struct v4l2_format *); @@ -1613,28 +1615,30 @@ uvideo_debug_file_write_sample(void *arg) } #endif +/* + * IOCTL's + */ int -uvideo_querycap(void *v, struct v4l2_capability * caps) +uvideo_querycap(void *v, struct v4l2_capability *caps) { struct uvideo_softc *sc = v; bzero(caps, sizeof(caps)); - strlcpy(caps->driver, DEVNAME(sc), - sizeof(caps->driver)); - strncpy(caps->card, "Generic USB video class device", - sizeof(caps->card)); - strncpy(caps->bus_info, "usb", sizeof(caps->bus_info)); + strlcpy(caps->driver, DEVNAME(sc), sizeof(caps->driver)); + strlcpy(caps->card, "Generic USB video class device", + sizeof(caps->card)); + strlcpy(caps->bus_info, "usb", sizeof(caps->bus_info)); caps->version = 1; caps->capabilities = V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_STREAMING - | V4L2_CAP_READWRITE; + | V4L2_CAP_STREAMING + | V4L2_CAP_READWRITE; return (0); } int -uvideo_s_fmt(void *v, struct v4l2_format * fmt) +uvideo_s_fmt(void *v, struct v4l2_format *fmt) { if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return (EINVAL); @@ -1643,7 +1647,7 @@ uvideo_s_fmt(void *v, struct v4l2_format * fmt) } int -uvideo_g_fmt(void *v, struct v4l2_format * fmt) +uvideo_g_fmt(void *v, struct v4l2_format *fmt) { if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return (EINVAL); @@ -1652,7 +1656,7 @@ uvideo_g_fmt(void *v, struct v4l2_format * fmt) } int -uvideo_reqbufs(void *v, struct v4l2_requestbuffers * rb) +uvideo_reqbufs(void *v, struct v4l2_requestbuffers *rb) { return (0); } diff --git a/sys/dev/video.c b/sys/dev/video.c index a525d1e733f..ffb8dbcd182 100644 --- a/sys/dev/video.c +++ b/sys/dev/video.c @@ -1,4 +1,4 @@ -/* $OpenBSD: video.c,v 1.2 2008/05/24 19:37:34 mglocker Exp $ */ +/* $OpenBSD: video.c,v 1.3 2008/05/25 07:47:47 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> * @@ -163,24 +163,24 @@ videoioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) case VIDIOC_QUERYCAP: if (sc->hw_if->querycap) error = (sc->hw_if->querycap)(sc->hw_hdl, - (struct v4l2_capability *)data); + (struct v4l2_capability *)data); break; case VIDIOC_S_FMT: if (!(flags & FWRITE)) return (EACCES); if (sc->hw_if->s_fmt) error = (sc->hw_if->s_fmt)(sc->hw_hdl, - (struct v4l2_format *)data); + (struct v4l2_format *)data); break; case VIDIOC_G_FMT: if (sc->hw_if->g_fmt) error = (sc->hw_if->g_fmt)(sc->hw_hdl, - (struct v4l2_format *)data); + (struct v4l2_format *)data); break; case VIDIOC_REQBUFS: if (sc->hw_if->reqbufs) error = (sc->hw_if->reqbufs)(sc->hw_hdl, - (struct v4l2_requestbuffers *)data); + (struct v4l2_requestbuffers *)data); break; case VIDIOC_QUERYBUF: case VIDIOC_QBUF: diff --git a/sys/dev/video_if.h b/sys/dev/video_if.h index 7ee06b05645..464ae8c8c4e 100644 --- a/sys/dev/video_if.h +++ b/sys/dev/video_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: video_if.h,v 1.2 2008/05/24 19:37:34 mglocker Exp $ */ +/* $OpenBSD: video_if.h,v 1.3 2008/05/25 07:47:47 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> * @@ -32,6 +32,7 @@ struct video_hw_if { /* close hardware */ int (*close)(void *); + /* ioctl's */ int (*querycap)(void *, struct v4l2_capability *); int (*s_fmt)(void *, struct v4l2_format *); int (*g_fmt)(void *, struct v4l2_format *); diff --git a/sys/dev/videovar.h b/sys/dev/videovar.h index 53999bfe958..c8fdcb00a87 100644 --- a/sys/dev/videovar.h +++ b/sys/dev/videovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: videovar.h,v 1.2 2008/05/24 19:37:34 mglocker Exp $ */ +/* $OpenBSD: videovar.h,v 1.3 2008/05/25 07:47:47 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> * @@ -19,14 +19,14 @@ #define _SYS_DEV_VIDEOVAR_H struct video_softc { - struct device dev; - void *hw_hdl; /* hardware driver handle */ - struct device *sc_dev; /* hardware device struct */ - struct video_hw_if *hw_if; /* hardware interface */ - char sc_dying; /* device detached */ + struct device dev; + void *hw_hdl; /* hardware driver handle */ + struct device *sc_dev; /* hardware device struct */ + struct video_hw_if *hw_if; /* hardware interface */ + char sc_dying; /* device detached */ - int sc_fsize; - uint8_t *sc_fbuffer; + int sc_fsize; + uint8_t *sc_fbuffer; }; #endif /* _SYS_DEV_VIDEOVAR_H */ |