This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: em28xx: fix two smatch warnings
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Sun Nov 3 12:23:35 2019 +0100

Use sizeof instead of ARRAY_SIZE to fix this smatch warning:

drivers/media/usb/em28xx/em28xx-i2c.c:952 em28xx_do_i2c_scan() warn: calling 
memset(x, y, ARRAY_SIZE());

Do the same for the em28xx_hash_mem() call in the same function.
smatch didn't pick that up, but there too it should use sizeof instead
of ARRAY_SIZE.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>

 drivers/media/usb/em28xx/em28xx-i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c 
b/drivers/media/usb/em28xx/em28xx-i2c.c
index a3155ec196cc..592b98b3643a 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -949,7 +949,7 @@ void em28xx_do_i2c_scan(struct em28xx *dev, unsigned int 
bus)
        unsigned char buf;
        int i, rc;
 
-       memset(i2c_devicelist, 0, ARRAY_SIZE(i2c_devicelist));
+       memset(i2c_devicelist, 0, sizeof(i2c_devicelist));
 
        for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
                dev->i2c_client[bus].addr = i;
@@ -964,7 +964,7 @@ void em28xx_do_i2c_scan(struct em28xx *dev, unsigned int 
bus)
 
        if (bus == dev->def_i2c_bus)
                dev->i2c_hash = em28xx_hash_mem(i2c_devicelist,
-                                               ARRAY_SIZE(i2c_devicelist), 32);
+                                               sizeof(i2c_devicelist), 32);
 }
 
 /*

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to