* [REVIEW PATCH 0/5] v4l2: constify _IOW ioctls
@ 2013-03-15 10:27 Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
0 siblings, 1 reply; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary
This is the second and last phase of ensuring that the arguments of write-only
ioctls in V4L2 are const. The first phase was 4-5 months ago and added const
to s_crop, s_modulator, s_audio, s_audout, (un)subscribe_event, s_freq_hw_seek,
s_jpegcomp and s_fbuf.
This second phase adds const to s_frequency, s_tuner, s_std and s_register.
Actually, for s_std it doesn't add const but changes it to pass the std by
value which is more consistent in that particular case.
As a result drivers will be aware when they are implementing write-only ioctls
(and I saw a few drivers attempting to return data back to the user), and the
v4l2 core will know that drivers won't change the argument of a write-only
ioctls which simplifies the core debug code.
The changes have been compile-tested with the linux-media daily build but
I may have missed some more exotic architectures.
Ideally I would like to have this merged fairly early on so we have enough
time to shake out any remaining compile problems.
Regards,
Hans
^ permalink raw reply [flat|nested] 21+ messages in thread
* [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl.
2013-03-15 10:27 [REVIEW PATCH 0/5] v4l2: constify _IOW ioctls Hans Verkuil
@ 2013-03-15 10:27 ` Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
` (4 more replies)
0 siblings, 5 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary, Hans Verkuil
From: Hans Verkuil <hans.verkuil@cisco.com>
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/i2c/cx25840/cx25840-core.c | 2 +-
drivers/media/i2c/msp3400-driver.c | 2 +-
drivers/media/i2c/tvaudio.c | 2 +-
drivers/media/i2c/upd64031a.c | 2 +-
drivers/media/i2c/wm8775.c | 2 +-
drivers/media/pci/bt8xx/bttv-driver.c | 14 ++++---
drivers/media/pci/cx18/cx18-av-core.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.h | 2 +-
drivers/media/pci/cx23885/cx23885-417.c | 2 +-
drivers/media/pci/cx23885/cx23885-video.c | 8 ++--
drivers/media/pci/cx23885/cx23885.h | 2 +-
drivers/media/pci/cx25821/cx25821-video.c | 4 +-
drivers/media/pci/cx25821/cx25821-video.h | 4 +-
drivers/media/pci/cx88/cx88-blackbird.c | 2 +-
drivers/media/pci/cx88/cx88-video.c | 10 +++--
drivers/media/pci/cx88/cx88.h | 2 +-
drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +-
drivers/media/pci/ivtv/ivtv-ioctl.h | 2 +-
drivers/media/pci/saa7134/saa7134-video.c | 2 +-
drivers/media/pci/saa7146/mxb.c | 4 +-
drivers/media/pci/saa7164/saa7164-encoder.c | 2 +-
drivers/media/pci/saa7164/saa7164-vbi.c | 2 +-
drivers/media/pci/ttpci/av7110_v4l.c | 2 +-
drivers/media/radio/dsbr100.c | 2 +-
drivers/media/radio/radio-cadet.c | 46 +++++++++++-----------
drivers/media/radio/radio-isa.c | 9 +++--
drivers/media/radio/radio-keene.c | 9 +++--
drivers/media/radio/radio-ma901.c | 2 +-
drivers/media/radio/radio-miropcm20.c | 4 +-
drivers/media/radio/radio-mr800.c | 2 +-
drivers/media/radio/radio-sf16fmi.c | 2 +-
drivers/media/radio/radio-si4713.c | 2 +-
drivers/media/radio/radio-tea5764.c | 2 +-
drivers/media/radio/radio-tea5777.c | 2 +-
drivers/media/radio/radio-timb.c | 2 +-
drivers/media/radio/radio-wl1273.c | 2 +-
drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
drivers/media/radio/si4713-i2c.c | 5 +--
drivers/media/radio/tef6862.c | 2 +-
drivers/media/radio/wl128x/fmdrv_v4l2.c | 6 +--
drivers/media/usb/au0828/au0828-video.c | 2 +-
drivers/media/usb/cx231xx/cx231xx-video.c | 7 ++--
drivers/media/usb/cx231xx/cx231xx.h | 2 +-
drivers/media/usb/em28xx/em28xx-video.c | 7 ++--
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +-
drivers/media/usb/tlg2300/pd-radio.c | 2 +-
drivers/media/usb/tlg2300/pd-video.c | 5 ++-
drivers/media/usb/tm6000/tm6000-video.c | 2 +-
drivers/media/usb/usbvision/usbvision-video.c | 2 +-
drivers/media/v4l2-core/tuner-core.c | 2 +-
drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
drivers/staging/media/go7007/go7007-v4l2.c | 2 +-
include/media/v4l2-ioctl.h | 2 +-
include/media/v4l2-subdev.h | 2 +-
sound/i2c/other/tea575x-tuner.c | 4 +-
56 files changed, 116 insertions(+), 110 deletions(-)
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index f4149eb..f4339ed 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1835,7 +1835,7 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd,
return set_input(client, state->vid_input, input);
}
-static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+static int cx25840_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c
index 766305f..77053ba 100644
--- a/drivers/media/i2c/msp3400-driver.c
+++ b/drivers/media/i2c/msp3400-driver.c
@@ -445,7 +445,7 @@ static int msp_s_radio(struct v4l2_subdev *sd)
return 0;
}
-static int msp_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+static int msp_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/tvaudio.c b/drivers/media/i2c/tvaudio.c
index 4c91b35..4b12c51 100644
--- a/drivers/media/i2c/tvaudio.c
+++ b/drivers/media/i2c/tvaudio.c
@@ -1817,7 +1817,7 @@ static int tvaudio_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}
-static int tvaudio_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+static int tvaudio_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{
struct CHIPSTATE *chip = to_state(sd);
struct CHIPDESC *desc = chip->desc;
diff --git a/drivers/media/i2c/upd64031a.c b/drivers/media/i2c/upd64031a.c
index 1e74465..d15cfd9 100644
--- a/drivers/media/i2c/upd64031a.c
+++ b/drivers/media/i2c/upd64031a.c
@@ -111,7 +111,7 @@ static void upd64031a_write(struct v4l2_subdev *sd, u8 reg, u8 val)
/* ------------------------------------------------------------------------ */
/* The input changed due to new input or channel changed */
-static int upd64031a_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+static int upd64031a_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{
struct upd64031a_state *state = to_state(sd);
u8 reg = state->regs[R00];
diff --git a/drivers/media/i2c/wm8775.c b/drivers/media/i2c/wm8775.c
index bee77ea..27c27b4 100644
--- a/drivers/media/i2c/wm8775.c
+++ b/drivers/media/i2c/wm8775.c
@@ -174,7 +174,7 @@ static int wm8775_log_status(struct v4l2_subdev *sd)
return 0;
}
-static int wm8775_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)
+static int wm8775_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{
wm8775_set_audio(sd, 0);
return 0;
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 8610b6a..7816edc 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1850,24 +1850,26 @@ static int bttv_g_frequency(struct file *file, void *priv,
return 0;
}
-static void bttv_set_frequency(struct bttv *btv, struct v4l2_frequency *f)
+static void bttv_set_frequency(struct bttv *btv, const struct v4l2_frequency *f)
{
+ struct v4l2_frequency new_freq = *f;
+
bttv_call_all(btv, tuner, s_frequency, f);
/* s_frequency may clamp the frequency, so get the actual
frequency before assigning radio/tv_freq. */
- bttv_call_all(btv, tuner, g_frequency, f);
- if (f->type == V4L2_TUNER_RADIO) {
+ bttv_call_all(btv, tuner, g_frequency, &new_freq);
+ if (new_freq.type == V4L2_TUNER_RADIO) {
radio_enable(btv);
- btv->radio_freq = f->frequency;
+ btv->radio_freq = new_freq.frequency;
if (btv->has_matchbox)
tea5757_set_freq(btv, btv->radio_freq);
} else {
- btv->tv_freq = f->frequency;
+ btv->tv_freq = new_freq.frequency;
}
}
static int bttv_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c
index f164b7f..a2c51e0 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -576,7 +576,7 @@ static void input_change(struct cx18 *cx)
}
static int cx18_av_s_frequency(struct v4l2_subdev *sd,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct cx18 *cx = v4l2_get_subdevdata(sd);
input_change(cx);
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index cd8d2c2..5cd22e7 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -614,7 +614,7 @@ static int cx18_g_frequency(struct file *file, void *fh,
return 0;
}
-int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
+int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf)
{
struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx;
diff --git a/drivers/media/pci/cx18/cx18-ioctl.h b/drivers/media/pci/cx18/cx18-ioctl.h
index 2f9dd59..aa9b44a 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.h
+++ b/drivers/media/pci/cx18/cx18-ioctl.h
@@ -27,5 +27,5 @@ void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal);
u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt);
void cx18_set_funcs(struct video_device *vdev);
int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
-int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
+int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
int cx18_s_input(struct file *file, void *fh, unsigned int inp);
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index 5d5052d..84a1b75 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1311,7 +1311,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
return cx23885_set_frequency(file, priv, f);
}
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index 5991bc8..5ba15b8 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -1518,7 +1518,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
return 0;
}
-static int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)
+static int cx23885_set_freq(struct cx23885_dev *dev, const struct v4l2_frequency *f)
{
struct v4l2_control ctrl;
@@ -1550,7 +1550,7 @@ static int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)
}
static int cx23885_set_freq_via_ops(struct cx23885_dev *dev,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct v4l2_control ctrl;
struct videobuf_dvb_frontend *vfe;
@@ -1608,7 +1608,7 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev,
}
int cx23885_set_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cx23885_fh *fh = priv;
struct cx23885_dev *dev = fh->dev;
@@ -1628,7 +1628,7 @@ int cx23885_set_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
return cx23885_set_frequency(file, priv, f);
}
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
index 59c322d..5687d3f 100644
--- a/drivers/media/pci/cx23885/cx23885.h
+++ b/drivers/media/pci/cx23885/cx23885.h
@@ -587,7 +587,7 @@ extern void cx23885_video_wakeup(struct cx23885_dev *dev,
int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i);
int cx23885_set_input(struct file *file, void *priv, unsigned int i);
int cx23885_get_input(struct file *file, void *priv, unsigned int *i);
-int cx23885_set_frequency(struct file *file, void *priv, struct v4l2_frequency *f);
+int cx23885_set_frequency(struct file *file, void *priv, const struct v4l2_frequency *f);
int cx23885_set_control(struct cx23885_dev *dev, struct v4l2_control *ctl);
int cx23885_get_control(struct cx23885_dev *dev, struct v4l2_control *ctl);
int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm);
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index d4de021..1219d60 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1312,7 +1312,7 @@ int cx25821_vidioc_g_frequency(struct file *file, void *priv,
return 0;
}
-int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f)
+int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f)
{
mutex_lock(&dev->lock);
dev->freq = f->frequency;
@@ -1328,7 +1328,7 @@ int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f)
}
int cx25821_vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cx25821_fh *fh = priv;
struct cx25821_dev *dev;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index c265e35..969340c 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -149,9 +149,9 @@ extern int cx25821_vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f);
extern int cx25821_vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f);
-extern int cx25821_set_freq(struct cx25821_dev *dev, struct v4l2_frequency *f);
+extern int cx25821_set_freq(struct cx25821_dev *dev, const struct v4l2_frequency *f);
extern int cx25821_vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f);
+ const struct v4l2_frequency *f);
extern int cx25821_vidioc_g_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg);
extern int cx25821_vidioc_s_register(struct file *file, void *fh,
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index a6ff8a6..82aa11f 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -815,7 +815,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
}
static int vidioc_s_frequency (struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cx8802_fh *fh = priv;
struct cx8802_dev *dev = fh->dev;
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index bc78354..4f10875 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1321,8 +1321,10 @@ static int vidioc_g_frequency (struct file *file, void *priv,
}
int cx88_set_freq (struct cx88_core *core,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
+ struct v4l2_frequency new_freq = *f;
+
if (unlikely(UNSET == core->board.tuner_type))
return -EINVAL;
if (unlikely(f->tuner != 0))
@@ -1331,8 +1333,8 @@ int cx88_set_freq (struct cx88_core *core,
mutex_lock(&core->lock);
cx88_newstation(core);
call_all(core, tuner, s_frequency, f);
- call_all(core, tuner, g_frequency, f);
- core->freq = f->frequency;
+ call_all(core, tuner, g_frequency, &new_freq);
+ core->freq = new_freq.frequency;
/* When changing channels it is required to reset TVAUDIO */
msleep (10);
@@ -1345,7 +1347,7 @@ int cx88_set_freq (struct cx88_core *core,
EXPORT_SYMBOL(cx88_set_freq);
static int vidioc_s_frequency (struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cx8800_fh *fh = priv;
struct cx88_core *core = fh->dev->core;
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index feff53c..eca02c2 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -740,7 +740,7 @@ void cx8802_cancel_buffers(struct cx8802_dev *dev);
/* ----------------------------------------------------------- */
/* cx88-video.c*/
int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i);
-int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f);
+int cx88_set_freq(struct cx88_core *core, const struct v4l2_frequency *f);
int cx88_video_mux(struct cx88_core *core, unsigned int input);
void cx88_querycap(struct file *file, struct cx88_core *core,
struct v4l2_capability *cap);
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 7a8b0d0..e6258b6 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1078,7 +1078,7 @@ static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *
return 0;
}
-int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
+int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf)
{
struct ivtv *itv = fh2id(fh)->itv;
struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.h b/drivers/media/pci/ivtv/ivtv-ioctl.h
index 7c553d1..34c6bc1 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.h
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.h
@@ -29,7 +29,7 @@ int ivtv_set_speed(struct ivtv *itv, int speed);
void ivtv_set_funcs(struct video_device *vdev);
void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std);
void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std);
-int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
+int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
#endif
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 7c503fb..6c619d1 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2057,7 +2057,7 @@ static int saa7134_g_frequency(struct file *file, void *priv,
}
static int saa7134_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 91369da..27dc49b 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -595,7 +595,7 @@ static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency
return 0;
}
-static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f)
+static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
@@ -612,8 +612,8 @@ static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency
/* tune in desired frequency */
tuner_call(mxb, tuner, s_frequency, f);
/* let the tuner subdev clamp the frequency to the tuner range */
- tuner_call(mxb, tuner, g_frequency, f);
mxb->cur_freq = *f;
+ tuner_call(mxb, tuner, g_frequency, &mxb->cur_freq);
if (mxb->cur_audinput == 0)
mxb_update_audmode(mxb);
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 9bb0903..34f700d 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -337,7 +337,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct saa7164_encoder_fh *fh = file->private_data;
struct saa7164_port *port = fh->port;
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index b453229..5a8a6ad 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -309,7 +309,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct saa7164_vbi_fh *fh = file->private_data;
struct saa7164_port *port = fh->port;
diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c
index 730e906..65adaa7 100644
--- a/drivers/media/pci/ttpci/av7110_v4l.c
+++ b/drivers/media/pci/ttpci/av7110_v4l.c
@@ -426,7 +426,7 @@ static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency
return 0;
}
-static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f)
+static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 63b112b..e140a72 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -214,7 +214,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct dsbr100_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 643d80a..59be293 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -90,6 +90,26 @@ static u16 sigtable[2][4] = {
{ 2185, 4369, 13107, 65535 },
};
+static const struct v4l2_frequency_band bands[] = {
+ {
+ .index = 0,
+ .type = V4L2_TUNER_RADIO,
+ .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_FREQ_BANDS,
+ .rangelow = 8320, /* 520 kHz */
+ .rangehigh = 26400, /* 1650 kHz */
+ .modulation = V4L2_BAND_MODULATION_AM,
+ }, {
+ .index = 1,
+ .type = V4L2_TUNER_RADIO,
+ .capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS |
+ V4L2_TUNER_CAP_RDS_BLOCK_IO | V4L2_TUNER_CAP_LOW |
+ V4L2_TUNER_CAP_FREQ_BANDS,
+ .rangelow = 1400000, /* 87.5 MHz */
+ .rangehigh = 1728000, /* 108.0 MHz */
+ .modulation = V4L2_BAND_MODULATION_FM,
+ },
+};
+
static int cadet_getstereo(struct cadet *dev)
{
@@ -196,6 +216,8 @@ static void cadet_setfreq(struct cadet *dev, unsigned freq)
int i, j, test;
int curvol;
+ freq = clamp(freq, bands[dev->is_fm_band].rangelow,
+ bands[dev->is_fm_band].rangehigh);
dev->curfreq = freq;
/*
* Formulate a fifo command
@@ -337,26 +359,6 @@ static int vidioc_querycap(struct file *file, void *priv,
return 0;
}
-static const struct v4l2_frequency_band bands[] = {
- {
- .index = 0,
- .type = V4L2_TUNER_RADIO,
- .capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_FREQ_BANDS,
- .rangelow = 8320, /* 520 kHz */
- .rangehigh = 26400, /* 1650 kHz */
- .modulation = V4L2_BAND_MODULATION_AM,
- }, {
- .index = 1,
- .type = V4L2_TUNER_RADIO,
- .capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS |
- V4L2_TUNER_CAP_RDS_BLOCK_IO | V4L2_TUNER_CAP_LOW |
- V4L2_TUNER_CAP_FREQ_BANDS,
- .rangelow = 1400000, /* 87.5 MHz */
- .rangehigh = 1728000, /* 108.0 MHz */
- .modulation = V4L2_BAND_MODULATION_FM,
- },
-};
-
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
@@ -418,7 +420,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cadet *dev = video_drvdata(file);
@@ -426,8 +428,6 @@ static int vidioc_s_frequency(struct file *file, void *priv,
return -EINVAL;
dev->is_fm_band =
f->frequency >= (bands[0].rangehigh + bands[1].rangelow) / 2;
- clamp(f->frequency, bands[dev->is_fm_band].rangelow,
- bands[dev->is_fm_band].rangehigh);
cadet_setfreq(dev, f->frequency);
return 0;
}
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c
index fe0a4f8..0c1e27b 100644
--- a/drivers/media/radio/radio-isa.c
+++ b/drivers/media/radio/radio-isa.c
@@ -102,17 +102,18 @@ static int radio_isa_s_tuner(struct file *file, void *priv,
}
static int radio_isa_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct radio_isa_card *isa = video_drvdata(file);
+ u32 freq = f->frequency;
int res;
if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
return -EINVAL;
- f->frequency = clamp(f->frequency, FREQ_LOW, FREQ_HIGH);
- res = isa->drv->ops->s_frequency(isa, f->frequency);
+ freq = clamp(freq, FREQ_LOW, FREQ_HIGH);
+ res = isa->drv->ops->s_frequency(isa, freq);
if (res == 0)
- isa->freq = f->frequency;
+ isa->freq = freq;
return res;
}
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index 296941a..a90b7a8 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -82,9 +82,12 @@ static inline struct keene_device *to_keene_dev(struct v4l2_device *v4l2_dev)
/* Set frequency (if non-0), PA, mute and turn on/off the FM transmitter. */
static int keene_cmd_main(struct keene_device *radio, unsigned freq, bool play)
{
- unsigned short freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
+ unsigned short freq_send;
int ret;
+ if (freq)
+ freq = clamp(freq, FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
+ freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
radio->buffer[0] = 0x00;
radio->buffer[1] = 0x50;
radio->buffer[2] = (freq_send >> 8) & 0xff;
@@ -215,14 +218,12 @@ static int vidioc_s_modulator(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct keene_device *radio = video_drvdata(file);
if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
return -EINVAL;
- f->frequency = clamp(f->frequency,
- FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
return keene_cmd_main(radio, f->frequency, true);
}
diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c
index c61f590..7f85c6f 100644
--- a/drivers/media/radio/radio-ma901.c
+++ b/drivers/media/radio/radio-ma901.c
@@ -257,7 +257,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
/* vidioc_s_frequency - set tuner radio frequency */
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct ma901radio_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c
index 3d0ff44..2b8d31d 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -131,14 +131,14 @@ static int vidioc_g_frequency(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct pcm20 *dev = video_drvdata(file);
if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
return -EINVAL;
- dev->freq = clamp(f->frequency, 87 * 16000U, 108 * 16000U);
+ dev->freq = clamp_t(u32, f->frequency, 87 * 16000U, 108 * 16000U);
pcm20_setfreq(dev, dev->freq);
return 0;
}
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 9c5a267..f9cdd8b 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -323,7 +323,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
/* vidioc_s_frequency - set tuner radio frequency */
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct amradio_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 637a555..6142b5b 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -151,7 +151,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct fmi *fmi = video_drvdata(file);
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index 1507c9d..c1a0879 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -214,7 +214,7 @@ static int radio_si4713_g_frequency(struct file *file, void *p,
}
static int radio_si4713_s_frequency(struct file *file, void *p,
- struct v4l2_frequency *vf)
+ const struct v4l2_frequency *vf)
{
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner,
s_frequency, vf);
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 1978516..8938428 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -351,7 +351,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct tea5764_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c
index 4b5190d..fcd7c19 100644
--- a/drivers/media/radio/radio-tea5777.c
+++ b/drivers/media/radio/radio-tea5777.c
@@ -368,7 +368,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct radio_tea5777 *tea = video_drvdata(file);
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index b87effe..1712c05 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -91,7 +91,7 @@ static int timbradio_vidioc_s_audio(struct file *file, void *priv,
}
static int timbradio_vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct timbradio *tr = video_drvdata(file);
return v4l2_subdev_call(tr->sd_tuner, tuner, s_frequency, f);
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 02151e0..9a02fee 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1640,7 +1640,7 @@ static int wl1273_fm_vidioc_g_frequency(struct file *file, void *priv,
}
static int wl1273_fm_vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
struct wl1273_core *core = radio->core;
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 1898938..5708633 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -678,7 +678,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
* si470x_vidioc_s_frequency - set tuner or modulator radio frequency
*/
static int si470x_vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct si470x_device *radio = video_drvdata(file);
int retval;
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c
index bd61b3b..e305c14 100644
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1212,7 +1212,7 @@ exit:
return rval;
}
-static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f);
+static int si4713_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f);
static int si4713_s_modulator(struct v4l2_subdev *sd, const struct v4l2_modulator *);
/*
* si4713_setup - Sets the device up with current configuration.
@@ -1950,7 +1950,7 @@ unlock:
}
/* si4713_s_frequency - set tuner or modulator radio frequency */
-static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
+static int si4713_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
{
struct si4713_device *sdev = to_si4713_device(sd);
int rval = 0;
@@ -1970,7 +1970,6 @@ static int si4713_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
rval = 0;
}
sdev->frequency = frequency;
- f->frequency = si4713_to_v4l2(frequency);
unlock:
mutex_unlock(&sdev->mutex);
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index b18c2dc..8673955 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -101,7 +101,7 @@ static int tef6862_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
return v->index ? -EINVAL : 0;
}
-static int tef6862_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
+static int tef6862_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
{
struct tef6862_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index 0a8ee8f..0183956 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -388,7 +388,7 @@ static int fm_v4l2_vidioc_g_freq(struct file *file, void *priv,
/* Set tuner or modulator radio frequency */
static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct fmdev *fmdev = video_drvdata(file);
@@ -396,9 +396,7 @@ static int fm_v4l2_vidioc_s_freq(struct file *file, void *priv,
* As V4L2_TUNER_CAP_LOW is set 1 user sends the frequency
* in units of 62.5 Hz.
*/
- freq->frequency = (u32)(freq->frequency / 16);
-
- return fmc_set_freq(fmdev, freq->frequency);
+ return fmc_set_freq(fmdev, freq->frequency / 16);
}
/* Set hardware frequency seek. If current mode is NOT RX, set it RX. */
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 8b9e826..b1d6b03 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1545,7 +1545,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index ac62008..96f6531 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1172,10 +1172,11 @@ int cx231xx_g_frequency(struct file *file, void *priv,
}
int cx231xx_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
+ struct v4l2_frequency new_freq = *f;
int rc;
u32 if_frequency = 5400000;
@@ -1194,8 +1195,8 @@ int cx231xx_s_frequency(struct file *file, void *priv,
rc = cx231xx_tuner_pre_channel_change(dev);
call_all(dev, tuner, s_frequency, f);
- call_all(dev, tuner, g_frequency, f);
- dev->ctl_freq = f->frequency;
+ call_all(dev, tuner, g_frequency, &new_freq);
+ dev->ctl_freq = new_freq.frequency;
/* set post channel change settings in DIF first */
rc = cx231xx_tuner_post_channel_change(dev);
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index a8e50d2..0a6071b 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -939,7 +939,7 @@ int cx231xx_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
int cx231xx_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f);
int cx231xx_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f);
+ const struct v4l2_frequency *f);
int cx231xx_enum_input(struct file *file, void *priv,
struct v4l2_input *i);
int cx231xx_g_input(struct file *file, void *priv, unsigned int *i);
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 93fc620..42173d9 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1219,8 +1219,9 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
+ struct v4l2_frequency new_freq = *f;
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
@@ -1228,8 +1229,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
return -EINVAL;
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f);
- v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_frequency, f);
- dev->ctl_freq = f->frequency;
+ v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_frequency, &new_freq);
+ dev->ctl_freq = new_freq.frequency;
return 0;
}
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 34c3b6e..75657c6 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -365,7 +365,7 @@ static int pvr2_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
vt->audmode);
}
-static int pvr2_s_frequency(struct file *file, void *priv, struct v4l2_frequency *vf)
+static int pvr2_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *vf)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
index 0f958f7..8b1daf1 100644
--- a/drivers/media/usb/tlg2300/pd-radio.c
+++ b/drivers/media/usb/tlg2300/pd-radio.c
@@ -252,7 +252,7 @@ error:
}
static int fm_set_freq(struct file *file, void *priv,
- struct v4l2_frequency *argp)
+ const struct v4l2_frequency *argp)
{
struct poseidon *p = video_drvdata(file);
diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index dab0ca3..8ef7c8c 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -1079,10 +1079,11 @@ static int set_frequency(struct poseidon *pd, u32 *frequency)
}
static int vidioc_s_frequency(struct file *file, void *fh,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct front_face *front = fh;
struct poseidon *pd = front->pd;
+ u32 frequency = freq->frequency;
if (freq->tuner)
return -EINVAL;
@@ -1090,7 +1091,7 @@ static int vidioc_s_frequency(struct file *file, void *fh,
pd->pm_suspend = pm_video_suspend;
pd->pm_resume = pm_video_resume;
#endif
- return set_frequency(pd, &freq->frequency);
+ return set_frequency(pd, &frequency);
}
static int vidioc_reqbufs(struct file *file, void *fh,
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 1a68579..49df753 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1255,7 +1255,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev;
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index cd1fe78..b668445 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -657,7 +657,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *freq)
+ const struct v4l2_frequency *freq)
{
struct usb_usbvision *usbvision = video_drvdata(file);
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index b5a8aac..279f65e 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -1134,7 +1134,7 @@ static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
return 0;
}
-static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
+static int tuner_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *f)
{
struct tuner *t = to_tuner(sd);
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index aa6e7c7..8ec8abe 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1316,7 +1316,7 @@ static int v4l_s_frequency(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct video_device *vfd = video_devdata(file);
- struct v4l2_frequency *p = arg;
+ const struct v4l2_frequency *p = arg;
enum v4l2_tuner_type type;
type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index cb9fe33..1288f1c 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1281,7 +1281,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct go7007 *go = ((struct go7007_file *) priv)->go;
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 4118ad1..f06436d 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -223,7 +223,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_g_frequency) (struct file *file, void *fh,
struct v4l2_frequency *a);
int (*vidioc_s_frequency) (struct file *file, void *fh,
- struct v4l2_frequency *a);
+ const struct v4l2_frequency *a);
int (*vidioc_enum_freq_bands) (struct file *file, void *fh,
struct v4l2_frequency_band *band);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index b137a5e..1a82a50 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -191,7 +191,7 @@ struct v4l2_subdev_core_ops {
*/
struct v4l2_subdev_tuner_ops {
int (*s_radio)(struct v4l2_subdev *sd);
- int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
+ int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 3c6c1e3..738c5ad 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -336,7 +336,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
}
static int vidioc_s_frequency(struct file *file, void *priv,
- struct v4l2_frequency *f)
+ const struct v4l2_frequency *f)
{
struct snd_tea575x *tea = video_drvdata(file);
@@ -350,7 +350,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
else
tea->band = BAND_FM;
- tea->freq = clamp(f->frequency, bands[tea->band].rangelow,
+ tea->freq = clamp_t(u32, f->frequency, bands[tea->band].rangelow,
bands[tea->band].rangehigh);
snd_tea575x_set_freq(tea);
return 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
@ 2013-03-15 10:27 ` Hans Verkuil
2013-03-15 12:12 ` Laurent Pinchart
2013-03-16 12:18 ` Alexey Klimov
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
` (3 subsequent siblings)
4 siblings, 2 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary, Hans Verkuil
From: Hans Verkuil <hans.verkuil@cisco.com>
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/i2c/cx25840/cx25840-core.c | 2 +-
drivers/media/i2c/msp3400-driver.c | 2 +-
drivers/media/i2c/saa6588.c | 2 +-
drivers/media/i2c/saa717x.c | 2 +-
drivers/media/i2c/tda9840.c | 2 +-
drivers/media/i2c/tvaudio.c | 2 +-
drivers/media/i2c/vp27smpx.c | 2 +-
drivers/media/pci/bt8xx/bttv-driver.c | 11 +++++++----
drivers/media/pci/cx18/cx18-av-core.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.c | 2 +-
drivers/media/pci/cx23885/cx23885-417.c | 2 +-
drivers/media/pci/cx23885/cx23885-video.c | 2 +-
drivers/media/pci/cx25821/cx25821-video.c | 2 +-
drivers/media/pci/cx25821/cx25821-video.h | 2 +-
drivers/media/pci/cx88/cx88-blackbird.c | 2 +-
drivers/media/pci/cx88/cx88-video.c | 9 ++-------
drivers/media/pci/ivtv/ivtv-gpio.c | 2 +-
drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +-
drivers/media/pci/saa7134/saa7134-video.c | 4 ++--
drivers/media/pci/saa7146/mxb.c | 2 +-
drivers/media/pci/saa7164/saa7164-encoder.c | 2 +-
drivers/media/pci/saa7164/saa7164-vbi.c | 2 +-
drivers/media/pci/ttpci/av7110_v4l.c | 2 +-
drivers/media/radio/dsbr100.c | 2 +-
drivers/media/radio/radio-cadet.c | 2 +-
drivers/media/radio/radio-isa.c | 2 +-
drivers/media/radio/radio-ma901.c | 2 +-
drivers/media/radio/radio-miropcm20.c | 8 +++++---
drivers/media/radio/radio-mr800.c | 2 +-
drivers/media/radio/radio-sf16fmi.c | 2 +-
drivers/media/radio/radio-tea5764.c | 2 +-
drivers/media/radio/radio-tea5777.c | 7 +++----
drivers/media/radio/radio-timb.c | 2 +-
drivers/media/radio/radio-wl1273.c | 2 +-
drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
drivers/media/radio/tef6862.c | 2 +-
drivers/media/radio/wl128x/fmdrv_v4l2.c | 2 +-
drivers/media/usb/au0828/au0828-video.c | 4 +---
drivers/media/usb/cx231xx/cx231xx-video.c | 4 ++--
drivers/media/usb/cx231xx/cx231xx.h | 2 +-
drivers/media/usb/em28xx/em28xx-video.c | 4 ++--
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +-
drivers/media/usb/tlg2300/pd-radio.c | 2 +-
drivers/media/usb/tlg2300/pd-video.c | 2 +-
drivers/media/usb/tm6000/tm6000-video.c | 8 ++------
drivers/media/usb/usbvision/usbvision-video.c | 2 +-
drivers/media/v4l2-core/tuner-core.c | 2 +-
drivers/staging/media/go7007/go7007-v4l2.c | 2 +-
include/media/v4l2-ioctl.h | 2 +-
include/media/v4l2-subdev.h | 2 +-
sound/i2c/other/tea575x-tuner.c | 2 +-
51 files changed, 68 insertions(+), 75 deletions(-)
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index f4339ed..234b7c6 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1881,7 +1881,7 @@ static int cx25840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}
-static int cx25840_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int cx25840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c
index 77053ba..54a9dd3 100644
--- a/drivers/media/i2c/msp3400-driver.c
+++ b/drivers/media/i2c/msp3400-driver.c
@@ -535,7 +535,7 @@ static int msp_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}
-static int msp_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int msp_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct msp_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/saa6588.c b/drivers/media/i2c/saa6588.c
index 0caac50..b4e1ccb 100644
--- a/drivers/media/i2c/saa6588.c
+++ b/drivers/media/i2c/saa6588.c
@@ -435,7 +435,7 @@ static int saa6588_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}
-static int saa6588_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct saa6588 *s = to_saa6588(sd);
diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c
index 1e84466..5608b93 100644
--- a/drivers/media/i2c/saa717x.c
+++ b/drivers/media/i2c/saa717x.c
@@ -1113,7 +1113,7 @@ static int saa717x_s_stream(struct v4l2_subdev *sd, int enable)
}
/* change audio mode */
-static int saa717x_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int saa717x_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct saa717x_state *decoder = to_state(sd);
int audio_mode;
diff --git a/drivers/media/i2c/tda9840.c b/drivers/media/i2c/tda9840.c
index 3d7ddd9..01441e3 100644
--- a/drivers/media/i2c/tda9840.c
+++ b/drivers/media/i2c/tda9840.c
@@ -87,7 +87,7 @@ static int tda9840_status(struct v4l2_subdev *sd)
return byte & 0x60;
}
-static int tda9840_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *t)
+static int tda9840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *t)
{
int stat = tda9840_status(sd);
int byte;
diff --git a/drivers/media/i2c/tvaudio.c b/drivers/media/i2c/tvaudio.c
index 4b12c51..b72a59d 100644
--- a/drivers/media/i2c/tvaudio.c
+++ b/drivers/media/i2c/tvaudio.c
@@ -1761,7 +1761,7 @@ static int tvaudio_s_routing(struct v4l2_subdev *sd,
return 0;
}
-static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int tvaudio_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct CHIPSTATE *chip = to_state(sd);
struct CHIPDESC *desc = chip->desc;
diff --git a/drivers/media/i2c/vp27smpx.c b/drivers/media/i2c/vp27smpx.c
index 7cfbc9d..e71f139 100644
--- a/drivers/media/i2c/vp27smpx.c
+++ b/drivers/media/i2c/vp27smpx.c
@@ -90,7 +90,7 @@ static int vp27smpx_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
return 0;
}
-static int vp27smpx_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int vp27smpx_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct vp27smpx_state *state = to_state(sd);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 7816edc..20db7aa 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1818,7 +1818,7 @@ static int bttv_s_input(struct file *file, void *priv, unsigned int i)
}
static int bttv_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
@@ -1828,8 +1828,11 @@ static int bttv_s_tuner(struct file *file, void *priv,
bttv_call_all(btv, tuner, s_tuner, t);
- if (btv->audio_mode_gpio)
- btv->audio_mode_gpio(btv, t, 1);
+ if (btv->audio_mode_gpio) {
+ struct v4l2_tuner copy = *t;
+
+ btv->audio_mode_gpio(btv, ©, 1);
+ }
return 0;
}
@@ -3276,7 +3279,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
}
static int radio_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c
index a2c51e0..c22242b 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -809,7 +809,7 @@ static int cx18_av_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}
-static int cx18_av_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int cx18_av_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct cx18_av_state *state = to_cx18_av_state(sd);
struct cx18 *cx = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index 5cd22e7..173ccd2 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -673,7 +673,7 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}
-static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
+static int cx18_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
{
struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx;
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index 84a1b75..812ec5f 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1280,7 +1280,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index 5ba15b8..2bbda43 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -1486,7 +1486,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index 1219d60..75281c1 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1397,7 +1397,7 @@ int cx25821_vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return 0;
}
-int cx25821_vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
+int cx25821_vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
struct cx25821_fh *fh = priv;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index 969340c..f0e70ff 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -159,7 +159,7 @@ extern int cx25821_vidioc_s_register(struct file *file, void *fh,
extern int cx25821_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t);
extern int cx25821_vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t);
+ const struct v4l2_tuner *t);
extern int cx25821_is_valid_width(u32 width, v4l2_std_id tvnorm);
extern int cx25821_is_valid_height(u32 height, v4l2_std_id tvnorm);
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index 82aa11f..486ca8d 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -918,7 +918,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
}
static int vidioc_s_tuner (struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core;
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index 4f10875..ede6f13 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1289,7 +1289,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
}
static int vidioc_s_tuner (struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
@@ -1409,20 +1409,15 @@ static int radio_g_tuner (struct file *file, void *priv,
return 0;
}
-/* FIXME: Should add a standard for radio */
-
static int radio_s_tuner (struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
if (0 != t->index)
return -EINVAL;
- if (t->audmode > V4L2_TUNER_MODE_STEREO)
- t->audmode = V4L2_TUNER_MODE_STEREO;
call_all(core, tuner, s_tuner, t);
-
return 0;
}
diff --git a/drivers/media/pci/ivtv/ivtv-gpio.c b/drivers/media/pci/ivtv/ivtv-gpio.c
index 8f0d077..af52def 100644
--- a/drivers/media/pci/ivtv/ivtv-gpio.c
+++ b/drivers/media/pci/ivtv/ivtv-gpio.c
@@ -192,7 +192,7 @@ static int subdev_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
return 0;
}
-static int subdev_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int subdev_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct ivtv *itv = sd_to_ivtv(sd);
u16 mask, data;
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index e6258b6..852f11e 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1196,7 +1196,7 @@ static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}
-static int ivtv_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
+static int ivtv_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
{
struct ivtv_open_id *id = fh2id(fh);
struct ivtv *itv = id->itv;
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 6c619d1..1e23547 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2023,7 +2023,7 @@ static int saa7134_g_tuner(struct file *file, void *priv,
}
static int saa7134_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
@@ -2347,7 +2347,7 @@ static int radio_g_tuner(struct file *file, void *priv,
return 0;
}
static int radio_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct saa7134_fh *fh = file->private_data;
struct saa7134_dev *dev = fh->dev;
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 27dc49b..9dd044b 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -560,7 +560,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
return call_all(dev, tuner, g_tuner, t);
}
-static int vidioc_s_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
+static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *t)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 34f700d..e7fbd03 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -318,7 +318,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
/* Update the A/V core */
return 0;
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index 5a8a6ad..bfc8cec 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -290,7 +290,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
/* Update the A/V core */
return 0;
diff --git a/drivers/media/pci/ttpci/av7110_v4l.c b/drivers/media/pci/ttpci/av7110_v4l.c
index 65adaa7..6c4076a 100644
--- a/drivers/media/pci/ttpci/av7110_v4l.c
+++ b/drivers/media/pci/ttpci/av7110_v4l.c
@@ -366,7 +366,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
return 0;
}
-static int vidioc_s_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
+static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *t)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index e140a72..142c2ee 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -208,7 +208,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 59be293..545c04c 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -390,7 +390,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c
index 0c1e27b..6ff3508 100644
--- a/drivers/media/radio/radio-isa.c
+++ b/drivers/media/radio/radio-isa.c
@@ -87,7 +87,7 @@ static int radio_isa_g_tuner(struct file *file, void *priv,
}
static int radio_isa_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct radio_isa_card *isa = video_drvdata(file);
const struct radio_isa_ops *ops = isa->drv->ops;
diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c
index 7f85c6f..18320c2 100644
--- a/drivers/media/radio/radio-ma901.c
+++ b/drivers/media/radio/radio-ma901.c
@@ -239,7 +239,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
/* vidioc_s_tuner - set tuner attributes */
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct ma901radio_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c
index 2b8d31d..a7e93d7 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -103,16 +103,18 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct pcm20 *dev = video_drvdata(file);
if (v->index)
return -EINVAL;
if (v->audmode > V4L2_TUNER_MODE_STEREO)
- v->audmode = V4L2_TUNER_MODE_STEREO;
+ dev->audmode = V4L2_TUNER_MODE_STEREO;
+ else
+ dev->audmode = v->audmode;
snd_aci_cmd(dev->aci, ACI_SET_TUNERMONO,
- v->audmode == V4L2_TUNER_MODE_MONO, -1);
+ dev->audmode == V4L2_TUNER_MODE_MONO, -1);
return 0;
}
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index f9cdd8b..2ce75d1 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -305,7 +305,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
/* vidioc_s_tuner - set tuner attributes */
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct amradio_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 6142b5b..adfcc61 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -145,7 +145,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 8938428..38d563d 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -339,7 +339,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct tea5764_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c
index fcd7c19..e245597 100644
--- a/drivers/media/radio/radio-tea5777.c
+++ b/drivers/media/radio/radio-tea5777.c
@@ -336,7 +336,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct radio_tea5777 *tea = video_drvdata(file);
u32 orig_audmode = tea->audmode;
@@ -344,10 +344,9 @@ static int vidioc_s_tuner(struct file *file, void *priv,
if (v->index)
return -EINVAL;
- if (v->audmode > V4L2_TUNER_MODE_STEREO)
- v->audmode = V4L2_TUNER_MODE_STEREO;
-
tea->audmode = v->audmode;
+ if (tea->audmode > V4L2_TUNER_MODE_STEREO)
+ tea->audmode = V4L2_TUNER_MODE_STEREO;
if (tea->audmode != orig_audmode && tea->band == BAND_FM)
return radio_tea5777_set_freq(tea);
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index 1712c05..bb7b143 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -56,7 +56,7 @@ static int timbradio_vidioc_g_tuner(struct file *file, void *priv,
}
static int timbradio_vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct timbradio *tr = video_drvdata(file);
return v4l2_subdev_call(tr->sd_tuner, tuner, s_tuner, v);
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 9a02fee..97c2c18 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1559,7 +1559,7 @@ out:
}
static int wl1273_fm_vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *tuner)
+ const struct v4l2_tuner *tuner)
{
struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
struct wl1273_core *core = radio->core;
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 5708633..5c57e5b 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -636,7 +636,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
* si470x_vidioc_s_tuner - set tuner attributes
*/
static int si470x_vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *tuner)
+ const struct v4l2_tuner *tuner)
{
struct si470x_device *radio = video_drvdata(file);
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c
index 8673955..82c6c94 100644
--- a/drivers/media/radio/tef6862.c
+++ b/drivers/media/radio/tef6862.c
@@ -96,7 +96,7 @@ static int tef6862_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
return 0;
}
-static int tef6862_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
+static int tef6862_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *v)
{
return v->index ? -EINVAL : 0;
}
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index 0183956..5dec323 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -331,7 +331,7 @@ static int fm_v4l2_vidioc_g_tuner(struct file *file, void *priv,
* Should we set other tuner attributes, too?
*/
static int fm_v4l2_vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *tuner)
+ const struct v4l2_tuner *tuner)
{
struct fmdev *fmdev = video_drvdata(file);
u16 aud_mode;
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index b1d6b03..11316f2 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1508,7 +1508,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
@@ -1516,8 +1516,6 @@ static int vidioc_s_tuner(struct file *file, void *priv,
if (t->index != 0)
return -EINVAL;
- t->type = V4L2_TUNER_ANALOG_TV;
-
if (dev->dvb.frontend && dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl)
dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl(dev->dvb.frontend, 1);
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 96f6531..53020a7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1139,7 +1139,7 @@ int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return 0;
}
-int cx231xx_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
+int cx231xx_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
@@ -1808,7 +1808,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
return 0;
}
-static int radio_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
+static int radio_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{
struct cx231xx *dev = ((struct cx231xx_fh *)priv)->dev;
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index 0a6071b..4e37d0f 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -935,7 +935,7 @@ void cx231xx_close_extension(struct cx231xx *dev);
int cx231xx_querycap(struct file *file, void *priv,
struct v4l2_capability *cap);
int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
-int cx231xx_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t);
+int cx231xx_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t);
int cx231xx_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f);
int cx231xx_s_frequency(struct file *file, void *priv,
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 42173d9..1f16904 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1193,7 +1193,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
@@ -1491,7 +1491,7 @@ static int radio_g_tuner(struct file *file, void *priv,
}
static int radio_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct em28xx *dev = ((struct em28xx_fh *)priv)->dev;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 75657c6..0f729c9 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -352,7 +352,7 @@ static int pvr2_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
return pvr2_hdw_get_tuner_status(hdw, vt);
}
-static int pvr2_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
+static int pvr2_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c
index 8b1daf1..ea6070b 100644
--- a/drivers/media/usb/tlg2300/pd-radio.c
+++ b/drivers/media/usb/tlg2300/pd-radio.c
@@ -283,7 +283,7 @@ static int tlg_fm_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL;
}
-static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)
+static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)
{
return vt->index > 0 ? -EINVAL : 0;
}
diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index 8ef7c8c..9595309 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -1031,7 +1031,7 @@ static int pd_vidioc_s_tuner(struct poseidon *pd, int index)
return ret;
}
-static int vidioc_s_tuner(struct file *file, void *fh, struct v4l2_tuner *a)
+static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *a)
{
struct front_face *front = fh;
struct poseidon *pd = front->pd;
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 49df753..b4618d7 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1215,7 +1215,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev;
@@ -1293,18 +1293,14 @@ static int radio_g_tuner(struct file *file, void *priv,
}
static int radio_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct tm6000_fh *fh = file->private_data;
struct tm6000_core *dev = fh->dev;
if (0 != t->index)
return -EINVAL;
- if (t->audmode > V4L2_TUNER_MODE_STEREO)
- t->audmode = V4L2_TUNER_MODE_STEREO;
-
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_tuner, t);
-
return 0;
}
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index b668445..874cfec 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -628,7 +628,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *vt)
+ const struct v4l2_tuner *vt)
{
struct usb_usbvision *usbvision = video_drvdata(file);
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index 279f65e..f775768 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -1233,7 +1233,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
* Note: vt->type should be initialized before calling it.
* This is done by either video_ioctl2 or by the bridge driver.
*/
-static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
+static int tuner_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{
struct tuner *t = to_tuner(sd);
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 1288f1c..4e477f3 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1242,7 +1242,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *t)
+ const struct v4l2_tuner *t)
{
struct go7007 *go = ((struct go7007_file *) priv)->go;
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index f06436d..0da8682 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -219,7 +219,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_g_tuner) (struct file *file, void *fh,
struct v4l2_tuner *a);
int (*vidioc_s_tuner) (struct file *file, void *fh,
- struct v4l2_tuner *a);
+ const struct v4l2_tuner *a);
int (*vidioc_g_frequency) (struct file *file, void *fh,
struct v4l2_frequency *a);
int (*vidioc_s_frequency) (struct file *file, void *fh,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 1a82a50..79784fc 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -194,7 +194,7 @@ struct v4l2_subdev_tuner_ops {
int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
- int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+ int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt);
int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_modulator)(struct v4l2_subdev *sd, const struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 738c5ad..8a36a1d 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -306,7 +306,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
}
static int vidioc_s_tuner(struct file *file, void *priv,
- struct v4l2_tuner *v)
+ const struct v4l2_tuner *v)
{
struct snd_tea575x *tea = video_drvdata(file);
u32 orig_val = tea->val;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
@ 2013-03-15 10:27 ` Hans Verkuil
2013-03-15 12:17 ` Laurent Pinchart
` (4 more replies)
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
` (2 subsequent siblings)
4 siblings, 5 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary, Hans Verkuil
From: Hans Verkuil <hans.verkuil@cisco.com>
This ioctl is defined as IOW, so pass the argument by value instead of by
reference. I could have chosen to add const instead, but this is 1) easier
to handle in drivers and 2) consistent with the s_std subdev operation.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/common/saa7146/saa7146_video.c | 4 ++--
drivers/media/parport/pms.c | 4 ++--
drivers/media/pci/bt8xx/bttv-driver.c | 6 +++---
drivers/media/pci/cx18/cx18-driver.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.c | 10 +++++-----
drivers/media/pci/cx18/cx18-ioctl.h | 2 +-
drivers/media/pci/cx23885/cx23885-417.c | 6 +++---
drivers/media/pci/cx23885/cx23885-video.c | 4 ++--
drivers/media/pci/cx25821/cx25821-video.c | 6 +++---
drivers/media/pci/cx25821/cx25821-video.h | 2 +-
drivers/media/pci/cx88/cx88-blackbird.c | 4 ++--
drivers/media/pci/cx88/cx88-video.c | 4 ++--
drivers/media/pci/ivtv/ivtv-driver.c | 4 ++--
drivers/media/pci/ivtv/ivtv-firmware.c | 4 ++--
drivers/media/pci/ivtv/ivtv-ioctl.c | 18 +++++++++---------
drivers/media/pci/ivtv/ivtv-ioctl.h | 4 ++--
drivers/media/pci/saa7134/saa7134-empress.c | 2 +-
drivers/media/pci/saa7134/saa7134-video.c | 14 +++++++-------
drivers/media/pci/saa7134/saa7134.h | 2 +-
drivers/media/pci/saa7164/saa7164-encoder.c | 8 ++++----
drivers/media/pci/saa7164/saa7164-vbi.c | 8 ++++----
drivers/media/pci/sta2x11/sta2x11_vip.c | 18 +++++++++---------
drivers/media/pci/zoran/zoran_driver.c | 4 ++--
drivers/media/platform/blackfin/bfin_capture.c | 6 +++---
drivers/media/platform/davinci/vpbe.c | 8 ++++----
drivers/media/platform/davinci/vpbe_display.c | 2 +-
drivers/media/platform/davinci/vpfe_capture.c | 12 ++++++------
drivers/media/platform/davinci/vpif_capture.c | 6 +++---
drivers/media/platform/davinci/vpif_display.c | 10 +++++-----
drivers/media/platform/fsl-viu.c | 6 +++---
drivers/media/platform/marvell-ccic/mcam-core.c | 2 +-
drivers/media/platform/s5p-tv/mixer_video.c | 4 ++--
drivers/media/platform/sh_vou.c | 12 ++++++------
drivers/media/platform/soc_camera/soc_camera.c | 4 ++--
drivers/media/platform/timblogiw.c | 6 +++---
drivers/media/platform/via-camera.c | 2 +-
drivers/media/platform/vino.c | 10 +++++-----
drivers/media/usb/au0828/au0828-video.c | 4 ++--
drivers/media/usb/cx231xx/cx231xx-417.c | 4 ++--
drivers/media/usb/cx231xx/cx231xx-video.c | 6 +++---
drivers/media/usb/em28xx/em28xx-video.c | 8 ++++----
drivers/media/usb/hdpvr/hdpvr-video.c | 4 ++--
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 ++--
drivers/media/usb/s2255/s2255drv.c | 8 ++++----
drivers/media/usb/stk1160/stk1160-v4l.c | 4 ++--
drivers/media/usb/tlg2300/pd-video.c | 8 ++++----
drivers/media/usb/tm6000/tm6000-video.c | 6 +++---
drivers/media/usb/usbvision/usbvision-video.c | 4 ++--
drivers/media/v4l2-core/v4l2-ioctl.c | 6 +++---
drivers/staging/media/davinci_vpfe/vpfe_video.c | 6 +++---
drivers/staging/media/dt3155v4l/dt3155v4l.c | 4 ++--
drivers/staging/media/go7007/go7007-v4l2.c | 16 ++++++++--------
drivers/staging/media/solo6x10/v4l2-enc.c | 2 +-
drivers/staging/media/solo6x10/v4l2.c | 2 +-
include/media/davinci/vpbe.h | 2 +-
include/media/v4l2-ioctl.h | 2 +-
56 files changed, 165 insertions(+), 165 deletions(-)
diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c
index 4143d61..fe907f2 100644
--- a/drivers/media/common/saa7146/saa7146_video.c
+++ b/drivers/media/common/saa7146/saa7146_video.c
@@ -832,7 +832,7 @@ static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm)
}
*/
-static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct saa7146_vv *vv = dev->vv_data;
@@ -856,7 +856,7 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
}
for (i = 0; i < dev->ext_vv_data->num_stds; i++)
- if (*id & dev->ext_vv_data->stds[i].id)
+ if (id & dev->ext_vv_data->stds[i].id)
break;
if (i != dev->ext_vv_data->num_stds) {
vv->standard = &dev->ext_vv_data->stds[i];
diff --git a/drivers/media/parport/pms.c b/drivers/media/parport/pms.c
index 77f9c92..66c957a 100644
--- a/drivers/media/parport/pms.c
+++ b/drivers/media/parport/pms.c
@@ -735,12 +735,12 @@ static int pms_g_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}
-static int pms_s_std(struct file *file, void *fh, v4l2_std_id *std)
+static int pms_s_std(struct file *file, void *fh, v4l2_std_id std)
{
struct pms *dev = video_drvdata(file);
int ret = 0;
- dev->std = *std;
+ dev->std = std;
if (dev->std & V4L2_STD_NTSC) {
pms_framerate(dev, 30);
pms_secamcross(dev, 0);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 20db7aa..79dc12c 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1711,7 +1711,7 @@ static void radio_enable(struct bttv *btv)
}
}
-static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int bttv_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
@@ -1719,14 +1719,14 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
int err = 0;
for (i = 0; i < BTTV_TVNORMS; i++)
- if (*id & bttv_tvnorms[i].v4l2_id)
+ if (id & bttv_tvnorms[i].v4l2_id)
break;
if (i == BTTV_TVNORMS) {
err = -EINVAL;
goto err;
}
- btv->std = *id;
+ btv->std = id;
set_tvnorm(btv, i);
err:
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 613e5ae..67b61cf 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -1243,7 +1243,7 @@ int cx18_init_on_first_open(struct cx18 *cx)
in one place. */
cx->std++; /* Force full standard initialization */
std = (cx->tuner_std == V4L2_STD_ALL) ? V4L2_STD_NTSC_M : cx->tuner_std;
- cx18_s_std(NULL, &fh, &std);
+ cx18_s_std(NULL, &fh, std);
cx18_s_frequency(NULL, &fh, &vf);
return 0;
}
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index 173ccd2..254c50f 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -637,15 +637,15 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}
-int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
+int cx18_s_std(struct file *file, void *fh, v4l2_std_id std)
{
struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx;
- if ((*std & V4L2_STD_ALL) == 0)
+ if ((std & V4L2_STD_ALL) == 0)
return -EINVAL;
- if (*std == cx->std)
+ if (std == cx->std)
return 0;
if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ||
@@ -656,8 +656,8 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
return -EBUSY;
}
- cx->std = *std;
- cx->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
+ cx->std = std;
+ cx->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
cx->is_50hz = !cx->is_60hz;
cx2341x_handler_set_50hz(&cx->cxhdl, cx->is_50hz);
cx->cxhdl.width = 720;
diff --git a/drivers/media/pci/cx18/cx18-ioctl.h b/drivers/media/pci/cx18/cx18-ioctl.h
index aa9b44a..4343396 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.h
+++ b/drivers/media/pci/cx18/cx18-ioctl.h
@@ -26,6 +26,6 @@ u16 cx18_service2vbi(int type);
void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal);
u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt);
void cx18_set_funcs(struct video_device *vdev);
-int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
+int cx18_s_std(struct file *file, void *fh, v4l2_std_id std);
int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
int cx18_s_input(struct file *file, void *fh, unsigned int inp);
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index 812ec5f..6dea11a 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1222,14 +1222,14 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct cx23885_fh *fh = file->private_data;
struct cx23885_dev *dev = fh->dev;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(cx23885_tvnorms); i++)
- if (*id & cx23885_tvnorms[i].id)
+ if (id & cx23885_tvnorms[i].id)
break;
if (i == ARRAY_SIZE(cx23885_tvnorms))
return -EINVAL;
@@ -1237,7 +1237,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
/* Have the drier core notify the subdevices */
mutex_lock(&dev->lock);
- cx23885_set_tvnorm(dev, *id);
+ cx23885_set_tvnorm(dev, id);
mutex_unlock(&dev->lock);
return 0;
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index 2bbda43..ed08c89 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -1259,13 +1259,13 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *tvnorms)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;
dprintk(1, "%s()\n", __func__);
mutex_lock(&dev->lock);
- cx23885_set_tvnorm(dev, *tvnorms);
+ cx23885_set_tvnorm(dev, tvnorms);
mutex_unlock(&dev->lock);
return 0;
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index 75281c1..93c7d57 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1203,7 +1203,7 @@ int cx25821_vidioc_s_priority(struct file *file, void *f,
}
#ifdef TUNER_FLAG
-int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms)
+int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
{
struct cx25821_fh *fh = priv;
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
@@ -1218,11 +1218,11 @@ int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms)
return err;
}
- if (dev->tvnorm == *tvnorms)
+ if (dev->tvnorm == tvnorms)
return 0;
mutex_lock(&dev->lock);
- cx25821_set_tvnorm(dev, *tvnorms);
+ cx25821_set_tvnorm(dev, tvnorms);
mutex_unlock(&dev->lock);
medusa_set_videostandard(dev);
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index f0e70ff..239f63c 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -135,7 +135,7 @@ extern int cx25821_vidioc_querybuf(struct file *file, void *priv,
extern int cx25821_vidioc_qbuf(struct file *file, void *priv,
struct v4l2_buffer *p);
extern int cx25821_vidioc_s_std(struct file *file, void *priv,
- v4l2_std_id *tvnorms);
+ v4l2_std_id tvnorms);
extern int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i);
extern int cx25821_vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i);
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index 486ca8d..150bb76 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -939,12 +939,12 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
return 0;
}
-static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core;
mutex_lock(&core->lock);
- cx88_set_tvnorm(core,*id);
+ cx88_set_tvnorm(core, id);
mutex_unlock(&core->lock);
return 0;
}
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index ede6f13..ead5be5 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1193,12 +1193,12 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
return 0;
}
-static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
{
struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
mutex_lock(&core->lock);
- cx88_set_tvnorm(core,*tvnorms);
+ cx88_set_tvnorm(core, tvnorms);
mutex_unlock(&core->lock);
return 0;
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index 2928e72..07b8460 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -1387,7 +1387,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
if (!itv->has_cx23415)
write_reg_sync(0x03, IVTV_REG_DMACONTROL);
- ivtv_s_std_enc(itv, &itv->tuner_std);
+ ivtv_s_std_enc(itv, itv->tuner_std);
/* Default interrupts enabled. For the PVR350 this includes the
decoder VSYNC interrupt, which is always on. It is not only used
@@ -1397,7 +1397,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT | IVTV_IRQ_DEC_VSYNC);
ivtv_set_osd_alpha(itv);
- ivtv_s_std_dec(itv, &itv->tuner_std);
+ ivtv_s_std_dec(itv, itv->tuner_std);
} else {
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT);
}
diff --git a/drivers/media/pci/ivtv/ivtv-firmware.c b/drivers/media/pci/ivtv/ivtv-firmware.c
index 68387d4..ed73edd 100644
--- a/drivers/media/pci/ivtv/ivtv-firmware.c
+++ b/drivers/media/pci/ivtv/ivtv-firmware.c
@@ -302,7 +302,7 @@ static int ivtv_firmware_restart(struct ivtv *itv)
/* Restore encoder video standard */
std = itv->std;
itv->std = 0;
- ivtv_s_std_enc(itv, &std);
+ ivtv_s_std_enc(itv, std);
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
ivtv_init_mpeg_decoder(itv);
@@ -310,7 +310,7 @@ static int ivtv_firmware_restart(struct ivtv *itv)
/* Restore decoder video standard */
std = itv->std_out;
itv->std_out = 0;
- ivtv_s_std_dec(itv, &std);
+ ivtv_s_std_dec(itv, std);
/* Restore framebuffer if active */
if (itv->ivtvfb_restore)
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 852f11e..080f179 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1103,10 +1103,10 @@ static int ivtv_g_std(struct file *file, void *fh, v4l2_std_id *std)
return 0;
}
-void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std)
+void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std)
{
- itv->std = *std;
- itv->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
+ itv->std = std;
+ itv->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
itv->is_50hz = !itv->is_60hz;
cx2341x_handler_set_50hz(&itv->cxhdl, itv->is_50hz);
itv->cxhdl.width = 720;
@@ -1122,15 +1122,15 @@ void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std)
ivtv_call_all(itv, core, s_std, itv->std);
}
-void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
+void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std)
{
struct yuv_playback_info *yi = &itv->yuv_info;
DEFINE_WAIT(wait);
int f;
/* set display standard */
- itv->std_out = *std;
- itv->is_out_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
+ itv->std_out = std;
+ itv->is_out_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
itv->is_out_50hz = !itv->is_out_60hz;
ivtv_call_all(itv, video, s_std_output, itv->std_out);
@@ -1168,14 +1168,14 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
}
}
-static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
+static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id std)
{
struct ivtv *itv = fh2id(fh)->itv;
- if ((*std & V4L2_STD_ALL) == 0)
+ if ((std & V4L2_STD_ALL) == 0)
return -EINVAL;
- if (*std == itv->std)
+ if (std == itv->std)
return 0;
if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ||
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.h b/drivers/media/pci/ivtv/ivtv-ioctl.h
index 34c6bc1..75c3977 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.h
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.h
@@ -27,8 +27,8 @@ u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt);
void ivtv_set_osd_alpha(struct ivtv *itv);
int ivtv_set_speed(struct ivtv *itv, int speed);
void ivtv_set_funcs(struct video_device *vdev);
-void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std);
-void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std);
+void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std);
+void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std);
int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c
index 4df79c6..66a7081 100644
--- a/drivers/media/pci/saa7134/saa7134-empress.c
+++ b/drivers/media/pci/saa7134/saa7134-empress.c
@@ -428,7 +428,7 @@ static int empress_g_chip_ident(struct file *file, void *fh,
return -EINVAL;
}
-static int empress_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int empress_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct saa7134_dev *dev = file->private_data;
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 1e23547..a6c69a4 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1828,7 +1828,7 @@ static int saa7134_querycap(struct file *file, void *priv,
return 0;
}
-int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id *id)
+int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id id)
{
unsigned long flags;
unsigned int i;
@@ -1849,17 +1849,17 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
}
for (i = 0; i < TVNORMS; i++)
- if (*id == tvnorms[i].id)
+ if (id == tvnorms[i].id)
break;
if (i == TVNORMS)
for (i = 0; i < TVNORMS; i++)
- if (*id & tvnorms[i].id)
+ if (id & tvnorms[i].id)
break;
if (i == TVNORMS)
return -EINVAL;
- if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
+ if ((id & V4L2_STD_SECAM) && (secam[0] != '-')) {
if (secam[0] == 'L' || secam[0] == 'l') {
if (secam[1] == 'C' || secam[1] == 'c')
fixup = V4L2_STD_SECAM_LC;
@@ -1879,7 +1879,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
return -EINVAL;
}
- *id = tvnorms[i].id;
+ id = tvnorms[i].id;
mutex_lock(&dev->lock);
if (fh && res_check(fh, RESOURCE_OVERLAY)) {
@@ -1901,7 +1901,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
}
EXPORT_SYMBOL_GPL(saa7134_s_std_internal);
-static int saa7134_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int saa7134_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct saa7134_fh *fh = priv;
@@ -2396,7 +2396,7 @@ static int radio_s_input(struct file *filp, void *priv, unsigned int i)
return 0;
}
-static int radio_s_std(struct file *file, void *fh, v4l2_std_id *norm)
+static int radio_s_std(struct file *file, void *fh, v4l2_std_id norm)
{
return 0;
}
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h
index 71eefef..62169dd 100644
--- a/drivers/media/pci/saa7134/saa7134.h
+++ b/drivers/media/pci/saa7134/saa7134.h
@@ -766,7 +766,7 @@ extern struct video_device saa7134_radio_template;
int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c);
int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c);
int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c);
-int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id *id);
+int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id id);
int saa7134_videoport_init(struct saa7134_dev *dev);
void saa7134_set_tvnorm_hw(struct saa7134_dev *dev);
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index e7fbd03..538de52 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -211,17 +211,17 @@ static int saa7164_encoder_initialize(struct saa7164_port *port)
}
/* -- V4L2 --------------------------------------------------------- */
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct saa7164_encoder_fh *fh = file->private_data;
struct saa7164_port *port = fh->port;
struct saa7164_dev *dev = port->dev;
unsigned int i;
- dprintk(DBGLVL_ENC, "%s(id=0x%x)\n", __func__, (u32)*id);
+ dprintk(DBGLVL_ENC, "%s(id=0x%x)\n", __func__, (u32)id);
for (i = 0; i < ARRAY_SIZE(saa7164_tvnorms); i++) {
- if (*id & saa7164_tvnorms[i].id)
+ if (id & saa7164_tvnorms[i].id)
break;
}
if (i == ARRAY_SIZE(saa7164_tvnorms))
@@ -234,7 +234,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
*/
saa7164_api_set_audio_std(port);
- dprintk(DBGLVL_ENC, "%s(id=0x%x) OK\n", __func__, (u32)*id);
+ dprintk(DBGLVL_ENC, "%s(id=0x%x) OK\n", __func__, (u32)id);
return 0;
}
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index bfc8cec..da224eb 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -183,17 +183,17 @@ static int saa7164_vbi_initialize(struct saa7164_port *port)
}
/* -- V4L2 --------------------------------------------------------- */
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct saa7164_vbi_fh *fh = file->private_data;
struct saa7164_port *port = fh->port;
struct saa7164_dev *dev = port->dev;
unsigned int i;
- dprintk(DBGLVL_VBI, "%s(id=0x%x)\n", __func__, (u32)*id);
+ dprintk(DBGLVL_VBI, "%s(id=0x%x)\n", __func__, (u32)id);
for (i = 0; i < ARRAY_SIZE(saa7164_tvnorms); i++) {
- if (*id & saa7164_tvnorms[i].id)
+ if (id & saa7164_tvnorms[i].id)
break;
}
if (i == ARRAY_SIZE(saa7164_tvnorms))
@@ -206,7 +206,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
*/
saa7164_api_set_audio_std(port);
- dprintk(DBGLVL_VBI, "%s(id=0x%x) OK\n", __func__, (u32)*id);
+ dprintk(DBGLVL_VBI, "%s(id=0x%x) OK\n", __func__, (u32)id);
return 0;
}
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
index 4b703fe..7005695 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -439,22 +439,22 @@ static int vidioc_querycap(struct file *file, void *priv,
*
* other, returned from video DAC.
*/
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std)
{
struct sta2x11_vip *vip = video_drvdata(file);
v4l2_std_id oldstd = vip->std, newstd;
int status;
- if (V4L2_STD_ALL == *std) {
- v4l2_subdev_call(vip->decoder, core, s_std, *std);
+ if (V4L2_STD_ALL == std) {
+ v4l2_subdev_call(vip->decoder, core, s_std, std);
ssleep(2);
v4l2_subdev_call(vip->decoder, video, querystd, &newstd);
v4l2_subdev_call(vip->decoder, video, g_input_status, &status);
if (status & V4L2_IN_ST_NO_SIGNAL)
return -EIO;
- *std = vip->std = newstd;
- if (oldstd != *std) {
- if (V4L2_STD_525_60 & (*std))
+ std = vip->std = newstd;
+ if (oldstd != std) {
+ if (V4L2_STD_525_60 & std)
vip->format = formats_60[0];
else
vip->format = formats_50[0];
@@ -462,14 +462,14 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
return 0;
}
- if (oldstd != *std) {
- if (V4L2_STD_525_60 & (*std))
+ if (oldstd != std) {
+ if (V4L2_STD_525_60 & std)
vip->format = formats_60[0];
else
vip->format = formats_50[0];
}
- return v4l2_subdev_call(vip->decoder, core, s_std, *std);
+ return v4l2_subdev_call(vip->decoder, core, s_std, std);
}
/**
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 2e8f518..1168a84 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -2435,14 +2435,14 @@ static int zoran_g_std(struct file *file, void *__fh, v4l2_std_id *std)
return 0;
}
-static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id *std)
+static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id std)
{
struct zoran_fh *fh = __fh;
struct zoran *zr = fh->zr;
int res = 0;
mutex_lock(&zr->resource_lock);
- res = zoran_set_norm(zr, *std);
+ res = zoran_set_norm(zr, std);
if (res)
goto sstd_unlock_and_return;
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index 8ffe42a..fcf39b2 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -633,7 +633,7 @@ static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
return 0;
}
-static int bcap_s_std(struct file *file, void *priv, v4l2_std_id *std)
+static int bcap_s_std(struct file *file, void *priv, v4l2_std_id std)
{
struct bcap_device *bcap_dev = video_drvdata(file);
int ret;
@@ -641,11 +641,11 @@ static int bcap_s_std(struct file *file, void *priv, v4l2_std_id *std)
if (vb2_is_busy(&bcap_dev->buffer_queue))
return -EBUSY;
- ret = v4l2_subdev_call(bcap_dev->sd, core, s_std, *std);
+ ret = v4l2_subdev_call(bcap_dev->sd, core, s_std, std);
if (ret < 0)
return ret;
- bcap_dev->std = *std;
+ bcap_dev->std = std;
return 0;
}
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index 4ca0f9a..554f3a9 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -431,7 +431,7 @@ static int vpbe_enum_dv_timings(struct vpbe_device *vpbe_dev,
* Sets the standard if supported by the current encoder. Return the status.
* 0 - success & -EINVAL on error
*/
-static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id)
+static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id)
{
struct vpbe_config *cfg = vpbe_dev->cfg;
int out_index = vpbe_dev->current_out_index;
@@ -442,14 +442,14 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id)
V4L2_OUT_CAP_STD))
return -EINVAL;
- ret = vpbe_get_std_info(vpbe_dev, *std_id);
+ ret = vpbe_get_std_info(vpbe_dev, std_id);
if (ret)
return ret;
mutex_lock(&vpbe_dev->lock);
ret = v4l2_subdev_call(vpbe_dev->encoders[sd_index], video,
- s_std_output, *std_id);
+ s_std_output, std_id);
/* set the lcd controller output for the given mode */
if (!ret) {
struct osd_state *osd_device = vpbe_dev->osd_device;
@@ -513,7 +513,7 @@ static int vpbe_set_mode(struct vpbe_device *vpbe_dev,
*/
if (preset_mode->timings_type & VPBE_ENC_STD)
return vpbe_s_std(vpbe_dev,
- &preset_mode->std_id);
+ preset_mode->std_id);
if (preset_mode->timings_type &
VPBE_ENC_CUSTOM_TIMINGS) {
dv_timings =
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index 9f9f2c1..1311cdf 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -983,7 +983,7 @@ static int vpbe_display_try_fmt(struct file *file, void *priv,
* 0 - success & -EINVAL on error
*/
static int vpbe_display_s_std(struct file *file, void *priv,
- v4l2_std_id *std_id)
+ v4l2_std_id std_id)
{
struct vpbe_fh *fh = priv;
struct vpbe_layer *layer = fh->layer;
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 28d019d..d0bfb6a 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -376,7 +376,7 @@ static int vpfe_config_ccdc_image_format(struct vpfe_device *vpfe_dev)
* values in ccdc
*/
static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
- const v4l2_std_id *std_id)
+ v4l2_std_id std_id)
{
struct vpfe_subdev_info *sdinfo = vpfe_dev->current_subdev;
struct v4l2_mbus_framefmt mbus_fmt;
@@ -384,7 +384,7 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
int i, ret = 0;
for (i = 0; i < ARRAY_SIZE(vpfe_standards); i++) {
- if (vpfe_standards[i].std_id & *std_id) {
+ if (vpfe_standards[i].std_id & std_id) {
vpfe_dev->std_info.active_pixels =
vpfe_standards[i].width;
vpfe_dev->std_info.active_lines =
@@ -461,7 +461,7 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)
/* Configure the default format information */
ret = vpfe_config_image_format(vpfe_dev,
- &vpfe_standards[vpfe_dev->std_index].std_id);
+ vpfe_standards[vpfe_dev->std_index].std_id);
if (ret)
return ret;
@@ -1164,7 +1164,7 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index)
/* set the default image parameters in the device */
ret = vpfe_config_image_format(vpfe_dev,
- &vpfe_standards[vpfe_dev->std_index].std_id);
+ vpfe_standards[vpfe_dev->std_index].std_id);
unlock_out:
mutex_unlock(&vpfe_dev->lock);
return ret;
@@ -1189,7 +1189,7 @@ static int vpfe_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
return ret;
}
-static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
+static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{
struct vpfe_device *vpfe_dev = video_drvdata(file);
struct vpfe_subdev_info *sdinfo;
@@ -1211,7 +1211,7 @@ static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
}
ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id,
- core, s_std, *std_id);
+ core, s_std, std_id);
if (ret < 0) {
v4l2_err(&vpfe_dev->v4l2_dev, "Failed to set standard\n");
goto unlock_out;
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 1943e41..4e78839 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1395,7 +1395,7 @@ static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std)
* @priv: file handle
* @std_id: ptr to std id
*/
-static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
+static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{
struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel;
@@ -1424,7 +1424,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
fh->initialized = 1;
/* Call encoder subdevice function to set the standard */
- ch->video.stdid = *std_id;
+ ch->video.stdid = std_id;
memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings));
/* Get the information about the standard */
@@ -1437,7 +1437,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
vpif_config_format(ch);
/* set standard in the sub device */
- ret = v4l2_subdev_call(ch->sd, core, s_std, *std_id);
+ ret = v4l2_subdev_call(ch->sd, core, s_std, std_id);
if (ret && ret != -ENOIOCTLCMD && ret != -ENODEV) {
vpif_dbg(1, debug, "Failed to set standard for sub devices\n");
return ret;
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 5477c2c..dced173 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1059,14 +1059,14 @@ static int vpif_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
return vb2_qbuf(&common->buffer_queue, buf);
}
-static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
+static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{
struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel;
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
int ret = 0;
- if (!(*std_id & VPIF_V4L2_STD))
+ if (!(std_id & VPIF_V4L2_STD))
return -EINVAL;
if (common->started) {
@@ -1075,7 +1075,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
}
/* Call encoder subdevice function to set the standard */
- ch->video.stdid = *std_id;
+ ch->video.stdid = std_id;
memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings));
/* Get the information about the standard */
if (vpif_update_resolution(ch))
@@ -1093,14 +1093,14 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
vpif_config_format(ch);
ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, video,
- s_std_output, *std_id);
+ s_std_output, std_id);
if (ret < 0) {
vpif_err("Failed to set output standard\n");
return ret;
}
ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, core,
- s_std, *std_id);
+ s_std, std_id);
if (ret < 0)
vpif_err("Failed to set standard for sub devices\n");
return ret;
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index 5f7db3f..3a6a0dc 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -957,12 +957,12 @@ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct viu_fh *fh = priv;
- fh->dev->std = *id;
- decoder_call(fh->dev, core, s_std, *id);
+ fh->dev->std = id;
+ decoder_call(fh->dev, core, s_std, id);
return 0;
}
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 92a33f0..76a8623 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1357,7 +1357,7 @@ static int mcam_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
}
/* from vivi.c */
-static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id *a)
+static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id a)
{
return 0;
}
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
index 82142a2..d777d0b 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -559,7 +559,7 @@ static int mxr_g_dv_preset(struct file *file, void *fh,
return ret ? -EINVAL : 0;
}
-static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm)
+static int mxr_s_std(struct file *file, void *fh, v4l2_std_id norm)
{
struct mxr_layer *layer = video_drvdata(file);
struct mxr_device *mdev = layer->mdev;
@@ -576,7 +576,7 @@ static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm)
return -EBUSY;
}
- ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, *norm);
+ ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, norm);
mutex_unlock(&mdev->mutex);
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 66c8da1..ea8a1ee 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -881,29 +881,29 @@ static u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt)
}
}
-static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
+static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{
struct sh_vou_device *vou_dev = video_drvdata(file);
int ret;
- dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, *std_id);
+ dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id);
- if (*std_id & ~vou_dev->vdev->tvnorms)
+ if (std_id & ~vou_dev->vdev->tvnorms)
return -EINVAL;
ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video,
- s_std_output, *std_id);
+ s_std_output, std_id);
/* Shall we continue, if the subdev doesn't support .s_std_output()? */
if (ret < 0 && ret != -ENOIOCTLCMD)
return ret;
- if (*std_id & V4L2_STD_525_60)
+ if (std_id & V4L2_STD_525_60)
sh_vou_reg_ab_set(vou_dev, VOUCR,
sh_vou_ntsc_mode(vou_dev->pdata->bus_fmt) << 29, 7 << 29);
else
sh_vou_reg_ab_set(vou_dev, VOUCR, 5 << 29, 7 << 29);
- vou_dev->std = *std_id;
+ vou_dev->std = std_id;
return 0;
}
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 8ec9805..3592968 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -256,12 +256,12 @@ static int soc_camera_s_input(struct file *file, void *priv, unsigned int i)
return 0;
}
-static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)
+static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id a)
{
struct soc_camera_device *icd = file->private_data;
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- return v4l2_subdev_call(sd, core, s_std, *a);
+ return v4l2_subdev_call(sd, core, s_std, a);
}
static int soc_camera_g_std(struct file *file, void *priv, v4l2_std_id *a)
diff --git a/drivers/media/platform/timblogiw.c b/drivers/media/platform/timblogiw.c
index 2d91eeb..a2f7bdd 100644
--- a/drivers/media/platform/timblogiw.c
+++ b/drivers/media/platform/timblogiw.c
@@ -336,7 +336,7 @@ static int timblogiw_g_std(struct file *file, void *priv, v4l2_std_id *std)
return 0;
}
-static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id *std)
+static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id std)
{
struct video_device *vdev = video_devdata(file);
struct timblogiw *lw = video_get_drvdata(vdev);
@@ -348,10 +348,10 @@ static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id *std)
mutex_lock(&lw->lock);
if (TIMBLOGIW_HAS_DECODER(lw))
- err = v4l2_subdev_call(lw->sd_enc, core, s_std, *std);
+ err = v4l2_subdev_call(lw->sd_enc, core, s_std, std);
if (!err)
- fh->cur_norm = timblogiw_get_norm(*std);
+ fh->cur_norm = timblogiw_get_norm(std);
mutex_unlock(&lw->lock);
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index b051c4a..a794cd6 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -847,7 +847,7 @@ static int viacam_s_input(struct file *filp, void *priv, unsigned int i)
return 0;
}
-static int viacam_s_std(struct file *filp, void *priv, v4l2_std_id *std)
+static int viacam_s_std(struct file *filp, void *priv, v4l2_std_id std)
{
return 0;
}
diff --git a/drivers/media/platform/vino.c b/drivers/media/platform/vino.c
index eb5d6f9..c6af974 100644
--- a/drivers/media/platform/vino.c
+++ b/drivers/media/platform/vino.c
@@ -3042,7 +3042,7 @@ static int vino_g_std(struct file *file, void *__fh,
}
static int vino_s_std(struct file *file, void *__fh,
- v4l2_std_id *std)
+ v4l2_std_id std)
{
struct vino_channel_settings *vcs = video_drvdata(file);
unsigned long flags;
@@ -3056,7 +3056,7 @@ static int vino_s_std(struct file *file, void *__fh,
}
/* check if the standard is valid for the current input */
- if ((*std) & vino_inputs[vcs->input].std) {
+ if (std & vino_inputs[vcs->input].std) {
dprintk("standard accepted\n");
/* change the video norm for SAA7191
@@ -3065,13 +3065,13 @@ static int vino_s_std(struct file *file, void *__fh,
if (vcs->input == VINO_INPUT_D1)
goto out;
- if ((*std) & V4L2_STD_PAL) {
+ if (std & V4L2_STD_PAL) {
ret = vino_set_data_norm(vcs, VINO_DATA_NORM_PAL,
&flags);
- } else if ((*std) & V4L2_STD_NTSC) {
+ } else if (std & V4L2_STD_NTSC) {
ret = vino_set_data_norm(vcs, VINO_DATA_NORM_NTSC,
&flags);
- } else if ((*std) & V4L2_STD_SECAM) {
+ } else if (std & V4L2_STD_SECAM) {
ret = vino_set_data_norm(vcs, VINO_DATA_NORM_SECAM,
&flags);
} else {
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 11316f2..e9dd01c 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1320,7 +1320,7 @@ out:
return rc;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
@@ -1332,7 +1332,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
have to make the au0828 bridge adjust the size of its capture
buffer, which is currently hardcoded at 720x480 */
- v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, *norm);
+ v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, norm);
dev->std_set_in_tuner_core = 1;
if (dev->dvb.frontend && dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl)
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
index 49c842a..f548db8 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1492,14 +1492,14 @@ static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct cx231xx_fh *fh = file->private_data;
struct cx231xx *dev = fh->dev;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(cx231xx_tvnorms); i++)
- if (*id & cx231xx_tvnorms[i].id)
+ if (id & cx231xx_tvnorms[i].id)
break;
if (i == ARRAY_SIZE(cx231xx_tvnorms))
return -EINVAL;
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 53020a7..4cff2f4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -987,7 +987,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
@@ -998,13 +998,13 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
if (rc < 0)
return rc;
- if (dev->norm == *norm)
+ if (dev->norm == norm)
return 0;
if (videobuf_queue_is_busy(&fh->vb_vidq))
return -EBUSY;
- dev->norm = *norm;
+ dev->norm = norm;
/* Adjusts width/height, if needed */
dev->width = 720;
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 1f16904..98cdc4f 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -994,23 +994,23 @@ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
struct v4l2_format f;
- if (*norm == dev->norm)
+ if (norm == dev->norm)
return 0;
if (dev->streaming_users > 0)
return -EBUSY;
- dev->norm = *norm;
+ dev->norm = norm;
/* Adjusts width/height, if needed */
f.fmt.pix.width = 720;
- f.fmt.pix.height = (*norm & V4L2_STD_525_60) ? 480 : 576;
+ f.fmt.pix.height = (norm & V4L2_STD_525_60) ? 480 : 576;
vidioc_try_fmt_vid_cap(file, priv, &f);
/* set new image size */
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index da6b779..f49bb32 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -581,13 +581,13 @@ static int vidioc_querycap(struct file *file, void *priv,
}
static int vidioc_s_std(struct file *file, void *private_data,
- v4l2_std_id *std)
+ v4l2_std_id std)
{
struct hdpvr_fh *fh = file->private_data;
struct hdpvr_device *dev = fh->dev;
u8 std_type = 1;
- if (*std & (V4L2_STD_NTSC | V4L2_STD_PAL_60))
+ if (std & (V4L2_STD_NTSC | V4L2_STD_PAL_60))
std_type = 0;
return hdpvr_config_call(dev, CTRL_VIDEO_STD_TYPE, std_type);
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 0f729c9..a7774e3 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -196,13 +196,13 @@ static int pvr2_g_std(struct file *file, void *priv, v4l2_std_id *std)
return ret;
}
-static int pvr2_s_std(struct file *file, void *priv, v4l2_std_id *std)
+static int pvr2_s_std(struct file *file, void *priv, v4l2_std_id std)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
return pvr2_ctrl_set_value(
- pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDCUR), *std);
+ pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDCUR), std);
}
static int pvr2_querystd(struct file *file, void *priv, v4l2_std_id *std)
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 2bd8613..ab97e7d 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -1294,7 +1294,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i)
{
struct s2255_fh *fh = priv;
struct s2255_mode mode;
@@ -1314,7 +1314,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
goto out_s_std;
}
mode = fh->channel->mode;
- if (*i & V4L2_STD_525_60) {
+ if (i & V4L2_STD_525_60) {
dprintk(4, "%s 60 Hz\n", __func__);
/* if changing format, reset frame decimation/intervals */
if (mode.format != FORMAT_NTSC) {
@@ -1324,7 +1324,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
channel->width = LINE_SZ_4CIFS_NTSC;
channel->height = NUM_LINES_4CIFS_NTSC * 2;
}
- } else if (*i & V4L2_STD_625_50) {
+ } else if (i & V4L2_STD_625_50) {
dprintk(4, "%s 50 Hz\n", __func__);
if (mode.format != FORMAT_PAL) {
mode.restart = 1;
@@ -1337,7 +1337,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
ret = -EINVAL;
goto out_s_std;
}
- fh->channel->std = *i;
+ fh->channel->std = i;
if (mode.restart)
s2255_set_mode(fh->channel, &mode);
out_s_std:
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index 5307a63..f6a6cdc 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -375,7 +375,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
struct stk1160 *dev = video_drvdata(file);
struct vb2_queue *q = &dev->vb_vidq;
@@ -388,7 +388,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
return -ENODEV;
/* We need to set this now, before we call stk1160_set_std */
- dev->norm = *norm;
+ dev->norm = norm;
/* This is taken from saa7115 video decoder */
if (dev->norm & V4L2_STD_525_60) {
diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index 9595309..8df668d 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -801,7 +801,7 @@ static int vidioc_g_fmt_vbi(struct file *file, void *fh,
return 0;
}
-static int set_std(struct poseidon *pd, v4l2_std_id *norm)
+static int set_std(struct poseidon *pd, v4l2_std_id norm)
{
struct video_data *video = &pd->video_data;
struct vbi_data *vbi = &pd->vbi_data;
@@ -811,7 +811,7 @@ static int set_std(struct poseidon *pd, v4l2_std_id *norm)
int height;
for (i = 0; i < POSEIDON_TVNORMS; i++) {
- if (*norm & poseidon_tvnorms[i].v4l2_id) {
+ if (norm & poseidon_tvnorms[i].v4l2_id) {
param = poseidon_tvnorms[i].tlg_tvnorm;
log("name : %s", poseidon_tvnorms[i].name);
goto found;
@@ -846,7 +846,7 @@ out:
return ret;
}
-static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *norm)
+static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id norm)
{
struct front_face *front = fh;
@@ -1270,7 +1270,7 @@ static int restore_v4l2_context(struct poseidon *pd,
pd_video_checkmode(pd);
- set_std(pd, &context->tvnormid);
+ set_std(pd, context->tvnormid);
vidioc_s_input(NULL, front, context->sig_index);
pd_vidioc_s_tuner(pd, context->audio_idx);
pd_vidioc_s_fmt(pd, &context->pix);
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index b4618d7..a78de1d 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1056,13 +1056,13 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{
int rc = 0;
struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev;
- dev->norm = *norm;
+ dev->norm = norm;
rc = tm6000_init_analog_mode(dev);
fh->width = dev->width;
@@ -1134,7 +1134,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
dev->input = i;
- rc = vidioc_s_std(file, priv, &dev->vfd->current_norm);
+ rc = vidioc_s_std(file, priv, dev->vfd->current_norm);
return rc;
}
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 874cfec..041f19e 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -595,11 +595,11 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int input)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct usb_usbvision *usbvision = video_drvdata(file);
- usbvision->tvnorm_id = *id;
+ usbvision->tvnorm_id = id;
call_all(usbvision, core, s_std, usbvision->tvnorm_id);
/* propagate the change to the decoder */
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 8ec8abe..d80d8af 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1383,15 +1383,15 @@ static int v4l_s_std(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct video_device *vfd = video_devdata(file);
- v4l2_std_id *id = arg, norm;
+ v4l2_std_id id = *(v4l2_std_id *)arg, norm;
int ret;
- norm = (*id) & vfd->tvnorms;
+ norm = id & vfd->tvnorms;
if (vfd->tvnorms && !norm) /* Check if std is supported */
return -EINVAL;
/* Calls the specific handler */
- ret = ops->vidioc_s_std(file, fh, &norm);
+ ret = ops->vidioc_s_std(file, fh, norm);
/* Updates standard information */
if (ret >= 0)
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 99ccbeb..948cfe2 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -924,7 +924,7 @@ static int vpfe_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
*
* Return 0 on success, error code otherwise
*/
-static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
+static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{
struct vpfe_video_device *video = video_drvdata(file);
struct vpfe_device *vpfe_dev = video->vpfe_dev;
@@ -945,13 +945,13 @@ static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
goto unlock_out;
}
ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id,
- core, s_std, *std_id);
+ core, s_std, std_id);
if (ret < 0) {
v4l2_err(&vpfe_dev->v4l2_dev, "Failed to set standard\n");
video->stdid = V4L2_STD_UNKNOWN;
goto unlock_out;
}
- video->stdid = *std_id;
+ video->stdid = std_id;
unlock_out:
mutex_unlock(&video->lock);
return ret;
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index e33b7f5..073b3b3 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -612,9 +612,9 @@ dt3155_ioc_g_std(struct file *filp, void *p, v4l2_std_id *norm)
}
static int
-dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id *norm)
+dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id norm)
{
- if (*norm & DT3155_CURRENT_NORM)
+ if (norm & DT3155_CURRENT_NORM)
return 0;
return -EINVAL;
}
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 4e477f3..29fe94d 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1117,40 +1117,40 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std)
return 0;
}
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std)
{
struct go7007 *go = ((struct go7007_file *) priv)->go;
if (go->streaming)
return -EBUSY;
- if (!(go->board_info->sensor_flags & GO7007_SENSOR_TV) && *std != 0)
+ if (!(go->board_info->sensor_flags & GO7007_SENSOR_TV) && std != 0)
return -EINVAL;
- if (*std == 0)
+ if (std == 0)
return -EINVAL;
if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) &&
go->input == go->board_info->num_inputs - 1) {
if (!go->i2c_adapter_online)
return -EIO;
- if (call_all(&go->v4l2_dev, core, s_std, *std) < 0)
+ if (call_all(&go->v4l2_dev, core, s_std, std) < 0)
return -EINVAL;
}
- if (*std & V4L2_STD_NTSC) {
+ if (std & V4L2_STD_NTSC) {
go->standard = GO7007_STD_NTSC;
go->sensor_framerate = 30000;
- } else if (*std & V4L2_STD_PAL) {
+ } else if (std & V4L2_STD_PAL) {
go->standard = GO7007_STD_PAL;
go->sensor_framerate = 25025;
- } else if (*std & V4L2_STD_SECAM) {
+ } else if (std & V4L2_STD_SECAM) {
go->standard = GO7007_STD_PAL;
go->sensor_framerate = 25025;
} else
return -EINVAL;
- call_all(&go->v4l2_dev, core, s_std, *std);
+ call_all(&go->v4l2_dev, core, s_std, std);
set_capture_size(go, NULL, 0);
return 0;
diff --git a/drivers/staging/media/solo6x10/v4l2-enc.c b/drivers/staging/media/solo6x10/v4l2-enc.c
index 4977e86..310b126 100644
--- a/drivers/staging/media/solo6x10/v4l2-enc.c
+++ b/drivers/staging/media/solo6x10/v4l2-enc.c
@@ -1326,7 +1326,7 @@ static int solo_enc_streamoff(struct file *file, void *priv,
return videobuf_streamoff(&fh->vidq);
}
-static int solo_enc_s_std(struct file *file, void *priv, v4l2_std_id *i)
+static int solo_enc_s_std(struct file *file, void *priv, v4l2_std_id i)
{
return 0;
}
diff --git a/drivers/staging/media/solo6x10/v4l2.c b/drivers/staging/media/solo6x10/v4l2.c
index ca774cc..87f3c04 100644
--- a/drivers/staging/media/solo6x10/v4l2.c
+++ b/drivers/staging/media/solo6x10/v4l2.c
@@ -773,7 +773,7 @@ static int solo_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return videobuf_streamoff(&fh->vidq);
}
-static int solo_s_std(struct file *file, void *priv, v4l2_std_id *i)
+static int solo_s_std(struct file *file, void *priv, v4l2_std_id i)
{
return 0;
}
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
index a7ca488..57585c7 100644
--- a/include/media/davinci/vpbe.h
+++ b/include/media/davinci/vpbe.h
@@ -132,7 +132,7 @@ struct vpbe_device_ops {
struct v4l2_enum_dv_timings *timings_info);
/* Set std at the output */
- int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
+ int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id std_id);
/* Get the current std at the output */
int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 0da8682..ee7b7c6 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -132,7 +132,7 @@ struct v4l2_ioctl_ops {
ENUMSTD is handled by videodev.c
*/
int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
- int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
+ int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id norm);
int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
/* Input handling */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
@ 2013-03-15 10:27 ` Hans Verkuil
2013-03-15 12:22 ` Laurent Pinchart
` (2 more replies)
2013-03-15 10:27 ` [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code Hans Verkuil
2013-03-15 12:08 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Laurent Pinchart
4 siblings, 3 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary, Hans Verkuil
From: Hans Verkuil <hans.verkuil@cisco.com>
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/dvb-frontends/au8522_decoder.c | 2 +-
drivers/media/i2c/ad9389b.c | 2 +-
drivers/media/i2c/adv7183.c | 2 +-
drivers/media/i2c/adv7604.c | 2 +-
drivers/media/i2c/ak881x.c | 2 +-
drivers/media/i2c/cs5345.c | 2 +-
drivers/media/i2c/cx25840/cx25840-core.c | 2 +-
drivers/media/i2c/m52790.c | 2 +-
drivers/media/i2c/mt9m032.c | 2 +-
drivers/media/i2c/mt9v011.c | 2 +-
drivers/media/i2c/ov7670.c | 2 +-
drivers/media/i2c/saa7115.c | 2 +-
drivers/media/i2c/saa7127.c | 2 +-
drivers/media/i2c/saa717x.c | 2 +-
drivers/media/i2c/soc_camera/mt9m001.c | 2 +-
drivers/media/i2c/soc_camera/mt9m111.c | 2 +-
drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
drivers/media/i2c/soc_camera/mt9t112.c | 2 +-
drivers/media/i2c/soc_camera/mt9v022.c | 2 +-
drivers/media/i2c/soc_camera/ov2640.c | 2 +-
drivers/media/i2c/soc_camera/ov5642.c | 2 +-
drivers/media/i2c/soc_camera/ov6650.c | 2 +-
drivers/media/i2c/soc_camera/ov772x.c | 2 +-
drivers/media/i2c/soc_camera/ov9640.c | 2 +-
drivers/media/i2c/soc_camera/ov9740.c | 2 +-
drivers/media/i2c/soc_camera/rj54n1cb0c.c | 2 +-
drivers/media/i2c/soc_camera/tw9910.c | 2 +-
drivers/media/i2c/tvp5150.c | 2 +-
drivers/media/i2c/tvp7002.c | 2 +-
drivers/media/i2c/upd64031a.c | 2 +-
drivers/media/i2c/upd64083.c | 2 +-
drivers/media/i2c/vs6624.c | 2 +-
drivers/media/pci/bt8xx/bttv-driver.c | 5 +--
drivers/media/pci/cx18/cx18-av-core.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.c | 36 +++++++---------
drivers/media/pci/cx23885/cx23885-ioctl.c | 9 ++--
drivers/media/pci/cx23885/cx23885-ioctl.h | 2 +-
drivers/media/pci/cx23885/cx23888-ir.c | 2 +-
drivers/media/pci/cx25821/cx25821-video.c | 2 +-
drivers/media/pci/cx25821/cx25821-video.h | 2 +-
drivers/media/pci/cx88/cx88-video.c | 2 +-
drivers/media/pci/ivtv/ivtv-ioctl.c | 51 ++++++++++++-----------
drivers/media/pci/saa7134/saa7134-video.c | 2 +-
drivers/media/pci/saa7146/mxb.c | 3 +-
drivers/media/pci/saa7164/saa7164-encoder.c | 2 +-
drivers/media/platform/blackfin/bfin_capture.c | 2 +-
drivers/media/platform/davinci/vpbe_display.c | 2 +-
drivers/media/platform/davinci/vpif_capture.c | 3 +-
drivers/media/platform/davinci/vpif_display.c | 3 +-
drivers/media/platform/marvell-ccic/mcam-core.c | 2 +-
drivers/media/platform/sh_vou.c | 2 +-
drivers/media/platform/soc_camera/soc_camera.c | 2 +-
drivers/media/usb/au0828/au0828-video.c | 2 +-
drivers/media/usb/cx231xx/cx231xx-video.c | 2 +-
drivers/media/usb/cx231xx/cx231xx.h | 2 +-
drivers/media/usb/em28xx/em28xx-video.c | 2 +-
drivers/media/usb/gspca/gspca.c | 2 +-
drivers/media/usb/gspca/gspca.h | 8 ++--
drivers/media/usb/gspca/pac7302.c | 2 +-
drivers/media/usb/gspca/sn9c20x.c | 2 +-
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
drivers/media/usb/pvrusb2/pvrusb2-hdw.h | 2 +-
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +-
drivers/media/usb/stk1160/stk1160-v4l.c | 2 +-
drivers/media/usb/usbvision/usbvision-video.c | 2 +-
drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
include/media/v4l2-ioctl.h | 2 +-
include/media/v4l2-subdev.h | 2 +-
68 files changed, 115 insertions(+), 123 deletions(-)
diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c
index 5243ba6..526902b 100644
--- a/drivers/media/dvb-frontends/au8522_decoder.c
+++ b/drivers/media/dvb-frontends/au8522_decoder.c
@@ -583,7 +583,7 @@ static int au8522_g_register(struct v4l2_subdev *sd,
}
static int au8522_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct au8522_state *state = to_state(sd);
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index c2886b6..58344b6 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -354,7 +354,7 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int ad9389b_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index 6fed5b7..56a1fa4 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -507,7 +507,7 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int adv7183_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index f47555b..31a63c9 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -699,7 +699,7 @@ static int adv7604_g_register(struct v4l2_subdev *sd,
}
static int adv7604_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/ak881x.c b/drivers/media/i2c/ak881x.c
index ba67465..fd47465 100644
--- a/drivers/media/i2c/ak881x.c
+++ b/drivers/media/i2c/ak881x.c
@@ -101,7 +101,7 @@ static int ak881x_g_register(struct v4l2_subdev *sd,
}
static int ak881x_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/cs5345.c b/drivers/media/i2c/cs5345.c
index c8581e2..1d2f7c8 100644
--- a/drivers/media/i2c/cs5345.c
+++ b/drivers/media/i2c/cs5345.c
@@ -110,7 +110,7 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
return 0;
}
-static int cs5345_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index 234b7c6..12fb9b2 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1671,7 +1671,7 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int cx25840_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/m52790.c b/drivers/media/i2c/m52790.c
index 0991576..39f50fd 100644
--- a/drivers/media/i2c/m52790.c
+++ b/drivers/media/i2c/m52790.c
@@ -96,7 +96,7 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
return 0;
}
-static int m52790_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct m52790_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
index f80c1d7e..2526b66 100644
--- a/drivers/media/i2c/mt9m032.c
+++ b/drivers/media/i2c/mt9m032.c
@@ -548,7 +548,7 @@ static int mt9m032_g_register(struct v4l2_subdev *sd,
}
static int mt9m032_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct mt9m032 *sensor = to_mt9m032(sd);
struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c
index 73b7688..3f415fd 100644
--- a/drivers/media/i2c/mt9v011.c
+++ b/drivers/media/i2c/mt9v011.c
@@ -421,7 +421,7 @@ static int mt9v011_g_register(struct v4l2_subdev *sd,
}
static int mt9v011_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 05ed5b8..617ad3f 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -1487,7 +1487,7 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
return ret;
}
-static int ov7670_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c
index 6b6788c..5d9d033 100644
--- a/drivers/media/i2c/saa7115.c
+++ b/drivers/media/i2c/saa7115.c
@@ -1428,7 +1428,7 @@ static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int saa711x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c
index b745f68..8a47ac1 100644
--- a/drivers/media/i2c/saa7127.c
+++ b/drivers/media/i2c/saa7127.c
@@ -672,7 +672,7 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int saa7127_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c
index 5608b93..cf3a0aa 100644
--- a/drivers/media/i2c/saa717x.c
+++ b/drivers/media/i2c/saa717x.c
@@ -988,7 +988,7 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int saa717x_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
u16 addr = reg->reg & 0xffff;
diff --git a/drivers/media/i2c/soc_camera/mt9m001.c b/drivers/media/i2c/soc_camera/mt9m001.c
index bcdc861..dd90898 100644
--- a/drivers/media/i2c/soc_camera/mt9m001.c
+++ b/drivers/media/i2c/soc_camera/mt9m001.c
@@ -360,7 +360,7 @@ static int mt9m001_g_register(struct v4l2_subdev *sd,
}
static int mt9m001_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c
index bbc4ff9..5f71196 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -641,7 +641,7 @@ static int mt9m111_g_register(struct v4l2_subdev *sd,
}
static int mt9m111_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c
index d80d044..26a15b8 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -430,7 +430,7 @@ static int mt9t031_g_register(struct v4l2_subdev *sd,
}
static int mt9t031_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/mt9t112.c b/drivers/media/i2c/soc_camera/mt9t112.c
index 188e29b..a7256b7 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -766,7 +766,7 @@ static int mt9t112_g_register(struct v4l2_subdev *sd,
}
static int mt9t112_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret;
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c
index a5e65d6..0d917b6 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -488,7 +488,7 @@ static int mt9v022_g_register(struct v4l2_subdev *sd,
}
static int mt9v022_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov2640.c b/drivers/media/i2c/soc_camera/ov2640.c
index 0f520f6..e316842 100644
--- a/drivers/media/i2c/soc_camera/ov2640.c
+++ b/drivers/media/i2c/soc_camera/ov2640.c
@@ -756,7 +756,7 @@ static int ov2640_g_register(struct v4l2_subdev *sd,
}
static int ov2640_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov5642.c b/drivers/media/i2c/soc_camera/ov5642.c
index 9d53309..9aa56de 100644
--- a/drivers/media/i2c/soc_camera/ov5642.c
+++ b/drivers/media/i2c/soc_camera/ov5642.c
@@ -708,7 +708,7 @@ static int ov5642_get_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
return ret;
}
-static int ov5642_set_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int ov5642_set_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/soc_camera/ov6650.c
index dbe4f56..991202d 100644
--- a/drivers/media/i2c/soc_camera/ov6650.c
+++ b/drivers/media/i2c/soc_camera/ov6650.c
@@ -421,7 +421,7 @@ static int ov6650_get_register(struct v4l2_subdev *sd,
}
static int ov6650_set_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov772x.c b/drivers/media/i2c/soc_camera/ov772x.c
index fbeb5b2..713d62e 100644
--- a/drivers/media/i2c/soc_camera/ov772x.c
+++ b/drivers/media/i2c/soc_camera/ov772x.c
@@ -652,7 +652,7 @@ static int ov772x_g_register(struct v4l2_subdev *sd,
}
static int ov772x_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 0599304..20ca62d 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -322,7 +322,7 @@ static int ov9640_get_register(struct v4l2_subdev *sd,
}
static int ov9640_set_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c
index 2f236da..012bd62 100644
--- a/drivers/media/i2c/soc_camera/ov9740.c
+++ b/drivers/media/i2c/soc_camera/ov9740.c
@@ -835,7 +835,7 @@ static int ov9740_get_register(struct v4l2_subdev *sd,
}
static int ov9740_set_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/rj54n1cb0c.c b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
index 5c92679..1f9ec3b 100644
--- a/drivers/media/i2c/soc_camera/rj54n1cb0c.c
+++ b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
@@ -1161,7 +1161,7 @@ static int rj54n1_g_register(struct v4l2_subdev *sd,
}
static int rj54n1_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/tw9910.c b/drivers/media/i2c/soc_camera/tw9910.c
index 7d20746..bad90b1 100644
--- a/drivers/media/i2c/soc_camera/tw9910.c
+++ b/drivers/media/i2c/soc_camera/tw9910.c
@@ -554,7 +554,7 @@ static int tw9910_g_register(struct v4l2_subdev *sd,
}
static int tw9910_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 5967e1a0..485159a 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1067,7 +1067,7 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *
return 0;
}
-static int tvp5150_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 537f6b4..598ed25 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -824,7 +824,7 @@ static int tvp7002_g_register(struct v4l2_subdev *sd,
* -EPERM if call not allowed.
*/
static int tvp7002_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/upd64031a.c b/drivers/media/i2c/upd64031a.c
index d15cfd9..f0a0921 100644
--- a/drivers/media/i2c/upd64031a.c
+++ b/drivers/media/i2c/upd64031a.c
@@ -175,7 +175,7 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
return 0;
}
-static int upd64031a_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/upd64083.c b/drivers/media/i2c/upd64083.c
index 75d6acc..343e021 100644
--- a/drivers/media/i2c/upd64083.c
+++ b/drivers/media/i2c/upd64083.c
@@ -133,7 +133,7 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register
return 0;
}
-static int upd64083_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c
index 9ac1b8c3..f366fad 100644
--- a/drivers/media/i2c/vs6624.c
+++ b/drivers/media/i2c/vs6624.c
@@ -748,7 +748,7 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r
return 0;
}
-static int vs6624_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
+static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 79dc12c..1560591 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1943,7 +1943,7 @@ static int bttv_g_register(struct file *file, void *f,
}
static int bttv_s_register(struct file *file, void *f,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct bttv_fh *fh = f;
struct bttv *btv = fh->btv;
@@ -1959,8 +1959,7 @@ static int bttv_s_register(struct file *file, void *f,
}
/* bt848 has a 12-bit register space */
- reg->reg &= 0xfff;
- btwrite(reg->val, reg->reg);
+ btwrite(reg->val, reg->reg & 0xfff);
return 0;
}
diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c
index c22242b..38b1d64 100644
--- a/drivers/media/pci/cx18/cx18-av-core.c
+++ b/drivers/media/pci/cx18/cx18-av-core.c
@@ -1266,7 +1266,7 @@ static int cx18_av_g_register(struct v4l2_subdev *sd,
}
static int cx18_av_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx18 *cx = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index 254c50f..7dbd5a9 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -415,42 +415,34 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
-static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
-{
- struct v4l2_dbg_register *regs = arg;
-
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
- if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
- return -EINVAL;
-
- regs->size = 4;
- if (cmd == VIDIOC_DBG_S_REGISTER)
- cx18_write_enc(cx, regs->val, regs->reg);
- else
- regs->val = cx18_read_enc(cx, regs->reg);
- return 0;
-}
-
static int cx18_g_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg)
{
struct cx18 *cx = fh2id(fh)->cx;
- if (v4l2_chip_match_host(®->match))
- return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
+ if (v4l2_chip_match_host(®->match)) {
+ if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
+ return -EINVAL;
+ reg->size = 4;
+ reg->val = cx18_read_enc(cx, reg->reg);
+ return 0;
+ }
/* FIXME - errors shouldn't be ignored */
cx18_call_all(cx, core, g_register, reg);
return 0;
}
static int cx18_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx18 *cx = fh2id(fh)->cx;
- if (v4l2_chip_match_host(®->match))
- return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
+ if (v4l2_chip_match_host(®->match)) {
+ if (reg->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
+ return -EINVAL;
+ cx18_write_enc(cx, reg->val, reg->reg);
+ return 0;
+ }
/* FIXME - errors shouldn't be ignored */
cx18_call_all(cx, core, s_register, reg);
return 0;
diff --git a/drivers/media/pci/cx23885/cx23885-ioctl.c b/drivers/media/pci/cx23885/cx23885-ioctl.c
index ea9a614..acdb6d5 100644
--- a/drivers/media/pci/cx23885/cx23885-ioctl.c
+++ b/drivers/media/pci/cx23885/cx23885-ioctl.c
@@ -158,18 +158,17 @@ int cx23885_g_register(struct file *file, void *fh,
}
static int cx23885_s_host_register(struct cx23885_dev *dev,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
if ((reg->reg & 0x3) != 0 || reg->reg >= pci_resource_len(dev->pci, 0))
return -EINVAL;
- reg->size = 4;
cx_write(reg->reg, reg->val);
return 0;
}
static int cx23417_s_register(struct cx23885_dev *dev,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
if (dev->v4l_device == NULL)
return -EINVAL;
@@ -179,13 +178,11 @@ static int cx23417_s_register(struct cx23885_dev *dev,
if (mc417_register_write(dev, (u16) reg->reg, (u32) reg->val))
return -EINVAL; /* V4L2 spec, but -EREMOTEIO really */
-
- reg->size = 4;
return 0;
}
int cx23885_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
diff --git a/drivers/media/pci/cx23885/cx23885-ioctl.h b/drivers/media/pci/cx23885/cx23885-ioctl.h
index 315be0c..a608096 100644
--- a/drivers/media/pci/cx23885/cx23885-ioctl.h
+++ b/drivers/media/pci/cx23885/cx23885-ioctl.h
@@ -33,7 +33,7 @@ int cx23885_g_register(struct file *file, void *fh,
int cx23885_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg);
+ const struct v4l2_dbg_register *reg);
#endif
#endif
diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
index d51eed0..fa672fe 100644
--- a/drivers/media/pci/cx23885/cx23888-ir.c
+++ b/drivers/media/pci/cx23885/cx23888-ir.c
@@ -1124,7 +1124,7 @@ static int cx23888_ir_g_register(struct v4l2_subdev *sd,
}
static int cx23888_ir_s_register(struct v4l2_subdev *sd,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx23888_ir_state *state = to_state(sd);
u32 addr = CX23888_IR_REG_BASE + (u32) reg->reg;
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index 93c7d57..1465591 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -1364,7 +1364,7 @@ int cx25821_vidioc_g_register(struct file *file, void *fh,
}
int cx25821_vidioc_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx25821_dev *dev = ((struct cx25821_fh *)fh)->dev;
diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
index 239f63c..11ba5eb 100644
--- a/drivers/media/pci/cx25821/cx25821-video.h
+++ b/drivers/media/pci/cx25821/cx25821-video.h
@@ -155,7 +155,7 @@ extern int cx25821_vidioc_s_frequency(struct file *file, void *priv,
extern int cx25821_vidioc_g_register(struct file *file, void *fh,
struct v4l2_dbg_register *reg);
extern int cx25821_vidioc_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg);
+ const struct v4l2_dbg_register *reg);
extern int cx25821_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t);
extern int cx25821_vidioc_s_tuner(struct file *file, void *priv,
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index ead5be5..e3f6181 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1380,7 +1380,7 @@ static int vidioc_g_register (struct file *file, void *fh,
}
static int vidioc_s_register (struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 080f179..15e08aa 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -711,49 +711,50 @@ static int ivtv_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_i
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
-static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
+static volatile u8 __iomem *ivtv_itvc_start(struct ivtv *itv,
+ const struct v4l2_dbg_register *regs)
{
- struct v4l2_dbg_register *regs = arg;
- volatile u8 __iomem *reg_start;
-
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
if (regs->reg >= IVTV_REG_OFFSET && regs->reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
- reg_start = itv->reg_mem - IVTV_REG_OFFSET;
- else if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
+ return itv->reg_mem - IVTV_REG_OFFSET;
+ if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
regs->reg < IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
- reg_start = itv->dec_mem - IVTV_DECODER_OFFSET;
- else if (regs->reg < IVTV_ENCODER_SIZE)
- reg_start = itv->enc_mem;
- else
- return -EINVAL;
-
- regs->size = 4;
- if (cmd == VIDIOC_DBG_G_REGISTER)
- regs->val = readl(regs->reg + reg_start);
- else
- writel(regs->val, regs->reg + reg_start);
- return 0;
+ return itv->dec_mem - IVTV_DECODER_OFFSET;
+ if (regs->reg < IVTV_ENCODER_SIZE)
+ return itv->enc_mem;
+ return NULL;
}
static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
{
struct ivtv *itv = fh2id(fh)->itv;
- if (v4l2_chip_match_host(®->match))
- return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
+ if (v4l2_chip_match_host(®->match)) {
+ volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
+
+ if (reg_start == NULL)
+ return -EINVAL;
+ reg->size = 4;
+ reg->val = readl(reg->reg + reg_start);
+ return 0;
+ }
/* TODO: subdev errors should not be ignored, this should become a
subdev helper function. */
ivtv_call_all(itv, core, g_register, reg);
return 0;
}
-static int ivtv_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
+static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
{
struct ivtv *itv = fh2id(fh)->itv;
- if (v4l2_chip_match_host(®->match))
- return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
+ if (v4l2_chip_match_host(®->match)) {
+ volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
+
+ if (reg_start == NULL)
+ return -EINVAL;
+ writel(reg->val, reg->reg + reg_start);
+ return 0;
+ }
/* TODO: subdev errors should not be ignored, this should become a
subdev helper function. */
ivtv_call_all(itv, core, s_register, reg);
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index a6c69a4..1363e97 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2300,7 +2300,7 @@ static int vidioc_g_register (struct file *file, void *priv,
}
static int vidioc_s_register (struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 9dd044b..71e8bea 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -680,7 +680,7 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
return 0;
}
-static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_register *reg)
+static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
@@ -688,7 +688,6 @@ static int vidioc_s_register(struct file *file, void *fh, struct v4l2_dbg_regist
return -EPERM;
if (v4l2_chip_match_host(®->match)) {
saa7146_write(dev, reg->reg, reg->val);
- reg->size = 4;
return 0;
}
return call_all(dev, core, s_register, reg);
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 538de52..0b74fb2 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -1313,7 +1313,7 @@ static int saa7164_g_register(struct file *file, void *fh,
}
static int saa7164_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
struct saa7164_dev *dev = port->dev;
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index fcf39b2..ce8937c 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -890,7 +890,7 @@ static int bcap_dbg_g_register(struct file *file, void *priv,
}
static int bcap_dbg_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct bcap_device *bcap_dev = video_drvdata(file);
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index 1311cdf..4b00ad1 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -1601,7 +1601,7 @@ static int vpbe_display_g_register(struct file *file, void *priv,
}
static int vpbe_display_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
return 0;
}
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 4e78839..cba34cd 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1924,7 +1924,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
* Returns zero or -EINVAL if write operations fails.
*/
static int vpif_dbg_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg){
+ const struct v4l2_dbg_register *reg)
+{
struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel;
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index dced173..94087cf 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1568,7 +1568,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
* Returns zero or -EINVAL if write operations fails.
*/
static int vpif_dbg_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg){
+ const struct v4l2_dbg_register *reg)
+{
struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel;
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 76a8623..64ab91e 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1445,7 +1445,7 @@ static int mcam_vidioc_g_register(struct file *file, void *priv,
}
static int mcam_vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct mcam_camera *cam = priv;
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index ea8a1ee..6cc1313 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -1266,7 +1266,7 @@ static int sh_vou_g_register(struct file *file, void *fh,
}
static int sh_vou_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct sh_vou_device *vou_dev = video_drvdata(file);
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 3592968..bf55abf 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1042,7 +1042,7 @@ static int soc_camera_g_register(struct file *file, void *fh,
}
static int soc_camera_s_register(struct file *file, void *fh,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct soc_camera_device *icd = file->private_data;
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index e9dd01c..79f1d51 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1754,7 +1754,7 @@ static int vidioc_g_register(struct file *file, void *priv,
}
static int vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 4cff2f4..cd22147 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1404,7 +1404,7 @@ int cx231xx_g_register(struct file *file, void *priv,
}
int cx231xx_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index 4e37d0f..5b0eb59 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -948,7 +948,7 @@ int cx231xx_g_chip_ident(struct file *file, void *fh, struct v4l2_dbg_chip_ident
int cx231xx_g_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg);
int cx231xx_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg);
+ const struct v4l2_dbg_register *reg);
/* Provided by cx231xx-cards.c */
extern void cx231xx_pre_card_setup(struct cx231xx *dev);
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 98cdc4f..c7a7301 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1321,7 +1321,7 @@ static int vidioc_g_register(struct file *file, void *priv,
}
static int vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct em28xx_fh *fh = priv;
struct em28xx *dev = fh->dev;
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 5800d65..23a019a 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -1040,7 +1040,7 @@ static int vidioc_g_register(struct file *file, void *priv,
}
static int vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct gspca_dev *gspca_dev = video_drvdata(file);
diff --git a/drivers/media/usb/gspca/gspca.h b/drivers/media/usb/gspca/gspca.h
index c3af321..ef8efeb 100644
--- a/drivers/media/usb/gspca/gspca.h
+++ b/drivers/media/usb/gspca/gspca.h
@@ -74,8 +74,10 @@ typedef int (*cam_get_jpg_op) (struct gspca_dev *,
struct v4l2_jpegcompression *);
typedef int (*cam_set_jpg_op) (struct gspca_dev *,
const struct v4l2_jpegcompression *);
-typedef int (*cam_reg_op) (struct gspca_dev *,
+typedef int (*cam_get_reg_op) (struct gspca_dev *,
struct v4l2_dbg_register *);
+typedef int (*cam_set_reg_op) (struct gspca_dev *,
+ const struct v4l2_dbg_register *);
typedef int (*cam_ident_op) (struct gspca_dev *,
struct v4l2_dbg_chip_ident *);
typedef void (*cam_streamparm_op) (struct gspca_dev *,
@@ -108,8 +110,8 @@ struct sd_desc {
cam_streamparm_op get_streamparm;
cam_streamparm_op set_streamparm;
#ifdef CONFIG_VIDEO_ADV_DEBUG
- cam_reg_op set_register;
- cam_reg_op get_register;
+ cam_set_reg_op set_register;
+ cam_get_reg_op get_register;
#endif
cam_ident_op get_chip_ident;
#if IS_ENABLED(CONFIG_INPUT)
diff --git a/drivers/media/usb/gspca/pac7302.c b/drivers/media/usb/gspca/pac7302.c
index 682ef33..6008c8d 100644
--- a/drivers/media/usb/gspca/pac7302.c
+++ b/drivers/media/usb/gspca/pac7302.c
@@ -840,7 +840,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
u8 index;
u8 value;
diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c
index 4ec544f..ead9a1f 100644
--- a/drivers/media/usb/gspca/sn9c20x.c
+++ b/drivers/media/usb/gspca/sn9c20x.c
@@ -1598,7 +1598,7 @@ static int sd_dbg_g_register(struct gspca_dev *gspca_dev,
}
static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct sd *sd = (struct sd *) gspca_dev;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 299751a..e11267f 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -5165,7 +5165,7 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
- struct v4l2_dbg_match *match, u64 reg_id,
+ const struct v4l2_dbg_match *match, u64 reg_id,
int setFl, u64 *val_ptr)
{
#ifdef CONFIG_VIDEO_ADV_DEBUG
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.h b/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
index 8060fc6..91bae93 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
@@ -240,7 +240,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,
setFl - true to set the register, false to read it
val_ptr - storage location for source / result. */
int pvr2_hdw_register_access(struct pvr2_hdw *,
- struct v4l2_dbg_match *match, u64 reg_id,
+ const struct v4l2_dbg_match *match, u64 reg_id,
int setFl, u64 *val_ptr);
/* The following entry points are all lower level things you normally don't
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index a7774e3..a8a65fa 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -815,7 +815,7 @@ static int pvr2_g_register(struct file *file, void *priv, struct v4l2_dbg_regist
return ret;
}
-static int pvr2_s_register(struct file *file, void *priv, struct v4l2_dbg_register *req)
+static int pvr2_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *req)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index f6a6cdc..c4c723b 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -500,7 +500,7 @@ static int vidioc_g_register(struct file *file, void *priv,
}
static int vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct stk1160 *dev = video_drvdata(file);
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 041f19e..d34c2af 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -483,7 +483,7 @@ static int vidioc_g_register(struct file *file, void *priv,
}
static int vidioc_s_register(struct file *file, void *priv,
- struct v4l2_dbg_register *reg)
+ const struct v4l2_dbg_register *reg)
{
struct usb_usbvision *usbvision = video_drvdata(file);
int err_code;
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index d80d8af..2abd13a 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1805,7 +1805,7 @@ static int v4l_dbg_s_register(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
#ifdef CONFIG_VIDEO_ADV_DEBUG
- struct v4l2_dbg_register *p = arg;
+ const struct v4l2_dbg_register *p = arg;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index ee7b7c6..a4175cd 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -242,7 +242,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_g_register) (struct file *file, void *fh,
struct v4l2_dbg_register *reg);
int (*vidioc_s_register) (struct file *file, void *fh,
- struct v4l2_dbg_register *reg);
+ const struct v4l2_dbg_register *reg);
#endif
int (*vidioc_g_chip_ident) (struct file *file, void *fh,
struct v4l2_dbg_chip_ident *chip);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 79784fc..8158a08 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -165,7 +165,7 @@ struct v4l2_subdev_core_ops {
long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
#ifdef CONFIG_VIDEO_ADV_DEBUG
int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
- int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
+ int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg);
#endif
int (*s_power)(struct v4l2_subdev *sd, int on);
int (*interrupt_service_routine)(struct v4l2_subdev *sd,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code.
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
` (2 preceding siblings ...)
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
@ 2013-03-15 10:27 ` Hans Verkuil
2013-03-15 12:25 ` Laurent Pinchart
2013-03-15 12:08 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Laurent Pinchart
4 siblings, 1 reply; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 10:27 UTC (permalink / raw)
To: linux-media
Cc: Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Alexey Klimov, Hans de Goede,
Brian Johnson, Mike Isely, Ezequiel Garcia, Huang Shijie,
Ismael Luceno, Takashi Iwai, Ondrej Zary, Hans Verkuil
From: Hans Verkuil <hans.verkuil@cisco.com>
The core debug code can now be simplified since all the write-only ioctls are
now const and will not modify the data they pass to the drivers.
So instead of logging write-only ioctls before the driver is called this can
now be done afterwards, which is cleaner when it comes to error reporting as
well.
This also fixes a logic error in the debugging code where there was one 'else'
too many.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
drivers/media/v4l2-core/v4l2-ioctl.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 2abd13a..b3fe148 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -2147,11 +2147,6 @@ static long __video_do_ioctl(struct file *file,
}
write_only = _IOC_DIR(cmd) == _IOC_WRITE;
- if (write_only && debug > V4L2_DEBUG_IOCTL) {
- v4l_printk_ioctl(video_device_node_name(vfd), cmd);
- pr_cont(": ");
- info->debug(arg, write_only);
- }
if (info->flags & INFO_FL_STD) {
typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
const void *p = vfd->ioctl_ops;
@@ -2170,16 +2165,10 @@ static long __video_do_ioctl(struct file *file,
done:
if (debug) {
- if (write_only && debug > V4L2_DEBUG_IOCTL) {
- if (ret < 0)
- printk(KERN_DEBUG "%s: error %ld\n",
- video_device_node_name(vfd), ret);
- return ret;
- }
v4l_printk_ioctl(video_device_node_name(vfd), cmd);
if (ret < 0)
- pr_cont(": error %ld\n", ret);
- else if (debug == V4L2_DEBUG_IOCTL)
+ pr_cont(": error %ld", ret);
+ if (debug == V4L2_DEBUG_IOCTL)
pr_cont("\n");
else if (_IOC_DIR(cmd) == _IOC_NONE)
info->debug(arg, write_only);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
` (3 preceding siblings ...)
2013-03-15 10:27 ` [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code Hans Verkuil
@ 2013-03-15 12:08 ` Laurent Pinchart
2013-03-15 12:18 ` Hans Verkuil
4 siblings, 1 reply; 21+ messages in thread
From: Laurent Pinchart @ 2013-03-15 12:08 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch.
On Friday 15 March 2013 11:27:21 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[snip]
> diff --git a/drivers/media/radio/radio-isa.c
> b/drivers/media/radio/radio-isa.c index fe0a4f8..0c1e27b 100644
> --- a/drivers/media/radio/radio-isa.c
> +++ b/drivers/media/radio/radio-isa.c
> @@ -102,17 +102,18 @@ static int radio_isa_s_tuner(struct file *file, void
> *priv, }
>
> static int radio_isa_s_frequency(struct file *file, void *priv,
> - struct v4l2_frequency *f)
> + const struct v4l2_frequency *f)
> {
> struct radio_isa_card *isa = video_drvdata(file);
> + u32 freq = f->frequency;
> int res;
>
> if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> return -EINVAL;
> - f->frequency = clamp(f->frequency, FREQ_LOW, FREQ_HIGH);
> - res = isa->drv->ops->s_frequency(isa, f->frequency);
> + freq = clamp(freq, FREQ_LOW, FREQ_HIGH);
Micro-optimization here, you could just declare
u32 freq;
above and then write
freq = clamp(f->frequency, FREQ_LOW, FREQ_HIGH);
> + res = isa->drv->ops->s_frequency(isa, freq);
> if (res == 0)
> - isa->freq = f->frequency;
> + isa->freq = freq;
> return res;
> }
>
> diff --git a/drivers/media/radio/radio-keene.c
> b/drivers/media/radio/radio-keene.c index 296941a..a90b7a8 100644
> --- a/drivers/media/radio/radio-keene.c
> +++ b/drivers/media/radio/radio-keene.c
> @@ -82,9 +82,12 @@ static inline struct keene_device *to_keene_dev(struct
> v4l2_device *v4l2_dev) /* Set frequency (if non-0), PA, mute and turn
> on/off the FM transmitter. */ static int keene_cmd_main(struct keene_device
> *radio, unsigned freq, bool play) {
> - unsigned short freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
> + unsigned short freq_send;
> int ret;
>
> + if (freq)
> + freq = clamp(freq, FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
There was no similar if (freq) in the function below, doesn't this change the
behaviour ?
> + freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
> radio->buffer[0] = 0x00;
> radio->buffer[1] = 0x50;
> radio->buffer[2] = (freq_send >> 8) & 0xff;
> @@ -215,14 +218,12 @@ static int vidioc_s_modulator(struct file *file, void
> *priv, }
>
> static int vidioc_s_frequency(struct file *file, void *priv,
> - struct v4l2_frequency *f)
> + const struct v4l2_frequency *f)
> {
> struct keene_device *radio = video_drvdata(file);
>
> if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> return -EINVAL;
> - f->frequency = clamp(f->frequency,
> - FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
> return keene_cmd_main(radio, f->frequency, true);
> }
>
[snip]
> diff --git a/drivers/media/radio/radio-miropcm20.c
> b/drivers/media/radio/radio-miropcm20.c index 3d0ff44..2b8d31d 100644
> --- a/drivers/media/radio/radio-miropcm20.c
> +++ b/drivers/media/radio/radio-miropcm20.c
> @@ -131,14 +131,14 @@ static int vidioc_g_frequency(struct file *file, void
> *priv,
>
>
> static int vidioc_s_frequency(struct file *file, void *priv,
> - struct v4l2_frequency *f)
> + const struct v4l2_frequency *f)
> {
> struct pcm20 *dev = video_drvdata(file);
>
> if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> return -EINVAL;
>
> - dev->freq = clamp(f->frequency, 87 * 16000U, 108 * 16000U);
> + dev->freq = clamp_t(u32, f->frequency, 87 * 16000U, 108 * 16000U);
f->frequency and the two clamp boundaries are unsigned, did clamp() throw a
warning ?
> pcm20_setfreq(dev, dev->freq);
> return 0;
> }
[snip]
> diff --git a/drivers/media/usb/tlg2300/pd-video.c
> b/drivers/media/usb/tlg2300/pd-video.c index dab0ca3..8ef7c8c 100644
> --- a/drivers/media/usb/tlg2300/pd-video.c
> +++ b/drivers/media/usb/tlg2300/pd-video.c
> @@ -1079,10 +1079,11 @@ static int set_frequency(struct poseidon *pd, u32
> *frequency) }
>
> static int vidioc_s_frequency(struct file *file, void *fh,
> - struct v4l2_frequency *freq)
> + const struct v4l2_frequency *freq)
> {
> struct front_face *front = fh;
> struct poseidon *pd = front->pd;
> + u32 frequency = freq->frequency;
>
> if (freq->tuner)
> return -EINVAL;
> @@ -1090,7 +1091,7 @@ static int vidioc_s_frequency(struct file *file, void
> *fh, pd->pm_suspend = pm_video_suspend;
> pd->pm_resume = pm_video_resume;
> #endif
> - return set_frequency(pd, &freq->frequency);
> + return set_frequency(pd, &frequency);
Wouldn't it be better to pass the frequency by value to set_frequency() ?
> }
>
[snip]
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index b137a5e..1a82a50 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -191,7 +191,7 @@ struct v4l2_subdev_core_ops {
> */
> struct v4l2_subdev_tuner_ops {
> int (*s_radio)(struct v4l2_subdev *sd);
> - int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
> + int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency
> *freq);
Ideally we shouldn't push the same design mistake to subdev ops, but that
would require too many changes in all the drivers, so I'm fine with this.
> int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
> int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
> int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
@ 2013-03-15 12:12 ` Laurent Pinchart
2013-03-16 12:18 ` Alexey Klimov
1 sibling, 0 replies; 21+ messages in thread
From: Laurent Pinchart @ 2013-03-15 12:12 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch.
On Friday 15 March 2013 11:27:22 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
@ 2013-03-15 12:17 ` Laurent Pinchart
2013-03-15 13:38 ` Jonathan Corbet
` (3 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Laurent Pinchart @ 2013-03-15 12:17 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch.
On Friday 15 March 2013 11:27:23 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument by value instead of by
> reference. I could have chosen to add const instead, but this is 1) easier
> to handle in drivers and 2) consistent with the s_std subdev operation.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[snip]
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> b/drivers/media/v4l2-core/v4l2-ioctl.c index 8ec8abe..d80d8af 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1383,15 +1383,15 @@ static int v4l_s_std(const struct v4l2_ioctl_ops
> *ops, struct file *file, void *fh, void *arg)
> {
> struct video_device *vfd = video_devdata(file);
> - v4l2_std_id *id = arg, norm;
> + v4l2_std_id id = *(v4l2_std_id *)arg, norm;
This is getting a bit hard to read, I would have split the declaration of norm
to a separate line, but that's just nit-picking.
> int ret;
>
> - norm = (*id) & vfd->tvnorms;
> + norm = id & vfd->tvnorms;
> if (vfd->tvnorms && !norm) /* Check if std is supported */
> return -EINVAL;
>
> /* Calls the specific handler */
> - ret = ops->vidioc_s_std(file, fh, &norm);
> + ret = ops->vidioc_s_std(file, fh, norm);
>
> /* Updates standard information */
> if (ret >= 0)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl.
2013-03-15 12:08 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Laurent Pinchart
@ 2013-03-15 12:18 ` Hans Verkuil
0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 12:18 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
On Fri March 15 2013 13:08:23 Laurent Pinchart wrote:
> Hi Hans,
>
> Thanks for the patch.
>
> On Friday 15 March 2013 11:27:21 Hans Verkuil wrote:
> > From: Hans Verkuil <hans.verkuil@cisco.com>
> >
> > This ioctl is defined as IOW, so pass the argument as const.
> >
> > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> [snip]
>
> > diff --git a/drivers/media/radio/radio-isa.c
> > b/drivers/media/radio/radio-isa.c index fe0a4f8..0c1e27b 100644
> > --- a/drivers/media/radio/radio-isa.c
> > +++ b/drivers/media/radio/radio-isa.c
> > @@ -102,17 +102,18 @@ static int radio_isa_s_tuner(struct file *file, void
> > *priv, }
> >
> > static int radio_isa_s_frequency(struct file *file, void *priv,
> > - struct v4l2_frequency *f)
> > + const struct v4l2_frequency *f)
> > {
> > struct radio_isa_card *isa = video_drvdata(file);
> > + u32 freq = f->frequency;
> > int res;
> >
> > if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> > return -EINVAL;
> > - f->frequency = clamp(f->frequency, FREQ_LOW, FREQ_HIGH);
> > - res = isa->drv->ops->s_frequency(isa, f->frequency);
> > + freq = clamp(freq, FREQ_LOW, FREQ_HIGH);
>
> Micro-optimization here, you could just declare
>
> u32 freq;
>
> above and then write
>
> freq = clamp(f->frequency, FREQ_LOW, FREQ_HIGH);
I'd call this a nano-optimization :-)
>
> > + res = isa->drv->ops->s_frequency(isa, freq);
> > if (res == 0)
> > - isa->freq = f->frequency;
> > + isa->freq = freq;
> > return res;
> > }
> >
> > diff --git a/drivers/media/radio/radio-keene.c
> > b/drivers/media/radio/radio-keene.c index 296941a..a90b7a8 100644
> > --- a/drivers/media/radio/radio-keene.c
> > +++ b/drivers/media/radio/radio-keene.c
> > @@ -82,9 +82,12 @@ static inline struct keene_device *to_keene_dev(struct
> > v4l2_device *v4l2_dev) /* Set frequency (if non-0), PA, mute and turn
> > on/off the FM transmitter. */ static int keene_cmd_main(struct keene_device
> > *radio, unsigned freq, bool play) {
> > - unsigned short freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
> > + unsigned short freq_send;
> > int ret;
> >
> > + if (freq)
> > + freq = clamp(freq, FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
>
> There was no similar if (freq) in the function below, doesn't this change the
> behaviour ?
You are correct. Well spotted. I'll correct that.
>
> > + freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
> > radio->buffer[0] = 0x00;
> > radio->buffer[1] = 0x50;
> > radio->buffer[2] = (freq_send >> 8) & 0xff;
> > @@ -215,14 +218,12 @@ static int vidioc_s_modulator(struct file *file, void
> > *priv, }
> >
> > static int vidioc_s_frequency(struct file *file, void *priv,
> > - struct v4l2_frequency *f)
> > + const struct v4l2_frequency *f)
> > {
> > struct keene_device *radio = video_drvdata(file);
> >
> > if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> > return -EINVAL;
> > - f->frequency = clamp(f->frequency,
> > - FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL);
> > return keene_cmd_main(radio, f->frequency, true);
> > }
> >
>
> [snip]
>
> > diff --git a/drivers/media/radio/radio-miropcm20.c
> > b/drivers/media/radio/radio-miropcm20.c index 3d0ff44..2b8d31d 100644
> > --- a/drivers/media/radio/radio-miropcm20.c
> > +++ b/drivers/media/radio/radio-miropcm20.c
> > @@ -131,14 +131,14 @@ static int vidioc_g_frequency(struct file *file, void
> > *priv,
> >
> >
> > static int vidioc_s_frequency(struct file *file, void *priv,
> > - struct v4l2_frequency *f)
> > + const struct v4l2_frequency *f)
> > {
> > struct pcm20 *dev = video_drvdata(file);
> >
> > if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
> > return -EINVAL;
> >
> > - dev->freq = clamp(f->frequency, 87 * 16000U, 108 * 16000U);
> > + dev->freq = clamp_t(u32, f->frequency, 87 * 16000U, 108 * 16000U);
>
> f->frequency and the two clamp boundaries are unsigned, did clamp() throw a
> warning ?
Yeah. clamp uses:
typeof(val) __val = (val)
where 'val' is f->frequency, and typeof(f->frequency) == const u32. So assigning
'val' to __val gives a compiler error. clamp_t doesn't have that problem.
>
> > pcm20_setfreq(dev, dev->freq);
> > return 0;
> > }
>
> [snip]
>
> > diff --git a/drivers/media/usb/tlg2300/pd-video.c
> > b/drivers/media/usb/tlg2300/pd-video.c index dab0ca3..8ef7c8c 100644
> > --- a/drivers/media/usb/tlg2300/pd-video.c
> > +++ b/drivers/media/usb/tlg2300/pd-video.c
> > @@ -1079,10 +1079,11 @@ static int set_frequency(struct poseidon *pd, u32
> > *frequency) }
> >
> > static int vidioc_s_frequency(struct file *file, void *fh,
> > - struct v4l2_frequency *freq)
> > + const struct v4l2_frequency *freq)
> > {
> > struct front_face *front = fh;
> > struct poseidon *pd = front->pd;
> > + u32 frequency = freq->frequency;
> >
> > if (freq->tuner)
> > return -EINVAL;
> > @@ -1090,7 +1091,7 @@ static int vidioc_s_frequency(struct file *file, void
> > *fh, pd->pm_suspend = pm_video_suspend;
> > pd->pm_resume = pm_video_resume;
> > #endif
> > - return set_frequency(pd, &freq->frequency);
> > + return set_frequency(pd, &frequency);
>
> Wouldn't it be better to pass the frequency by value to set_frequency() ?
Looking at the code, I'd say so. However, I am very hesitant to change too
much in this driver. My only tlg2300 usb stick died on me and I am unable to
find another so I have no way of testing. In other words, I want the change
to be minimal here.
>
> > }
> >
>
> [snip]
>
> > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> > index b137a5e..1a82a50 100644
> > --- a/include/media/v4l2-subdev.h
> > +++ b/include/media/v4l2-subdev.h
> > @@ -191,7 +191,7 @@ struct v4l2_subdev_core_ops {
> > */
> > struct v4l2_subdev_tuner_ops {
> > int (*s_radio)(struct v4l2_subdev *sd);
> > - int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
> > + int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency
> > *freq);
>
> Ideally we shouldn't push the same design mistake to subdev ops, but that
> would require too many changes in all the drivers, so I'm fine with this.
>
> > int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
> > int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
> > int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
>
>
Thanks for your review!
Regards,
Hans
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
@ 2013-03-15 12:22 ` Laurent Pinchart
2013-03-16 6:50 ` Guennadi Liakhovetski
2013-03-16 7:43 ` Prabhakar Lad
2 siblings, 0 replies; 21+ messages in thread
From: Laurent Pinchart @ 2013-03-15 12:22 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch.
On Friday 15 March 2013 11:27:24 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[snip]
> diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c
> b/drivers/media/pci/ivtv/ivtv-ioctl.c index 080f179..15e08aa 100644
> --- a/drivers/media/pci/ivtv/ivtv-ioctl.c
> +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
> @@ -711,49 +711,50 @@ static int ivtv_g_chip_ident(struct file *file, void
> *fh, struct v4l2_dbg_chip_i }
>
> #ifdef CONFIG_VIDEO_ADV_DEBUG
> -static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
> +static volatile u8 __iomem *ivtv_itvc_start(struct ivtv *itv,
> + const struct v4l2_dbg_register *regs)
As you use the proper __iomem accessors I don't think you need a volatile.
> {
> - struct v4l2_dbg_register *regs = arg;
> - volatile u8 __iomem *reg_start;
> -
> - if (!capable(CAP_SYS_ADMIN))
> - return -EPERM;
> if (regs->reg >= IVTV_REG_OFFSET && regs->reg < IVTV_REG_OFFSET +
> IVTV_REG_SIZE) - reg_start = itv->reg_mem - IVTV_REG_OFFSET;
> - else if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
> + return itv->reg_mem - IVTV_REG_OFFSET;
> + if (itv->has_cx23415 && regs->reg >= IVTV_DECODER_OFFSET &&
> regs->reg < IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
> - reg_start = itv->dec_mem - IVTV_DECODER_OFFSET;
> - else if (regs->reg < IVTV_ENCODER_SIZE)
> - reg_start = itv->enc_mem;
> - else
> - return -EINVAL;
> -
> - regs->size = 4;
> - if (cmd == VIDIOC_DBG_G_REGISTER)
> - regs->val = readl(regs->reg + reg_start);
> - else
> - writel(regs->val, regs->reg + reg_start);
> - return 0;
> + return itv->dec_mem - IVTV_DECODER_OFFSET;
> + if (regs->reg < IVTV_ENCODER_SIZE)
> + return itv->enc_mem;
> + return NULL;
> }
>
> static int ivtv_g_register(struct file *file, void *fh, struct
> v4l2_dbg_register *reg) {
> struct ivtv *itv = fh2id(fh)->itv;
>
> - if (v4l2_chip_match_host(®->match))
> - return ivtv_itvc(itv, VIDIOC_DBG_G_REGISTER, reg);
> + if (v4l2_chip_match_host(®->match)) {
> + volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
> +
> + if (reg_start == NULL)
> + return -EINVAL;
> + reg->size = 4;
> + reg->val = readl(reg->reg + reg_start);
> + return 0;
> + }
> /* TODO: subdev errors should not be ignored, this should become a
> subdev helper function. */
> ivtv_call_all(itv, core, g_register, reg);
> return 0;
> }
>
> -static int ivtv_s_register(struct file *file, void *fh, struct
> v4l2_dbg_register *reg) +static int ivtv_s_register(struct file *file, void
> *fh, const struct v4l2_dbg_register *reg) {
> struct ivtv *itv = fh2id(fh)->itv;
>
> - if (v4l2_chip_match_host(®->match))
> - return ivtv_itvc(itv, VIDIOC_DBG_S_REGISTER, reg);
> + if (v4l2_chip_match_host(®->match)) {
> + volatile u8 __iomem *reg_start = ivtv_itvc_start(itv, reg);
> +
> + if (reg_start == NULL)
> + return -EINVAL;
> + writel(reg->val, reg->reg + reg_start);
> + return 0;
> + }
> /* TODO: subdev errors should not be ignored, this should become a
> subdev helper function. */
> ivtv_call_all(itv, core, s_register, reg);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code.
2013-03-15 10:27 ` [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code Hans Verkuil
@ 2013-03-15 12:25 ` Laurent Pinchart
2013-03-18 13:52 ` Hans Verkuil
0 siblings, 1 reply; 21+ messages in thread
From: Laurent Pinchart @ 2013-03-15 12:25 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch.
On Friday 15 March 2013 11:27:25 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> The core debug code can now be simplified since all the write-only ioctls
> are now const and will not modify the data they pass to the drivers.
>
> So instead of logging write-only ioctls before the driver is called this can
> now be done afterwards, which is cleaner when it comes to error reporting
> as well.
>
> This also fixes a logic error in the debugging code where there was one
> 'else' too many.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/v4l2-core/v4l2-ioctl.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> b/drivers/media/v4l2-core/v4l2-ioctl.c index 2abd13a..b3fe148 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -2147,11 +2147,6 @@ static long __video_do_ioctl(struct file *file,
> }
>
> write_only = _IOC_DIR(cmd) == _IOC_WRITE;
> - if (write_only && debug > V4L2_DEBUG_IOCTL) {
> - v4l_printk_ioctl(video_device_node_name(vfd), cmd);
> - pr_cont(": ");
> - info->debug(arg, write_only);
> - }
> if (info->flags & INFO_FL_STD) {
> typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
> const void *p = vfd->ioctl_ops;
> @@ -2170,16 +2165,10 @@ static long __video_do_ioctl(struct file *file,
>
> done:
> if (debug) {
> - if (write_only && debug > V4L2_DEBUG_IOCTL) {
> - if (ret < 0)
> - printk(KERN_DEBUG "%s: error %ld\n",
> - video_device_node_name(vfd), ret);
> - return ret;
> - }
> v4l_printk_ioctl(video_device_node_name(vfd), cmd);
> if (ret < 0)
> - pr_cont(": error %ld\n", ret);
> - else if (debug == V4L2_DEBUG_IOCTL)
> + pr_cont(": error %ld", ret);
> + if (debug == V4L2_DEBUG_IOCTL)
Shouldn't this be >= V4L2_DEBUG_IOCTL ?
> pr_cont("\n");
> else if (_IOC_DIR(cmd) == _IOC_NONE)
> info->debug(arg, write_only);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
2013-03-15 12:17 ` Laurent Pinchart
@ 2013-03-15 13:38 ` Jonathan Corbet
2013-03-15 13:58 ` Mauro Carvalho Chehab
` (2 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Jonathan Corbet @ 2013-03-15 13:38 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
On Fri, 15 Mar 2013 11:27:23 +0100
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
> index 92a33f0..76a8623 100644
> --- a/drivers/media/platform/marvell-ccic/mcam-core.c
> +++ b/drivers/media/platform/marvell-ccic/mcam-core.c
> @@ -1357,7 +1357,7 @@ static int mcam_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
> }
>
> /* from vivi.c */
> -static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id *a)
> +static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id a)
> {
> return 0;
> }
Hard to find much to complain about there :)
Acked-by: Jonathan Corbet <corbet@lwn.net>
(for the Via version too).
jon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
2013-03-15 12:17 ` Laurent Pinchart
2013-03-15 13:38 ` Jonathan Corbet
@ 2013-03-15 13:58 ` Mauro Carvalho Chehab
2013-03-15 14:14 ` Hans Verkuil
2013-03-16 6:46 ` Guennadi Liakhovetski
2013-03-16 7:26 ` Prabhakar Lad
4 siblings, 1 reply; 21+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-15 13:58 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Scott Jiang, Laurent Pinchart, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Em Fri, 15 Mar 2013 11:27:23 +0100
Hans Verkuil <hverkuil@xs4all.nl> escreveu:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument by value instead of by
> reference. I could have chosen to add const instead, but this is 1) easier
> to handle in drivers and 2) consistent with the s_std subdev operation.
Hmm... this could potentially break userspace. I remember I saw in the past
some code that used the returned standard. I can't remember where. It could
be inside the V4L1 compat layer, but I think it was on some userspace app(s).
Had you verify how the several different userspace apps handle S_STD?
Regards,
Mauro
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/common/saa7146/saa7146_video.c | 4 ++--
> drivers/media/parport/pms.c | 4 ++--
> drivers/media/pci/bt8xx/bttv-driver.c | 6 +++---
> drivers/media/pci/cx18/cx18-driver.c | 2 +-
> drivers/media/pci/cx18/cx18-ioctl.c | 10 +++++-----
> drivers/media/pci/cx18/cx18-ioctl.h | 2 +-
> drivers/media/pci/cx23885/cx23885-417.c | 6 +++---
> drivers/media/pci/cx23885/cx23885-video.c | 4 ++--
> drivers/media/pci/cx25821/cx25821-video.c | 6 +++---
> drivers/media/pci/cx25821/cx25821-video.h | 2 +-
> drivers/media/pci/cx88/cx88-blackbird.c | 4 ++--
> drivers/media/pci/cx88/cx88-video.c | 4 ++--
> drivers/media/pci/ivtv/ivtv-driver.c | 4 ++--
> drivers/media/pci/ivtv/ivtv-firmware.c | 4 ++--
> drivers/media/pci/ivtv/ivtv-ioctl.c | 18 +++++++++---------
> drivers/media/pci/ivtv/ivtv-ioctl.h | 4 ++--
> drivers/media/pci/saa7134/saa7134-empress.c | 2 +-
> drivers/media/pci/saa7134/saa7134-video.c | 14 +++++++-------
> drivers/media/pci/saa7134/saa7134.h | 2 +-
> drivers/media/pci/saa7164/saa7164-encoder.c | 8 ++++----
> drivers/media/pci/saa7164/saa7164-vbi.c | 8 ++++----
> drivers/media/pci/sta2x11/sta2x11_vip.c | 18 +++++++++---------
> drivers/media/pci/zoran/zoran_driver.c | 4 ++--
> drivers/media/platform/blackfin/bfin_capture.c | 6 +++---
> drivers/media/platform/davinci/vpbe.c | 8 ++++----
> drivers/media/platform/davinci/vpbe_display.c | 2 +-
> drivers/media/platform/davinci/vpfe_capture.c | 12 ++++++------
> drivers/media/platform/davinci/vpif_capture.c | 6 +++---
> drivers/media/platform/davinci/vpif_display.c | 10 +++++-----
> drivers/media/platform/fsl-viu.c | 6 +++---
> drivers/media/platform/marvell-ccic/mcam-core.c | 2 +-
> drivers/media/platform/s5p-tv/mixer_video.c | 4 ++--
> drivers/media/platform/sh_vou.c | 12 ++++++------
> drivers/media/platform/soc_camera/soc_camera.c | 4 ++--
> drivers/media/platform/timblogiw.c | 6 +++---
> drivers/media/platform/via-camera.c | 2 +-
> drivers/media/platform/vino.c | 10 +++++-----
> drivers/media/usb/au0828/au0828-video.c | 4 ++--
> drivers/media/usb/cx231xx/cx231xx-417.c | 4 ++--
> drivers/media/usb/cx231xx/cx231xx-video.c | 6 +++---
> drivers/media/usb/em28xx/em28xx-video.c | 8 ++++----
> drivers/media/usb/hdpvr/hdpvr-video.c | 4 ++--
> drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 ++--
> drivers/media/usb/s2255/s2255drv.c | 8 ++++----
> drivers/media/usb/stk1160/stk1160-v4l.c | 4 ++--
> drivers/media/usb/tlg2300/pd-video.c | 8 ++++----
> drivers/media/usb/tm6000/tm6000-video.c | 6 +++---
> drivers/media/usb/usbvision/usbvision-video.c | 4 ++--
> drivers/media/v4l2-core/v4l2-ioctl.c | 6 +++---
> drivers/staging/media/davinci_vpfe/vpfe_video.c | 6 +++---
> drivers/staging/media/dt3155v4l/dt3155v4l.c | 4 ++--
> drivers/staging/media/go7007/go7007-v4l2.c | 16 ++++++++--------
> drivers/staging/media/solo6x10/v4l2-enc.c | 2 +-
> drivers/staging/media/solo6x10/v4l2.c | 2 +-
> include/media/davinci/vpbe.h | 2 +-
> include/media/v4l2-ioctl.h | 2 +-
> 56 files changed, 165 insertions(+), 165 deletions(-)
>
> diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c
> index 4143d61..fe907f2 100644
> --- a/drivers/media/common/saa7146/saa7146_video.c
> +++ b/drivers/media/common/saa7146/saa7146_video.c
> @@ -832,7 +832,7 @@ static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm)
> }
> */
>
> -static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id)
> {
> struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
> struct saa7146_vv *vv = dev->vv_data;
> @@ -856,7 +856,7 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
> }
>
> for (i = 0; i < dev->ext_vv_data->num_stds; i++)
> - if (*id & dev->ext_vv_data->stds[i].id)
> + if (id & dev->ext_vv_data->stds[i].id)
> break;
> if (i != dev->ext_vv_data->num_stds) {
> vv->standard = &dev->ext_vv_data->stds[i];
> diff --git a/drivers/media/parport/pms.c b/drivers/media/parport/pms.c
> index 77f9c92..66c957a 100644
> --- a/drivers/media/parport/pms.c
> +++ b/drivers/media/parport/pms.c
> @@ -735,12 +735,12 @@ static int pms_g_std(struct file *file, void *fh, v4l2_std_id *std)
> return 0;
> }
>
> -static int pms_s_std(struct file *file, void *fh, v4l2_std_id *std)
> +static int pms_s_std(struct file *file, void *fh, v4l2_std_id std)
> {
> struct pms *dev = video_drvdata(file);
> int ret = 0;
>
> - dev->std = *std;
> + dev->std = std;
> if (dev->std & V4L2_STD_NTSC) {
> pms_framerate(dev, 30);
> pms_secamcross(dev, 0);
> diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
> index 20db7aa..79dc12c 100644
> --- a/drivers/media/pci/bt8xx/bttv-driver.c
> +++ b/drivers/media/pci/bt8xx/bttv-driver.c
> @@ -1711,7 +1711,7 @@ static void radio_enable(struct bttv *btv)
> }
> }
>
> -static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int bttv_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct bttv_fh *fh = priv;
> struct bttv *btv = fh->btv;
> @@ -1719,14 +1719,14 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
> int err = 0;
>
> for (i = 0; i < BTTV_TVNORMS; i++)
> - if (*id & bttv_tvnorms[i].v4l2_id)
> + if (id & bttv_tvnorms[i].v4l2_id)
> break;
> if (i == BTTV_TVNORMS) {
> err = -EINVAL;
> goto err;
> }
>
> - btv->std = *id;
> + btv->std = id;
> set_tvnorm(btv, i);
>
> err:
> diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
> index 613e5ae..67b61cf 100644
> --- a/drivers/media/pci/cx18/cx18-driver.c
> +++ b/drivers/media/pci/cx18/cx18-driver.c
> @@ -1243,7 +1243,7 @@ int cx18_init_on_first_open(struct cx18 *cx)
> in one place. */
> cx->std++; /* Force full standard initialization */
> std = (cx->tuner_std == V4L2_STD_ALL) ? V4L2_STD_NTSC_M : cx->tuner_std;
> - cx18_s_std(NULL, &fh, &std);
> + cx18_s_std(NULL, &fh, std);
> cx18_s_frequency(NULL, &fh, &vf);
> return 0;
> }
> diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
> index 173ccd2..254c50f 100644
> --- a/drivers/media/pci/cx18/cx18-ioctl.c
> +++ b/drivers/media/pci/cx18/cx18-ioctl.c
> @@ -637,15 +637,15 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std)
> return 0;
> }
>
> -int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
> +int cx18_s_std(struct file *file, void *fh, v4l2_std_id std)
> {
> struct cx18_open_id *id = fh2id(fh);
> struct cx18 *cx = id->cx;
>
> - if ((*std & V4L2_STD_ALL) == 0)
> + if ((std & V4L2_STD_ALL) == 0)
> return -EINVAL;
>
> - if (*std == cx->std)
> + if (std == cx->std)
> return 0;
>
> if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ||
> @@ -656,8 +656,8 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
> return -EBUSY;
> }
>
> - cx->std = *std;
> - cx->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
> + cx->std = std;
> + cx->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
> cx->is_50hz = !cx->is_60hz;
> cx2341x_handler_set_50hz(&cx->cxhdl, cx->is_50hz);
> cx->cxhdl.width = 720;
> diff --git a/drivers/media/pci/cx18/cx18-ioctl.h b/drivers/media/pci/cx18/cx18-ioctl.h
> index aa9b44a..4343396 100644
> --- a/drivers/media/pci/cx18/cx18-ioctl.h
> +++ b/drivers/media/pci/cx18/cx18-ioctl.h
> @@ -26,6 +26,6 @@ u16 cx18_service2vbi(int type);
> void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal);
> u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt);
> void cx18_set_funcs(struct video_device *vdev);
> -int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
> +int cx18_s_std(struct file *file, void *fh, v4l2_std_id std);
> int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
> int cx18_s_input(struct file *file, void *fh, unsigned int inp);
> diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
> index 812ec5f..6dea11a 100644
> --- a/drivers/media/pci/cx23885/cx23885-417.c
> +++ b/drivers/media/pci/cx23885/cx23885-417.c
> @@ -1222,14 +1222,14 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct cx23885_fh *fh = file->private_data;
> struct cx23885_dev *dev = fh->dev;
> unsigned int i;
>
> for (i = 0; i < ARRAY_SIZE(cx23885_tvnorms); i++)
> - if (*id & cx23885_tvnorms[i].id)
> + if (id & cx23885_tvnorms[i].id)
> break;
> if (i == ARRAY_SIZE(cx23885_tvnorms))
> return -EINVAL;
> @@ -1237,7 +1237,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
>
> /* Have the drier core notify the subdevices */
> mutex_lock(&dev->lock);
> - cx23885_set_tvnorm(dev, *id);
> + cx23885_set_tvnorm(dev, id);
> mutex_unlock(&dev->lock);
>
> return 0;
> diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
> index 2bbda43..ed08c89 100644
> --- a/drivers/media/pci/cx23885/cx23885-video.c
> +++ b/drivers/media/pci/cx23885/cx23885-video.c
> @@ -1259,13 +1259,13 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *tvnorms)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
> {
> struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;
> dprintk(1, "%s()\n", __func__);
>
> mutex_lock(&dev->lock);
> - cx23885_set_tvnorm(dev, *tvnorms);
> + cx23885_set_tvnorm(dev, tvnorms);
> mutex_unlock(&dev->lock);
>
> return 0;
> diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
> index 75281c1..93c7d57 100644
> --- a/drivers/media/pci/cx25821/cx25821-video.c
> +++ b/drivers/media/pci/cx25821/cx25821-video.c
> @@ -1203,7 +1203,7 @@ int cx25821_vidioc_s_priority(struct file *file, void *f,
> }
>
> #ifdef TUNER_FLAG
> -int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms)
> +int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
> {
> struct cx25821_fh *fh = priv;
> struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
> @@ -1218,11 +1218,11 @@ int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms)
> return err;
> }
>
> - if (dev->tvnorm == *tvnorms)
> + if (dev->tvnorm == tvnorms)
> return 0;
>
> mutex_lock(&dev->lock);
> - cx25821_set_tvnorm(dev, *tvnorms);
> + cx25821_set_tvnorm(dev, tvnorms);
> mutex_unlock(&dev->lock);
>
> medusa_set_videostandard(dev);
> diff --git a/drivers/media/pci/cx25821/cx25821-video.h b/drivers/media/pci/cx25821/cx25821-video.h
> index f0e70ff..239f63c 100644
> --- a/drivers/media/pci/cx25821/cx25821-video.h
> +++ b/drivers/media/pci/cx25821/cx25821-video.h
> @@ -135,7 +135,7 @@ extern int cx25821_vidioc_querybuf(struct file *file, void *priv,
> extern int cx25821_vidioc_qbuf(struct file *file, void *priv,
> struct v4l2_buffer *p);
> extern int cx25821_vidioc_s_std(struct file *file, void *priv,
> - v4l2_std_id *tvnorms);
> + v4l2_std_id tvnorms);
> extern int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i);
> extern int cx25821_vidioc_enum_input(struct file *file, void *priv,
> struct v4l2_input *i);
> diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
> index 486ca8d..150bb76 100644
> --- a/drivers/media/pci/cx88/cx88-blackbird.c
> +++ b/drivers/media/pci/cx88/cx88-blackbird.c
> @@ -939,12 +939,12 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
> return 0;
> }
>
> -static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct cx88_core *core = ((struct cx8802_fh *)priv)->dev->core;
>
> mutex_lock(&core->lock);
> - cx88_set_tvnorm(core,*id);
> + cx88_set_tvnorm(core, id);
> mutex_unlock(&core->lock);
> return 0;
> }
> diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
> index ede6f13..ead5be5 100644
> --- a/drivers/media/pci/cx88/cx88-video.c
> +++ b/drivers/media/pci/cx88/cx88-video.c
> @@ -1193,12 +1193,12 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
> return 0;
> }
>
> -static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id tvnorms)
> {
> struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
>
> mutex_lock(&core->lock);
> - cx88_set_tvnorm(core,*tvnorms);
> + cx88_set_tvnorm(core, tvnorms);
> mutex_unlock(&core->lock);
>
> return 0;
> diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
> index 2928e72..07b8460 100644
> --- a/drivers/media/pci/ivtv/ivtv-driver.c
> +++ b/drivers/media/pci/ivtv/ivtv-driver.c
> @@ -1387,7 +1387,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
> if (!itv->has_cx23415)
> write_reg_sync(0x03, IVTV_REG_DMACONTROL);
>
> - ivtv_s_std_enc(itv, &itv->tuner_std);
> + ivtv_s_std_enc(itv, itv->tuner_std);
>
> /* Default interrupts enabled. For the PVR350 this includes the
> decoder VSYNC interrupt, which is always on. It is not only used
> @@ -1397,7 +1397,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
> if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
> ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT | IVTV_IRQ_DEC_VSYNC);
> ivtv_set_osd_alpha(itv);
> - ivtv_s_std_dec(itv, &itv->tuner_std);
> + ivtv_s_std_dec(itv, itv->tuner_std);
> } else {
> ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT);
> }
> diff --git a/drivers/media/pci/ivtv/ivtv-firmware.c b/drivers/media/pci/ivtv/ivtv-firmware.c
> index 68387d4..ed73edd 100644
> --- a/drivers/media/pci/ivtv/ivtv-firmware.c
> +++ b/drivers/media/pci/ivtv/ivtv-firmware.c
> @@ -302,7 +302,7 @@ static int ivtv_firmware_restart(struct ivtv *itv)
> /* Restore encoder video standard */
> std = itv->std;
> itv->std = 0;
> - ivtv_s_std_enc(itv, &std);
> + ivtv_s_std_enc(itv, std);
>
> if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
> ivtv_init_mpeg_decoder(itv);
> @@ -310,7 +310,7 @@ static int ivtv_firmware_restart(struct ivtv *itv)
> /* Restore decoder video standard */
> std = itv->std_out;
> itv->std_out = 0;
> - ivtv_s_std_dec(itv, &std);
> + ivtv_s_std_dec(itv, std);
>
> /* Restore framebuffer if active */
> if (itv->ivtvfb_restore)
> diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
> index 852f11e..080f179 100644
> --- a/drivers/media/pci/ivtv/ivtv-ioctl.c
> +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
> @@ -1103,10 +1103,10 @@ static int ivtv_g_std(struct file *file, void *fh, v4l2_std_id *std)
> return 0;
> }
>
> -void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std)
> +void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std)
> {
> - itv->std = *std;
> - itv->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
> + itv->std = std;
> + itv->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
> itv->is_50hz = !itv->is_60hz;
> cx2341x_handler_set_50hz(&itv->cxhdl, itv->is_50hz);
> itv->cxhdl.width = 720;
> @@ -1122,15 +1122,15 @@ void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std)
> ivtv_call_all(itv, core, s_std, itv->std);
> }
>
> -void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
> +void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std)
> {
> struct yuv_playback_info *yi = &itv->yuv_info;
> DEFINE_WAIT(wait);
> int f;
>
> /* set display standard */
> - itv->std_out = *std;
> - itv->is_out_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
> + itv->std_out = std;
> + itv->is_out_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
> itv->is_out_50hz = !itv->is_out_60hz;
> ivtv_call_all(itv, video, s_std_output, itv->std_out);
>
> @@ -1168,14 +1168,14 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
> }
> }
>
> -static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
> +static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id std)
> {
> struct ivtv *itv = fh2id(fh)->itv;
>
> - if ((*std & V4L2_STD_ALL) == 0)
> + if ((std & V4L2_STD_ALL) == 0)
> return -EINVAL;
>
> - if (*std == itv->std)
> + if (std == itv->std)
> return 0;
>
> if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ||
> diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.h b/drivers/media/pci/ivtv/ivtv-ioctl.h
> index 34c6bc1..75c3977 100644
> --- a/drivers/media/pci/ivtv/ivtv-ioctl.h
> +++ b/drivers/media/pci/ivtv/ivtv-ioctl.h
> @@ -27,8 +27,8 @@ u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt);
> void ivtv_set_osd_alpha(struct ivtv *itv);
> int ivtv_set_speed(struct ivtv *itv, int speed);
> void ivtv_set_funcs(struct video_device *vdev);
> -void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id *std);
> -void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std);
> +void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std);
> +void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std);
> int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
> int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
>
> diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c
> index 4df79c6..66a7081 100644
> --- a/drivers/media/pci/saa7134/saa7134-empress.c
> +++ b/drivers/media/pci/saa7134/saa7134-empress.c
> @@ -428,7 +428,7 @@ static int empress_g_chip_ident(struct file *file, void *fh,
> return -EINVAL;
> }
>
> -static int empress_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int empress_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct saa7134_dev *dev = file->private_data;
>
> diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
> index 1e23547..a6c69a4 100644
> --- a/drivers/media/pci/saa7134/saa7134-video.c
> +++ b/drivers/media/pci/saa7134/saa7134-video.c
> @@ -1828,7 +1828,7 @@ static int saa7134_querycap(struct file *file, void *priv,
> return 0;
> }
>
> -int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id *id)
> +int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id id)
> {
> unsigned long flags;
> unsigned int i;
> @@ -1849,17 +1849,17 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
> }
>
> for (i = 0; i < TVNORMS; i++)
> - if (*id == tvnorms[i].id)
> + if (id == tvnorms[i].id)
> break;
>
> if (i == TVNORMS)
> for (i = 0; i < TVNORMS; i++)
> - if (*id & tvnorms[i].id)
> + if (id & tvnorms[i].id)
> break;
> if (i == TVNORMS)
> return -EINVAL;
>
> - if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
> + if ((id & V4L2_STD_SECAM) && (secam[0] != '-')) {
> if (secam[0] == 'L' || secam[0] == 'l') {
> if (secam[1] == 'C' || secam[1] == 'c')
> fixup = V4L2_STD_SECAM_LC;
> @@ -1879,7 +1879,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
> return -EINVAL;
> }
>
> - *id = tvnorms[i].id;
> + id = tvnorms[i].id;
>
> mutex_lock(&dev->lock);
> if (fh && res_check(fh, RESOURCE_OVERLAY)) {
> @@ -1901,7 +1901,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
> }
> EXPORT_SYMBOL_GPL(saa7134_s_std_internal);
>
> -static int saa7134_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int saa7134_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct saa7134_fh *fh = priv;
>
> @@ -2396,7 +2396,7 @@ static int radio_s_input(struct file *filp, void *priv, unsigned int i)
> return 0;
> }
>
> -static int radio_s_std(struct file *file, void *fh, v4l2_std_id *norm)
> +static int radio_s_std(struct file *file, void *fh, v4l2_std_id norm)
> {
> return 0;
> }
> diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h
> index 71eefef..62169dd 100644
> --- a/drivers/media/pci/saa7134/saa7134.h
> +++ b/drivers/media/pci/saa7134/saa7134.h
> @@ -766,7 +766,7 @@ extern struct video_device saa7134_radio_template;
> int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c);
> int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c);
> int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c);
> -int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id *id);
> +int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id id);
>
> int saa7134_videoport_init(struct saa7134_dev *dev);
> void saa7134_set_tvnorm_hw(struct saa7134_dev *dev);
> diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
> index e7fbd03..538de52 100644
> --- a/drivers/media/pci/saa7164/saa7164-encoder.c
> +++ b/drivers/media/pci/saa7164/saa7164-encoder.c
> @@ -211,17 +211,17 @@ static int saa7164_encoder_initialize(struct saa7164_port *port)
> }
>
> /* -- V4L2 --------------------------------------------------------- */
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct saa7164_encoder_fh *fh = file->private_data;
> struct saa7164_port *port = fh->port;
> struct saa7164_dev *dev = port->dev;
> unsigned int i;
>
> - dprintk(DBGLVL_ENC, "%s(id=0x%x)\n", __func__, (u32)*id);
> + dprintk(DBGLVL_ENC, "%s(id=0x%x)\n", __func__, (u32)id);
>
> for (i = 0; i < ARRAY_SIZE(saa7164_tvnorms); i++) {
> - if (*id & saa7164_tvnorms[i].id)
> + if (id & saa7164_tvnorms[i].id)
> break;
> }
> if (i == ARRAY_SIZE(saa7164_tvnorms))
> @@ -234,7 +234,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> */
> saa7164_api_set_audio_std(port);
>
> - dprintk(DBGLVL_ENC, "%s(id=0x%x) OK\n", __func__, (u32)*id);
> + dprintk(DBGLVL_ENC, "%s(id=0x%x) OK\n", __func__, (u32)id);
>
> return 0;
> }
> diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
> index bfc8cec..da224eb 100644
> --- a/drivers/media/pci/saa7164/saa7164-vbi.c
> +++ b/drivers/media/pci/saa7164/saa7164-vbi.c
> @@ -183,17 +183,17 @@ static int saa7164_vbi_initialize(struct saa7164_port *port)
> }
>
> /* -- V4L2 --------------------------------------------------------- */
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct saa7164_vbi_fh *fh = file->private_data;
> struct saa7164_port *port = fh->port;
> struct saa7164_dev *dev = port->dev;
> unsigned int i;
>
> - dprintk(DBGLVL_VBI, "%s(id=0x%x)\n", __func__, (u32)*id);
> + dprintk(DBGLVL_VBI, "%s(id=0x%x)\n", __func__, (u32)id);
>
> for (i = 0; i < ARRAY_SIZE(saa7164_tvnorms); i++) {
> - if (*id & saa7164_tvnorms[i].id)
> + if (id & saa7164_tvnorms[i].id)
> break;
> }
> if (i == ARRAY_SIZE(saa7164_tvnorms))
> @@ -206,7 +206,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> */
> saa7164_api_set_audio_std(port);
>
> - dprintk(DBGLVL_VBI, "%s(id=0x%x) OK\n", __func__, (u32)*id);
> + dprintk(DBGLVL_VBI, "%s(id=0x%x) OK\n", __func__, (u32)id);
>
> return 0;
> }
> diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
> index 4b703fe..7005695 100644
> --- a/drivers/media/pci/sta2x11/sta2x11_vip.c
> +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
> @@ -439,22 +439,22 @@ static int vidioc_querycap(struct file *file, void *priv,
> *
> * other, returned from video DAC.
> */
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std)
> {
> struct sta2x11_vip *vip = video_drvdata(file);
> v4l2_std_id oldstd = vip->std, newstd;
> int status;
>
> - if (V4L2_STD_ALL == *std) {
> - v4l2_subdev_call(vip->decoder, core, s_std, *std);
> + if (V4L2_STD_ALL == std) {
> + v4l2_subdev_call(vip->decoder, core, s_std, std);
> ssleep(2);
> v4l2_subdev_call(vip->decoder, video, querystd, &newstd);
> v4l2_subdev_call(vip->decoder, video, g_input_status, &status);
> if (status & V4L2_IN_ST_NO_SIGNAL)
> return -EIO;
> - *std = vip->std = newstd;
> - if (oldstd != *std) {
> - if (V4L2_STD_525_60 & (*std))
> + std = vip->std = newstd;
> + if (oldstd != std) {
> + if (V4L2_STD_525_60 & std)
> vip->format = formats_60[0];
> else
> vip->format = formats_50[0];
> @@ -462,14 +462,14 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
> return 0;
> }
>
> - if (oldstd != *std) {
> - if (V4L2_STD_525_60 & (*std))
> + if (oldstd != std) {
> + if (V4L2_STD_525_60 & std)
> vip->format = formats_60[0];
> else
> vip->format = formats_50[0];
> }
>
> - return v4l2_subdev_call(vip->decoder, core, s_std, *std);
> + return v4l2_subdev_call(vip->decoder, core, s_std, std);
> }
>
> /**
> diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
> index 2e8f518..1168a84 100644
> --- a/drivers/media/pci/zoran/zoran_driver.c
> +++ b/drivers/media/pci/zoran/zoran_driver.c
> @@ -2435,14 +2435,14 @@ static int zoran_g_std(struct file *file, void *__fh, v4l2_std_id *std)
> return 0;
> }
>
> -static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id *std)
> +static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id std)
> {
> struct zoran_fh *fh = __fh;
> struct zoran *zr = fh->zr;
> int res = 0;
>
> mutex_lock(&zr->resource_lock);
> - res = zoran_set_norm(zr, *std);
> + res = zoran_set_norm(zr, std);
> if (res)
> goto sstd_unlock_and_return;
>
> diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
> index 8ffe42a..fcf39b2 100644
> --- a/drivers/media/platform/blackfin/bfin_capture.c
> +++ b/drivers/media/platform/blackfin/bfin_capture.c
> @@ -633,7 +633,7 @@ static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
> return 0;
> }
>
> -static int bcap_s_std(struct file *file, void *priv, v4l2_std_id *std)
> +static int bcap_s_std(struct file *file, void *priv, v4l2_std_id std)
> {
> struct bcap_device *bcap_dev = video_drvdata(file);
> int ret;
> @@ -641,11 +641,11 @@ static int bcap_s_std(struct file *file, void *priv, v4l2_std_id *std)
> if (vb2_is_busy(&bcap_dev->buffer_queue))
> return -EBUSY;
>
> - ret = v4l2_subdev_call(bcap_dev->sd, core, s_std, *std);
> + ret = v4l2_subdev_call(bcap_dev->sd, core, s_std, std);
> if (ret < 0)
> return ret;
>
> - bcap_dev->std = *std;
> + bcap_dev->std = std;
> return 0;
> }
>
> diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
> index 4ca0f9a..554f3a9 100644
> --- a/drivers/media/platform/davinci/vpbe.c
> +++ b/drivers/media/platform/davinci/vpbe.c
> @@ -431,7 +431,7 @@ static int vpbe_enum_dv_timings(struct vpbe_device *vpbe_dev,
> * Sets the standard if supported by the current encoder. Return the status.
> * 0 - success & -EINVAL on error
> */
> -static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id)
> +static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id std_id)
> {
> struct vpbe_config *cfg = vpbe_dev->cfg;
> int out_index = vpbe_dev->current_out_index;
> @@ -442,14 +442,14 @@ static int vpbe_s_std(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id)
> V4L2_OUT_CAP_STD))
> return -EINVAL;
>
> - ret = vpbe_get_std_info(vpbe_dev, *std_id);
> + ret = vpbe_get_std_info(vpbe_dev, std_id);
> if (ret)
> return ret;
>
> mutex_lock(&vpbe_dev->lock);
>
> ret = v4l2_subdev_call(vpbe_dev->encoders[sd_index], video,
> - s_std_output, *std_id);
> + s_std_output, std_id);
> /* set the lcd controller output for the given mode */
> if (!ret) {
> struct osd_state *osd_device = vpbe_dev->osd_device;
> @@ -513,7 +513,7 @@ static int vpbe_set_mode(struct vpbe_device *vpbe_dev,
> */
> if (preset_mode->timings_type & VPBE_ENC_STD)
> return vpbe_s_std(vpbe_dev,
> - &preset_mode->std_id);
> + preset_mode->std_id);
> if (preset_mode->timings_type &
> VPBE_ENC_CUSTOM_TIMINGS) {
> dv_timings =
> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> index 9f9f2c1..1311cdf 100644
> --- a/drivers/media/platform/davinci/vpbe_display.c
> +++ b/drivers/media/platform/davinci/vpbe_display.c
> @@ -983,7 +983,7 @@ static int vpbe_display_try_fmt(struct file *file, void *priv,
> * 0 - success & -EINVAL on error
> */
> static int vpbe_display_s_std(struct file *file, void *priv,
> - v4l2_std_id *std_id)
> + v4l2_std_id std_id)
> {
> struct vpbe_fh *fh = priv;
> struct vpbe_layer *layer = fh->layer;
> diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
> index 28d019d..d0bfb6a 100644
> --- a/drivers/media/platform/davinci/vpfe_capture.c
> +++ b/drivers/media/platform/davinci/vpfe_capture.c
> @@ -376,7 +376,7 @@ static int vpfe_config_ccdc_image_format(struct vpfe_device *vpfe_dev)
> * values in ccdc
> */
> static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
> - const v4l2_std_id *std_id)
> + v4l2_std_id std_id)
> {
> struct vpfe_subdev_info *sdinfo = vpfe_dev->current_subdev;
> struct v4l2_mbus_framefmt mbus_fmt;
> @@ -384,7 +384,7 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev,
> int i, ret = 0;
>
> for (i = 0; i < ARRAY_SIZE(vpfe_standards); i++) {
> - if (vpfe_standards[i].std_id & *std_id) {
> + if (vpfe_standards[i].std_id & std_id) {
> vpfe_dev->std_info.active_pixels =
> vpfe_standards[i].width;
> vpfe_dev->std_info.active_lines =
> @@ -461,7 +461,7 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)
>
> /* Configure the default format information */
> ret = vpfe_config_image_format(vpfe_dev,
> - &vpfe_standards[vpfe_dev->std_index].std_id);
> + vpfe_standards[vpfe_dev->std_index].std_id);
> if (ret)
> return ret;
>
> @@ -1164,7 +1164,7 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index)
>
> /* set the default image parameters in the device */
> ret = vpfe_config_image_format(vpfe_dev,
> - &vpfe_standards[vpfe_dev->std_index].std_id);
> + vpfe_standards[vpfe_dev->std_index].std_id);
> unlock_out:
> mutex_unlock(&vpfe_dev->lock);
> return ret;
> @@ -1189,7 +1189,7 @@ static int vpfe_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
> return ret;
> }
>
> -static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> +static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id std_id)
> {
> struct vpfe_device *vpfe_dev = video_drvdata(file);
> struct vpfe_subdev_info *sdinfo;
> @@ -1211,7 +1211,7 @@ static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> }
>
> ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id,
> - core, s_std, *std_id);
> + core, s_std, std_id);
> if (ret < 0) {
> v4l2_err(&vpfe_dev->v4l2_dev, "Failed to set standard\n");
> goto unlock_out;
> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index 1943e41..4e78839 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -1395,7 +1395,7 @@ static int vpif_g_std(struct file *file, void *priv, v4l2_std_id *std)
> * @priv: file handle
> * @std_id: ptr to std id
> */
> -static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> +static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
> {
> struct vpif_fh *fh = priv;
> struct channel_obj *ch = fh->channel;
> @@ -1424,7 +1424,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> fh->initialized = 1;
>
> /* Call encoder subdevice function to set the standard */
> - ch->video.stdid = *std_id;
> + ch->video.stdid = std_id;
> memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings));
>
> /* Get the information about the standard */
> @@ -1437,7 +1437,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> vpif_config_format(ch);
>
> /* set standard in the sub device */
> - ret = v4l2_subdev_call(ch->sd, core, s_std, *std_id);
> + ret = v4l2_subdev_call(ch->sd, core, s_std, std_id);
> if (ret && ret != -ENOIOCTLCMD && ret != -ENODEV) {
> vpif_dbg(1, debug, "Failed to set standard for sub devices\n");
> return ret;
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index 5477c2c..dced173 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -1059,14 +1059,14 @@ static int vpif_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
> return vb2_qbuf(&common->buffer_queue, buf);
> }
>
> -static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> +static int vpif_s_std(struct file *file, void *priv, v4l2_std_id std_id)
> {
> struct vpif_fh *fh = priv;
> struct channel_obj *ch = fh->channel;
> struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> int ret = 0;
>
> - if (!(*std_id & VPIF_V4L2_STD))
> + if (!(std_id & VPIF_V4L2_STD))
> return -EINVAL;
>
> if (common->started) {
> @@ -1075,7 +1075,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> }
>
> /* Call encoder subdevice function to set the standard */
> - ch->video.stdid = *std_id;
> + ch->video.stdid = std_id;
> memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings));
> /* Get the information about the standard */
> if (vpif_update_resolution(ch))
> @@ -1093,14 +1093,14 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> vpif_config_format(ch);
>
> ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, video,
> - s_std_output, *std_id);
> + s_std_output, std_id);
> if (ret < 0) {
> vpif_err("Failed to set output standard\n");
> return ret;
> }
>
> ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, core,
> - s_std, *std_id);
> + s_std, std_id);
> if (ret < 0)
> vpif_err("Failed to set standard for sub devices\n");
> return ret;
> diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
> index 5f7db3f..3a6a0dc 100644
> --- a/drivers/media/platform/fsl-viu.c
> +++ b/drivers/media/platform/fsl-viu.c
> @@ -957,12 +957,12 @@ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct viu_fh *fh = priv;
>
> - fh->dev->std = *id;
> - decoder_call(fh->dev, core, s_std, *id);
> + fh->dev->std = id;
> + decoder_call(fh->dev, core, s_std, id);
> return 0;
> }
>
> diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
> index 92a33f0..76a8623 100644
> --- a/drivers/media/platform/marvell-ccic/mcam-core.c
> +++ b/drivers/media/platform/marvell-ccic/mcam-core.c
> @@ -1357,7 +1357,7 @@ static int mcam_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
> }
>
> /* from vivi.c */
> -static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id *a)
> +static int mcam_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id a)
> {
> return 0;
> }
> diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c
> index 82142a2..d777d0b 100644
> --- a/drivers/media/platform/s5p-tv/mixer_video.c
> +++ b/drivers/media/platform/s5p-tv/mixer_video.c
> @@ -559,7 +559,7 @@ static int mxr_g_dv_preset(struct file *file, void *fh,
> return ret ? -EINVAL : 0;
> }
>
> -static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm)
> +static int mxr_s_std(struct file *file, void *fh, v4l2_std_id norm)
> {
> struct mxr_layer *layer = video_drvdata(file);
> struct mxr_device *mdev = layer->mdev;
> @@ -576,7 +576,7 @@ static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm)
> return -EBUSY;
> }
>
> - ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, *norm);
> + ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, norm);
>
> mutex_unlock(&mdev->mutex);
>
> diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
> index 66c8da1..ea8a1ee 100644
> --- a/drivers/media/platform/sh_vou.c
> +++ b/drivers/media/platform/sh_vou.c
> @@ -881,29 +881,29 @@ static u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt)
> }
> }
>
> -static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> +static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id)
> {
> struct sh_vou_device *vou_dev = video_drvdata(file);
> int ret;
>
> - dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, *std_id);
> + dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id);
>
> - if (*std_id & ~vou_dev->vdev->tvnorms)
> + if (std_id & ~vou_dev->vdev->tvnorms)
> return -EINVAL;
>
> ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video,
> - s_std_output, *std_id);
> + s_std_output, std_id);
> /* Shall we continue, if the subdev doesn't support .s_std_output()? */
> if (ret < 0 && ret != -ENOIOCTLCMD)
> return ret;
>
> - if (*std_id & V4L2_STD_525_60)
> + if (std_id & V4L2_STD_525_60)
> sh_vou_reg_ab_set(vou_dev, VOUCR,
> sh_vou_ntsc_mode(vou_dev->pdata->bus_fmt) << 29, 7 << 29);
> else
> sh_vou_reg_ab_set(vou_dev, VOUCR, 5 << 29, 7 << 29);
>
> - vou_dev->std = *std_id;
> + vou_dev->std = std_id;
>
> return 0;
> }
> diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
> index 8ec9805..3592968 100644
> --- a/drivers/media/platform/soc_camera/soc_camera.c
> +++ b/drivers/media/platform/soc_camera/soc_camera.c
> @@ -256,12 +256,12 @@ static int soc_camera_s_input(struct file *file, void *priv, unsigned int i)
> return 0;
> }
>
> -static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)
> +static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id a)
> {
> struct soc_camera_device *icd = file->private_data;
> struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
>
> - return v4l2_subdev_call(sd, core, s_std, *a);
> + return v4l2_subdev_call(sd, core, s_std, a);
> }
>
> static int soc_camera_g_std(struct file *file, void *priv, v4l2_std_id *a)
> diff --git a/drivers/media/platform/timblogiw.c b/drivers/media/platform/timblogiw.c
> index 2d91eeb..a2f7bdd 100644
> --- a/drivers/media/platform/timblogiw.c
> +++ b/drivers/media/platform/timblogiw.c
> @@ -336,7 +336,7 @@ static int timblogiw_g_std(struct file *file, void *priv, v4l2_std_id *std)
> return 0;
> }
>
> -static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id *std)
> +static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id std)
> {
> struct video_device *vdev = video_devdata(file);
> struct timblogiw *lw = video_get_drvdata(vdev);
> @@ -348,10 +348,10 @@ static int timblogiw_s_std(struct file *file, void *priv, v4l2_std_id *std)
> mutex_lock(&lw->lock);
>
> if (TIMBLOGIW_HAS_DECODER(lw))
> - err = v4l2_subdev_call(lw->sd_enc, core, s_std, *std);
> + err = v4l2_subdev_call(lw->sd_enc, core, s_std, std);
>
> if (!err)
> - fh->cur_norm = timblogiw_get_norm(*std);
> + fh->cur_norm = timblogiw_get_norm(std);
>
> mutex_unlock(&lw->lock);
>
> diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
> index b051c4a..a794cd6 100644
> --- a/drivers/media/platform/via-camera.c
> +++ b/drivers/media/platform/via-camera.c
> @@ -847,7 +847,7 @@ static int viacam_s_input(struct file *filp, void *priv, unsigned int i)
> return 0;
> }
>
> -static int viacam_s_std(struct file *filp, void *priv, v4l2_std_id *std)
> +static int viacam_s_std(struct file *filp, void *priv, v4l2_std_id std)
> {
> return 0;
> }
> diff --git a/drivers/media/platform/vino.c b/drivers/media/platform/vino.c
> index eb5d6f9..c6af974 100644
> --- a/drivers/media/platform/vino.c
> +++ b/drivers/media/platform/vino.c
> @@ -3042,7 +3042,7 @@ static int vino_g_std(struct file *file, void *__fh,
> }
>
> static int vino_s_std(struct file *file, void *__fh,
> - v4l2_std_id *std)
> + v4l2_std_id std)
> {
> struct vino_channel_settings *vcs = video_drvdata(file);
> unsigned long flags;
> @@ -3056,7 +3056,7 @@ static int vino_s_std(struct file *file, void *__fh,
> }
>
> /* check if the standard is valid for the current input */
> - if ((*std) & vino_inputs[vcs->input].std) {
> + if (std & vino_inputs[vcs->input].std) {
> dprintk("standard accepted\n");
>
> /* change the video norm for SAA7191
> @@ -3065,13 +3065,13 @@ static int vino_s_std(struct file *file, void *__fh,
> if (vcs->input == VINO_INPUT_D1)
> goto out;
>
> - if ((*std) & V4L2_STD_PAL) {
> + if (std & V4L2_STD_PAL) {
> ret = vino_set_data_norm(vcs, VINO_DATA_NORM_PAL,
> &flags);
> - } else if ((*std) & V4L2_STD_NTSC) {
> + } else if (std & V4L2_STD_NTSC) {
> ret = vino_set_data_norm(vcs, VINO_DATA_NORM_NTSC,
> &flags);
> - } else if ((*std) & V4L2_STD_SECAM) {
> + } else if (std & V4L2_STD_SECAM) {
> ret = vino_set_data_norm(vcs, VINO_DATA_NORM_SECAM,
> &flags);
> } else {
> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> index 11316f2..e9dd01c 100644
> --- a/drivers/media/usb/au0828/au0828-video.c
> +++ b/drivers/media/usb/au0828/au0828-video.c
> @@ -1320,7 +1320,7 @@ out:
> return rc;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
> {
> struct au0828_fh *fh = priv;
> struct au0828_dev *dev = fh->dev;
> @@ -1332,7 +1332,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
> have to make the au0828 bridge adjust the size of its capture
> buffer, which is currently hardcoded at 720x480 */
>
> - v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, *norm);
> + v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, norm);
> dev->std_set_in_tuner_core = 1;
>
> if (dev->dvb.frontend && dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl)
> diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
> index 49c842a..f548db8 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-417.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-417.c
> @@ -1492,14 +1492,14 @@ static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct cx231xx_fh *fh = file->private_data;
> struct cx231xx *dev = fh->dev;
> unsigned int i;
>
> for (i = 0; i < ARRAY_SIZE(cx231xx_tvnorms); i++)
> - if (*id & cx231xx_tvnorms[i].id)
> + if (id & cx231xx_tvnorms[i].id)
> break;
> if (i == ARRAY_SIZE(cx231xx_tvnorms))
> return -EINVAL;
> diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
> index 53020a7..4cff2f4 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-video.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-video.c
> @@ -987,7 +987,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
> {
> struct cx231xx_fh *fh = priv;
> struct cx231xx *dev = fh->dev;
> @@ -998,13 +998,13 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> if (rc < 0)
> return rc;
>
> - if (dev->norm == *norm)
> + if (dev->norm == norm)
> return 0;
>
> if (videobuf_queue_is_busy(&fh->vb_vidq))
> return -EBUSY;
>
> - dev->norm = *norm;
> + dev->norm = norm;
>
> /* Adjusts width/height, if needed */
> dev->width = 720;
> diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
> index 1f16904..98cdc4f 100644
> --- a/drivers/media/usb/em28xx/em28xx-video.c
> +++ b/drivers/media/usb/em28xx/em28xx-video.c
> @@ -994,23 +994,23 @@ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
> {
> struct em28xx_fh *fh = priv;
> struct em28xx *dev = fh->dev;
> struct v4l2_format f;
>
> - if (*norm == dev->norm)
> + if (norm == dev->norm)
> return 0;
>
> if (dev->streaming_users > 0)
> return -EBUSY;
>
> - dev->norm = *norm;
> + dev->norm = norm;
>
> /* Adjusts width/height, if needed */
> f.fmt.pix.width = 720;
> - f.fmt.pix.height = (*norm & V4L2_STD_525_60) ? 480 : 576;
> + f.fmt.pix.height = (norm & V4L2_STD_525_60) ? 480 : 576;
> vidioc_try_fmt_vid_cap(file, priv, &f);
>
> /* set new image size */
> diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
> index da6b779..f49bb32 100644
> --- a/drivers/media/usb/hdpvr/hdpvr-video.c
> +++ b/drivers/media/usb/hdpvr/hdpvr-video.c
> @@ -581,13 +581,13 @@ static int vidioc_querycap(struct file *file, void *priv,
> }
>
> static int vidioc_s_std(struct file *file, void *private_data,
> - v4l2_std_id *std)
> + v4l2_std_id std)
> {
> struct hdpvr_fh *fh = file->private_data;
> struct hdpvr_device *dev = fh->dev;
> u8 std_type = 1;
>
> - if (*std & (V4L2_STD_NTSC | V4L2_STD_PAL_60))
> + if (std & (V4L2_STD_NTSC | V4L2_STD_PAL_60))
> std_type = 0;
>
> return hdpvr_config_call(dev, CTRL_VIDEO_STD_TYPE, std_type);
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index 0f729c9..a7774e3 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -196,13 +196,13 @@ static int pvr2_g_std(struct file *file, void *priv, v4l2_std_id *std)
> return ret;
> }
>
> -static int pvr2_s_std(struct file *file, void *priv, v4l2_std_id *std)
> +static int pvr2_s_std(struct file *file, void *priv, v4l2_std_id std)
> {
> struct pvr2_v4l2_fh *fh = file->private_data;
> struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
>
> return pvr2_ctrl_set_value(
> - pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDCUR), *std);
> + pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDCUR), std);
> }
>
> static int pvr2_querystd(struct file *file, void *priv, v4l2_std_id *std)
> diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
> index 2bd8613..ab97e7d 100644
> --- a/drivers/media/usb/s2255/s2255drv.c
> +++ b/drivers/media/usb/s2255/s2255drv.c
> @@ -1294,7 +1294,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id i)
> {
> struct s2255_fh *fh = priv;
> struct s2255_mode mode;
> @@ -1314,7 +1314,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
> goto out_s_std;
> }
> mode = fh->channel->mode;
> - if (*i & V4L2_STD_525_60) {
> + if (i & V4L2_STD_525_60) {
> dprintk(4, "%s 60 Hz\n", __func__);
> /* if changing format, reset frame decimation/intervals */
> if (mode.format != FORMAT_NTSC) {
> @@ -1324,7 +1324,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
> channel->width = LINE_SZ_4CIFS_NTSC;
> channel->height = NUM_LINES_4CIFS_NTSC * 2;
> }
> - } else if (*i & V4L2_STD_625_50) {
> + } else if (i & V4L2_STD_625_50) {
> dprintk(4, "%s 50 Hz\n", __func__);
> if (mode.format != FORMAT_PAL) {
> mode.restart = 1;
> @@ -1337,7 +1337,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
> ret = -EINVAL;
> goto out_s_std;
> }
> - fh->channel->std = *i;
> + fh->channel->std = i;
> if (mode.restart)
> s2255_set_mode(fh->channel, &mode);
> out_s_std:
> diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
> index 5307a63..f6a6cdc 100644
> --- a/drivers/media/usb/stk1160/stk1160-v4l.c
> +++ b/drivers/media/usb/stk1160/stk1160-v4l.c
> @@ -375,7 +375,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
> {
> struct stk1160 *dev = video_drvdata(file);
> struct vb2_queue *q = &dev->vb_vidq;
> @@ -388,7 +388,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> return -ENODEV;
>
> /* We need to set this now, before we call stk1160_set_std */
> - dev->norm = *norm;
> + dev->norm = norm;
>
> /* This is taken from saa7115 video decoder */
> if (dev->norm & V4L2_STD_525_60) {
> diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
> index 9595309..8df668d 100644
> --- a/drivers/media/usb/tlg2300/pd-video.c
> +++ b/drivers/media/usb/tlg2300/pd-video.c
> @@ -801,7 +801,7 @@ static int vidioc_g_fmt_vbi(struct file *file, void *fh,
> return 0;
> }
>
> -static int set_std(struct poseidon *pd, v4l2_std_id *norm)
> +static int set_std(struct poseidon *pd, v4l2_std_id norm)
> {
> struct video_data *video = &pd->video_data;
> struct vbi_data *vbi = &pd->vbi_data;
> @@ -811,7 +811,7 @@ static int set_std(struct poseidon *pd, v4l2_std_id *norm)
> int height;
>
> for (i = 0; i < POSEIDON_TVNORMS; i++) {
> - if (*norm & poseidon_tvnorms[i].v4l2_id) {
> + if (norm & poseidon_tvnorms[i].v4l2_id) {
> param = poseidon_tvnorms[i].tlg_tvnorm;
> log("name : %s", poseidon_tvnorms[i].name);
> goto found;
> @@ -846,7 +846,7 @@ out:
> return ret;
> }
>
> -static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *norm)
> +static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id norm)
> {
> struct front_face *front = fh;
>
> @@ -1270,7 +1270,7 @@ static int restore_v4l2_context(struct poseidon *pd,
>
> pd_video_checkmode(pd);
>
> - set_std(pd, &context->tvnormid);
> + set_std(pd, context->tvnormid);
> vidioc_s_input(NULL, front, context->sig_index);
> pd_vidioc_s_tuner(pd, context->audio_idx);
> pd_vidioc_s_fmt(pd, &context->pix);
> diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
> index b4618d7..a78de1d 100644
> --- a/drivers/media/usb/tm6000/tm6000-video.c
> +++ b/drivers/media/usb/tm6000/tm6000-video.c
> @@ -1056,13 +1056,13 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
> {
> int rc = 0;
> struct tm6000_fh *fh = priv;
> struct tm6000_core *dev = fh->dev;
>
> - dev->norm = *norm;
> + dev->norm = norm;
> rc = tm6000_init_analog_mode(dev);
>
> fh->width = dev->width;
> @@ -1134,7 +1134,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
>
> dev->input = i;
>
> - rc = vidioc_s_std(file, priv, &dev->vfd->current_norm);
> + rc = vidioc_s_std(file, priv, dev->vfd->current_norm);
>
> return rc;
> }
> diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
> index 874cfec..041f19e 100644
> --- a/drivers/media/usb/usbvision/usbvision-video.c
> +++ b/drivers/media/usb/usbvision/usbvision-video.c
> @@ -595,11 +595,11 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int input)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *id)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
> {
> struct usb_usbvision *usbvision = video_drvdata(file);
>
> - usbvision->tvnorm_id = *id;
> + usbvision->tvnorm_id = id;
>
> call_all(usbvision, core, s_std, usbvision->tvnorm_id);
> /* propagate the change to the decoder */
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 8ec8abe..d80d8af 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1383,15 +1383,15 @@ static int v4l_s_std(const struct v4l2_ioctl_ops *ops,
> struct file *file, void *fh, void *arg)
> {
> struct video_device *vfd = video_devdata(file);
> - v4l2_std_id *id = arg, norm;
> + v4l2_std_id id = *(v4l2_std_id *)arg, norm;
> int ret;
>
> - norm = (*id) & vfd->tvnorms;
> + norm = id & vfd->tvnorms;
> if (vfd->tvnorms && !norm) /* Check if std is supported */
> return -EINVAL;
>
> /* Calls the specific handler */
> - ret = ops->vidioc_s_std(file, fh, &norm);
> + ret = ops->vidioc_s_std(file, fh, norm);
>
> /* Updates standard information */
> if (ret >= 0)
> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> index 99ccbeb..948cfe2 100644
> --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> @@ -924,7 +924,7 @@ static int vpfe_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
> *
> * Return 0 on success, error code otherwise
> */
> -static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> +static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id std_id)
> {
> struct vpfe_video_device *video = video_drvdata(file);
> struct vpfe_device *vpfe_dev = video->vpfe_dev;
> @@ -945,13 +945,13 @@ static int vpfe_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
> goto unlock_out;
> }
> ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id,
> - core, s_std, *std_id);
> + core, s_std, std_id);
> if (ret < 0) {
> v4l2_err(&vpfe_dev->v4l2_dev, "Failed to set standard\n");
> video->stdid = V4L2_STD_UNKNOWN;
> goto unlock_out;
> }
> - video->stdid = *std_id;
> + video->stdid = std_id;
> unlock_out:
> mutex_unlock(&video->lock);
> return ret;
> diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
> index e33b7f5..073b3b3 100644
> --- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
> +++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
> @@ -612,9 +612,9 @@ dt3155_ioc_g_std(struct file *filp, void *p, v4l2_std_id *norm)
> }
>
> static int
> -dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id *norm)
> +dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id norm)
> {
> - if (*norm & DT3155_CURRENT_NORM)
> + if (norm & DT3155_CURRENT_NORM)
> return 0;
> return -EINVAL;
> }
> diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
> index 4e477f3..29fe94d 100644
> --- a/drivers/staging/media/go7007/go7007-v4l2.c
> +++ b/drivers/staging/media/go7007/go7007-v4l2.c
> @@ -1117,40 +1117,40 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std)
> return 0;
> }
>
> -static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *std)
> +static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std)
> {
> struct go7007 *go = ((struct go7007_file *) priv)->go;
>
> if (go->streaming)
> return -EBUSY;
>
> - if (!(go->board_info->sensor_flags & GO7007_SENSOR_TV) && *std != 0)
> + if (!(go->board_info->sensor_flags & GO7007_SENSOR_TV) && std != 0)
> return -EINVAL;
>
> - if (*std == 0)
> + if (std == 0)
> return -EINVAL;
>
> if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) &&
> go->input == go->board_info->num_inputs - 1) {
> if (!go->i2c_adapter_online)
> return -EIO;
> - if (call_all(&go->v4l2_dev, core, s_std, *std) < 0)
> + if (call_all(&go->v4l2_dev, core, s_std, std) < 0)
> return -EINVAL;
> }
>
> - if (*std & V4L2_STD_NTSC) {
> + if (std & V4L2_STD_NTSC) {
> go->standard = GO7007_STD_NTSC;
> go->sensor_framerate = 30000;
> - } else if (*std & V4L2_STD_PAL) {
> + } else if (std & V4L2_STD_PAL) {
> go->standard = GO7007_STD_PAL;
> go->sensor_framerate = 25025;
> - } else if (*std & V4L2_STD_SECAM) {
> + } else if (std & V4L2_STD_SECAM) {
> go->standard = GO7007_STD_PAL;
> go->sensor_framerate = 25025;
> } else
> return -EINVAL;
>
> - call_all(&go->v4l2_dev, core, s_std, *std);
> + call_all(&go->v4l2_dev, core, s_std, std);
> set_capture_size(go, NULL, 0);
>
> return 0;
> diff --git a/drivers/staging/media/solo6x10/v4l2-enc.c b/drivers/staging/media/solo6x10/v4l2-enc.c
> index 4977e86..310b126 100644
> --- a/drivers/staging/media/solo6x10/v4l2-enc.c
> +++ b/drivers/staging/media/solo6x10/v4l2-enc.c
> @@ -1326,7 +1326,7 @@ static int solo_enc_streamoff(struct file *file, void *priv,
> return videobuf_streamoff(&fh->vidq);
> }
>
> -static int solo_enc_s_std(struct file *file, void *priv, v4l2_std_id *i)
> +static int solo_enc_s_std(struct file *file, void *priv, v4l2_std_id i)
> {
> return 0;
> }
> diff --git a/drivers/staging/media/solo6x10/v4l2.c b/drivers/staging/media/solo6x10/v4l2.c
> index ca774cc..87f3c04 100644
> --- a/drivers/staging/media/solo6x10/v4l2.c
> +++ b/drivers/staging/media/solo6x10/v4l2.c
> @@ -773,7 +773,7 @@ static int solo_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
> return videobuf_streamoff(&fh->vidq);
> }
>
> -static int solo_s_std(struct file *file, void *priv, v4l2_std_id *i)
> +static int solo_s_std(struct file *file, void *priv, v4l2_std_id i)
> {
> return 0;
> }
> diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
> index a7ca488..57585c7 100644
> --- a/include/media/davinci/vpbe.h
> +++ b/include/media/davinci/vpbe.h
> @@ -132,7 +132,7 @@ struct vpbe_device_ops {
> struct v4l2_enum_dv_timings *timings_info);
>
> /* Set std at the output */
> - int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
> + int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id std_id);
>
> /* Get the current std at the output */
> int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
> diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
> index 0da8682..ee7b7c6 100644
> --- a/include/media/v4l2-ioctl.h
> +++ b/include/media/v4l2-ioctl.h
> @@ -132,7 +132,7 @@ struct v4l2_ioctl_ops {
> ENUMSTD is handled by videodev.c
> */
> int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
> - int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
> + int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id norm);
> int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
>
> /* Input handling */
--
Cheers,
Mauro
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 13:58 ` Mauro Carvalho Chehab
@ 2013-03-15 14:14 ` Hans Verkuil
0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-15 14:14 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: linux-media, Scott Jiang, Laurent Pinchart, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
On Fri March 15 2013 14:58:35 Mauro Carvalho Chehab wrote:
> Em Fri, 15 Mar 2013 11:27:23 +0100
> Hans Verkuil <hverkuil@xs4all.nl> escreveu:
>
> > From: Hans Verkuil <hans.verkuil@cisco.com>
> >
> > This ioctl is defined as IOW, so pass the argument by value instead of by
> > reference. I could have chosen to add const instead, but this is 1) easier
> > to handle in drivers and 2) consistent with the s_std subdev operation.
>
> Hmm... this could potentially break userspace. I remember I saw in the past
> some code that used the returned standard. I can't remember where. It could
> be inside the V4L1 compat layer, but I think it was on some userspace app(s).
>
> Had you verify how the several different userspace apps handle S_STD?
video_usercopy doesn't call copy_to_user for write-only ioctls, so any changed
data will never make it to userspace.
If there is an app that expects to see the returned standard then they broke
many years ago :-)
Regards,
Hans
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
` (2 preceding siblings ...)
2013-03-15 13:58 ` Mauro Carvalho Chehab
@ 2013-03-16 6:46 ` Guennadi Liakhovetski
2013-03-16 7:26 ` Prabhakar Lad
4 siblings, 0 replies; 21+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-16 6:46 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans
On Fri, 15 Mar 2013, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument by value instead of by
> reference. I could have chosen to add const instead, but this is 1) easier
> to handle in drivers and 2) consistent with the s_std subdev operation.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
[snip]
> drivers/media/platform/sh_vou.c | 12 ++++++------
> drivers/media/platform/soc_camera/soc_camera.c | 4 ++--
For the above two:
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
2013-03-15 12:22 ` Laurent Pinchart
@ 2013-03-16 6:50 ` Guennadi Liakhovetski
2013-03-16 7:43 ` Prabhakar Lad
2 siblings, 0 replies; 21+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-16 6:50 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
On Fri, 15 Mar 2013, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
[snip]
> drivers/media/i2c/soc_camera/mt9m001.c | 2 +-
> drivers/media/i2c/soc_camera/mt9m111.c | 2 +-
> drivers/media/i2c/soc_camera/mt9t031.c | 2 +-
> drivers/media/i2c/soc_camera/mt9t112.c | 2 +-
> drivers/media/i2c/soc_camera/mt9v022.c | 2 +-
> drivers/media/i2c/soc_camera/ov2640.c | 2 +-
> drivers/media/i2c/soc_camera/ov5642.c | 2 +-
> drivers/media/i2c/soc_camera/ov6650.c | 2 +-
> drivers/media/i2c/soc_camera/ov772x.c | 2 +-
> drivers/media/i2c/soc_camera/ov9640.c | 2 +-
> drivers/media/i2c/soc_camera/ov9740.c | 2 +-
> drivers/media/i2c/soc_camera/rj54n1cb0c.c | 2 +-
> drivers/media/i2c/soc_camera/tw9910.c | 2 +-
[snip]
> drivers/media/platform/sh_vou.c | 2 +-
> drivers/media/platform/soc_camera/soc_camera.c | 2 +-
For the above
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
` (3 preceding siblings ...)
2013-03-16 6:46 ` Guennadi Liakhovetski
@ 2013-03-16 7:26 ` Prabhakar Lad
4 siblings, 0 replies; 21+ messages in thread
From: Prabhakar Lad @ 2013-03-16 7:26 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch!
On Fri, Mar 15, 2013 at 3:57 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument by value instead of by
> reference. I could have chosen to add const instead, but this is 1) easier
> to handle in drivers and 2) consistent with the s_std subdev operation.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
[snip]
> drivers/media/platform/davinci/vpbe.c | 8 ++++----
> drivers/media/platform/davinci/vpbe_display.c | 2 +-
> drivers/media/platform/davinci/vpfe_capture.c | 12 ++++++------
> drivers/media/platform/davinci/vpif_capture.c | 6 +++---
> drivers/media/platform/davinci/vpif_display.c | 10 +++++-----
[snip]
> drivers/staging/media/davinci_vpfe/vpfe_video.c | 6 +++---
For the above
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cheers,
--Prabhakar Lad
http://www.linkedin.com/pub/prabhakar-lad/19/92b/955
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
2013-03-15 12:22 ` Laurent Pinchart
2013-03-16 6:50 ` Guennadi Liakhovetski
@ 2013-03-16 7:43 ` Prabhakar Lad
2 siblings, 0 replies; 21+ messages in thread
From: Prabhakar Lad @ 2013-03-16 7:43 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
Thanks for the patch!
On Fri, Mar 15, 2013 at 3:57 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
[snip]
> drivers/media/platform/davinci/vpbe_display.c | 2 +-
> drivers/media/platform/davinci/vpif_capture.c | 3 +-
> drivers/media/platform/davinci/vpif_display.c | 3 +-
For the above
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cheers,
--Prabhakar Lad
http://www.linkedin.com/pub/prabhakar-lad/19/92b/955
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl.
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
2013-03-15 12:12 ` Laurent Pinchart
@ 2013-03-16 12:18 ` Alexey Klimov
1 sibling, 0 replies; 21+ messages in thread
From: Alexey Klimov @ 2013-03-16 12:18 UTC (permalink / raw)
To: Hans Verkuil
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Laurent Pinchart,
Jonathan Corbet, Guennadi Liakhovetski, Andy Walls, Prabhakar Lad,
Kyungmin Park, Tomasz Stanislawski, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
Hi Hans,
On Fri, Mar 15, 2013 at 2:27 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This ioctl is defined as IOW, so pass the argument as const.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[snip]
> drivers/media/radio/dsbr100.c | 2 +-
> drivers/media/radio/radio-ma901.c | 2 +-
> drivers/media/radio/radio-mr800.c | 2 +-
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
for this three radio drivers.
Thanks.
--
Best regards, Klimov Alexey
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code.
2013-03-15 12:25 ` Laurent Pinchart
@ 2013-03-18 13:52 ` Hans Verkuil
0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2013-03-18 13:52 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, Mauro Carvalho Chehab, Scott Jiang, Jonathan Corbet,
Guennadi Liakhovetski, Andy Walls, Prabhakar Lad, Kyungmin Park,
Tomasz Stanislawski, Alexey Klimov, Hans de Goede, Brian Johnson,
Mike Isely, Ezequiel Garcia, Huang Shijie, Ismael Luceno,
Takashi Iwai, Ondrej Zary, Hans Verkuil
On Fri March 15 2013 13:25:21 Laurent Pinchart wrote:
> Hi Hans,
>
> Thanks for the patch.
>
> On Friday 15 March 2013 11:27:25 Hans Verkuil wrote:
> > From: Hans Verkuil <hans.verkuil@cisco.com>
> >
> > The core debug code can now be simplified since all the write-only ioctls
> > are now const and will not modify the data they pass to the drivers.
> >
> > So instead of logging write-only ioctls before the driver is called this can
> > now be done afterwards, which is cleaner when it comes to error reporting
> > as well.
> >
> > This also fixes a logic error in the debugging code where there was one
> > 'else' too many.
> >
> > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> > ---
> > drivers/media/v4l2-core/v4l2-ioctl.c | 15 ++-------------
> > 1 file changed, 2 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> > b/drivers/media/v4l2-core/v4l2-ioctl.c index 2abd13a..b3fe148 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -2147,11 +2147,6 @@ static long __video_do_ioctl(struct file *file,
> > }
> >
> > write_only = _IOC_DIR(cmd) == _IOC_WRITE;
> > - if (write_only && debug > V4L2_DEBUG_IOCTL) {
> > - v4l_printk_ioctl(video_device_node_name(vfd), cmd);
> > - pr_cont(": ");
> > - info->debug(arg, write_only);
> > - }
> > if (info->flags & INFO_FL_STD) {
> > typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
> > const void *p = vfd->ioctl_ops;
> > @@ -2170,16 +2165,10 @@ static long __video_do_ioctl(struct file *file,
> >
> > done:
> > if (debug) {
> > - if (write_only && debug > V4L2_DEBUG_IOCTL) {
> > - if (ret < 0)
> > - printk(KERN_DEBUG "%s: error %ld\n",
> > - video_device_node_name(vfd), ret);
> > - return ret;
> > - }
> > v4l_printk_ioctl(video_device_node_name(vfd), cmd);
> > if (ret < 0)
> > - pr_cont(": error %ld\n", ret);
> > - else if (debug == V4L2_DEBUG_IOCTL)
> > + pr_cont(": error %ld", ret);
> > + if (debug == V4L2_DEBUG_IOCTL)
>
> Shouldn't this be >= V4L2_DEBUG_IOCTL ?
No. V4L2_DEBUG_IOCTL is the lowest debug level and should just print the ioctl
and return code. So the else parts are for higher debug levels where all args
are also printed.
Regards,
Hans
>
> > pr_cont("\n");
> > else if (_IOC_DIR(cmd) == _IOC_NONE)
> > info->debug(arg, write_only);
>
>
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2013-03-18 13:53 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 10:27 [REVIEW PATCH 0/5] v4l2: constify _IOW ioctls Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
2013-03-15 10:27 ` [REVIEW PATCH 2/5] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
2013-03-15 12:12 ` Laurent Pinchart
2013-03-16 12:18 ` Alexey Klimov
2013-03-15 10:27 ` [REVIEW PATCH 3/5] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
2013-03-15 12:17 ` Laurent Pinchart
2013-03-15 13:38 ` Jonathan Corbet
2013-03-15 13:58 ` Mauro Carvalho Chehab
2013-03-15 14:14 ` Hans Verkuil
2013-03-16 6:46 ` Guennadi Liakhovetski
2013-03-16 7:26 ` Prabhakar Lad
2013-03-15 10:27 ` [REVIEW PATCH 4/5] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
2013-03-15 12:22 ` Laurent Pinchart
2013-03-16 6:50 ` Guennadi Liakhovetski
2013-03-16 7:43 ` Prabhakar Lad
2013-03-15 10:27 ` [REVIEW PATCH 5/5] v4l2-ioctl: simplify debug code Hans Verkuil
2013-03-15 12:25 ` Laurent Pinchart
2013-03-18 13:52 ` Hans Verkuil
2013-03-15 12:08 ` [REVIEW PATCH 1/5] v4l2: add const to argument of write-only s_frequency ioctl Laurent Pinchart
2013-03-15 12:18 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).