[PATCH 16/21] media: av7110: coding style fixes: sizeof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/staging/media/av7110/av7110.c     | 2 +-
 drivers/staging/media/av7110/av7110_v4l.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index de9476154..42b5d049e 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -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;
diff --git a/drivers/staging/media/av7110/av7110_v4l.c b/drivers/staging/media/av7110/av7110_v4l.c
index 0ccc34f3d..d13f1afec 100644
--- a/drivers/staging/media/av7110/av7110_v4l.c
+++ b/drivers/staging/media/av7110/av7110_v4l.c
@@ -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;
--
2.34.0





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux