]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: av7110: coding style fixes: sizeof
authorStefan Herdler <herdler@nurfuerspam.de>
Tue, 7 May 2024 00:24:55 +0000 (02:24 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Jun 2024 14:19:56 +0000 (16:19 +0200)
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>
drivers/staging/media/av7110/av7110.c
drivers/staging/media/av7110/av7110_v4l.c

index de947615407523fccc5b1808ea308697426e6743..42b5d049ec1262acd0f520aa767b9bc1702b053f 100644 (file)
@@ -2437,7 +2437,7 @@ static int av7110_attach(struct saa7146_dev *dev,
        }
 
        /* prepare the av7110 device struct */
-       av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL);
+       av7110 = kzalloc(sizeof(*av7110), GFP_KERNEL);
        if (!av7110) {
                dprintk(1, "out of memory\n");
                return -ENOMEM;
index 0ccc34f3d19c0f6a8518d70b39937c48dc740b27..d13f1afec84d79c6d3576fe1e2657f376a25610f 100644 (file)
@@ -557,7 +557,7 @@ static int vidioc_g_fmt_sliced_vbi_out(struct file *file, void *fh,
        dprintk(2, "VIDIOC_G_FMT:\n");
        if (FW_VERSION(av7110->arm_app) < 0x2623)
                return -EINVAL;
-       memset(&f->fmt.sliced, 0, sizeof f->fmt.sliced);
+       memset(&f->fmt.sliced, 0, sizeof(f->fmt.sliced));
        if (av7110->wssMode) {
                f->fmt.sliced.service_set = V4L2_SLICED_WSS_625;
                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
        int rc;
 
        dprintk(2, "%s\n", __func__);
-       if (FW_VERSION(av7110->arm_app) < 0x2623 || !av7110->wssMode || count != sizeof d)
+       if (FW_VERSION(av7110->arm_app) < 0x2623 || !av7110->wssMode || count != sizeof(d))
                return -EINVAL;
        if (copy_from_user(&d, data, count))
                return -EFAULT;