media: rtl2832_sdr/vivid/airspy/hackrf/msi2500: drop memset of fmt.sdr.reserved
The V4L2 core already zeroes fmt.sdr.reserved, so there is no need for drivers to do the same. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Родитель
be8656e62e
Коммит
b2cd0b31ed
|
@ -1130,8 +1130,6 @@ static int rtl2832_sdr_g_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
f->fmt.sdr.pixelformat = dev->pixelformat;
|
f->fmt.sdr.pixelformat = dev->pixelformat;
|
||||||
f->fmt.sdr.buffersize = dev->buffersize;
|
f->fmt.sdr.buffersize = dev->buffersize;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,7 +1147,6 @@ static int rtl2832_sdr_s_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
if (vb2_is_busy(q))
|
if (vb2_is_busy(q))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < dev->num_formats; i++) {
|
for (i = 0; i < dev->num_formats; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
dev->pixelformat = formats[i].pixelformat;
|
dev->pixelformat = formats[i].pixelformat;
|
||||||
|
@ -1177,7 +1174,6 @@ static int rtl2832_sdr_try_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
dev_dbg(&pdev->dev, "pixelformat fourcc %4.4s\n",
|
dev_dbg(&pdev->dev, "pixelformat fourcc %4.4s\n",
|
||||||
(char *)&f->fmt.sdr.pixelformat);
|
(char *)&f->fmt.sdr.pixelformat);
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < dev->num_formats; i++) {
|
for (i = 0; i < dev->num_formats; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
f->fmt.sdr.buffersize = formats[i].buffersize;
|
f->fmt.sdr.buffersize = formats[i].buffersize;
|
||||||
|
|
|
@ -455,7 +455,6 @@ int vidioc_g_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f)
|
||||||
|
|
||||||
f->fmt.sdr.pixelformat = dev->sdr_pixelformat;
|
f->fmt.sdr.pixelformat = dev->sdr_pixelformat;
|
||||||
f->fmt.sdr.buffersize = dev->sdr_buffersize;
|
f->fmt.sdr.buffersize = dev->sdr_buffersize;
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +467,6 @@ int vidioc_s_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f)
|
||||||
if (vb2_is_busy(q))
|
if (vb2_is_busy(q))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < ARRAY_SIZE(formats); i++) {
|
for (i = 0; i < ARRAY_SIZE(formats); i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
dev->sdr_pixelformat = formats[i].pixelformat;
|
dev->sdr_pixelformat = formats[i].pixelformat;
|
||||||
|
@ -488,7 +486,6 @@ int vidioc_try_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < ARRAY_SIZE(formats); i++) {
|
for (i = 0; i < ARRAY_SIZE(formats); i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
f->fmt.sdr.buffersize = formats[i].buffersize;
|
f->fmt.sdr.buffersize = formats[i].buffersize;
|
||||||
|
|
|
@ -632,7 +632,6 @@ static int airspy_g_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
|
|
||||||
f->fmt.sdr.pixelformat = s->pixelformat;
|
f->fmt.sdr.pixelformat = s->pixelformat;
|
||||||
f->fmt.sdr.buffersize = s->buffersize;
|
f->fmt.sdr.buffersize = s->buffersize;
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -647,7 +646,6 @@ static int airspy_s_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
if (vb2_is_busy(q))
|
if (vb2_is_busy(q))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < NUM_FORMATS; i++) {
|
for (i = 0; i < NUM_FORMATS; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
s->pixelformat = formats[i].pixelformat;
|
s->pixelformat = formats[i].pixelformat;
|
||||||
|
@ -670,7 +668,6 @@ static int airspy_try_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < NUM_FORMATS; i++) {
|
for (i = 0; i < NUM_FORMATS; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
f->fmt.sdr.buffersize = formats[i].buffersize;
|
f->fmt.sdr.buffersize = formats[i].buffersize;
|
||||||
|
|
|
@ -929,7 +929,6 @@ static int hackrf_s_fmt_sdr(struct file *file, void *priv,
|
||||||
if (vb2_is_busy(q))
|
if (vb2_is_busy(q))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < NUM_FORMATS; i++) {
|
for (i = 0; i < NUM_FORMATS; i++) {
|
||||||
if (f->fmt.sdr.pixelformat == formats[i].pixelformat) {
|
if (f->fmt.sdr.pixelformat == formats[i].pixelformat) {
|
||||||
dev->pixelformat = formats[i].pixelformat;
|
dev->pixelformat = formats[i].pixelformat;
|
||||||
|
@ -955,7 +954,6 @@ static int hackrf_g_fmt_sdr(struct file *file, void *priv,
|
||||||
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
||||||
(char *)&dev->pixelformat);
|
(char *)&dev->pixelformat);
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
f->fmt.sdr.pixelformat = dev->pixelformat;
|
f->fmt.sdr.pixelformat = dev->pixelformat;
|
||||||
f->fmt.sdr.buffersize = dev->buffersize;
|
f->fmt.sdr.buffersize = dev->buffersize;
|
||||||
|
|
||||||
|
@ -971,7 +969,6 @@ static int hackrf_try_fmt_sdr(struct file *file, void *priv,
|
||||||
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
||||||
(char *)&f->fmt.sdr.pixelformat);
|
(char *)&f->fmt.sdr.pixelformat);
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < NUM_FORMATS; i++) {
|
for (i = 0; i < NUM_FORMATS; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
f->fmt.sdr.buffersize = formats[i].buffersize;
|
f->fmt.sdr.buffersize = formats[i].buffersize;
|
||||||
|
|
|
@ -912,7 +912,6 @@ static int msi2500_g_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
|
|
||||||
f->fmt.sdr.pixelformat = dev->pixelformat;
|
f->fmt.sdr.pixelformat = dev->pixelformat;
|
||||||
f->fmt.sdr.buffersize = dev->buffersize;
|
f->fmt.sdr.buffersize = dev->buffersize;
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -930,7 +929,6 @@ static int msi2500_s_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
if (vb2_is_busy(q))
|
if (vb2_is_busy(q))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < dev->num_formats; i++) {
|
for (i = 0; i < dev->num_formats; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
dev->pixelformat = formats[i].pixelformat;
|
dev->pixelformat = formats[i].pixelformat;
|
||||||
|
@ -957,7 +955,6 @@ static int msi2500_try_fmt_sdr_cap(struct file *file, void *priv,
|
||||||
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
dev_dbg(dev->dev, "pixelformat fourcc %4.4s\n",
|
||||||
(char *)&f->fmt.sdr.pixelformat);
|
(char *)&f->fmt.sdr.pixelformat);
|
||||||
|
|
||||||
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
|
|
||||||
for (i = 0; i < dev->num_formats; i++) {
|
for (i = 0; i < dev->num_formats; i++) {
|
||||||
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
|
||||||
f->fmt.sdr.buffersize = formats[i].buffersize;
|
f->fmt.sdr.buffersize = formats[i].buffersize;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче