Skip to content

Commit ec29c01

Browse files
Stefan Herdleropsiff
authored andcommitted
media: av7110: coding style fixes: sizeof
This patch fixes the following checkpatch warnings: WARNING:SIZEOF_PARENTHESIS: sizeof d should be sizeof(d) WARNING:SIZEOF_PARENTHESIS: sizeof f->fmt.sliced should be sizeof(f->fmt.sliced) WARNING:CONST_STRUCT: struct dvb_frontend_ops should normally be const CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*av7110)...) over kzalloc(sizeof(struct av7110)...) Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> (cherry picked from commit e7b9b55) Stable-dep-of: 458ea1c ("media: av7110: fix a spectre vulnerability") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 529b76b commit ec29c01

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/staging/media/av7110/av7110.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ static int av7110_attach(struct saa7146_dev *dev,
24372437
}
24382438

24392439
/* prepare the av7110 device struct */
2440-
av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL);
2440+
av7110 = kzalloc(sizeof(*av7110), GFP_KERNEL);
24412441
if (!av7110) {
24422442
dprintk(1, "out of memory\n");
24432443
return -ENOMEM;

drivers/staging/media/av7110/av7110_v4l.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static int vidioc_g_fmt_sliced_vbi_out(struct file *file, void *fh,
557557
dprintk(2, "VIDIOC_G_FMT:\n");
558558
if (FW_VERSION(av7110->arm_app) < 0x2623)
559559
return -EINVAL;
560-
memset(&f->fmt.sliced, 0, sizeof f->fmt.sliced);
560+
memset(&f->fmt.sliced, 0, sizeof(f->fmt.sliced));
561561
if (av7110->wssMode) {
562562
f->fmt.sliced.service_set = V4L2_SLICED_WSS_625;
563563
f->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625;
@@ -618,7 +618,7 @@ static ssize_t av7110_vbi_write(struct file *file, const char __user *data, size
618618
int rc;
619619

620620
dprintk(2, "%s\n", __func__);
621-
if (FW_VERSION(av7110->arm_app) < 0x2623 || !av7110->wssMode || count != sizeof d)
621+
if (FW_VERSION(av7110->arm_app) < 0x2623 || !av7110->wssMode || count != sizeof(d))
622622
return -EINVAL;
623623
if (copy_from_user(&d, data, count))
624624
return -EFAULT;

0 commit comments

Comments
 (0)