forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/media/usb/em28xx/em28xx-i2c.c
....@@ -296,7 +296,7 @@
296296 return ret;
297297 }
298298 /*
299
- * NOTE: some devices with two i2c busses have the bad habit to return 0
299
+ * NOTE: some devices with two i2c buses have the bad habit to return 0
300300 * bytes if we are on bus B AND there was no write attempt to the
301301 * specified slave address before AND no device is present at the
302302 * requested slave address.
....@@ -427,7 +427,7 @@
427427 return ret;
428428 }
429429 /*
430
- * NOTE: some devices with two i2c busses have the bad habit to return 0
430
+ * NOTE: some devices with two i2c buses have the bad habit to return 0
431431 * bytes if we are on bus B AND there was no write attempt to the
432432 * specified slave address before AND no device is present at the
433433 * requested slave address.
....@@ -949,7 +949,7 @@
949949 unsigned char buf;
950950 int i, rc;
951951
952
- memset(i2c_devicelist, 0, ARRAY_SIZE(i2c_devicelist));
952
+ memset(i2c_devicelist, 0, sizeof(i2c_devicelist));
953953
954954 for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
955955 dev->i2c_client[bus].addr = i;
....@@ -964,7 +964,7 @@
964964
965965 if (bus == dev->def_i2c_bus)
966966 dev->i2c_hash = em28xx_hash_mem(i2c_devicelist,
967
- ARRAY_SIZE(i2c_devicelist), 32);
967
+ sizeof(i2c_devicelist), 32);
968968 }
969969
970970 /*
....@@ -985,7 +985,8 @@
985985
986986 dev->i2c_adap[bus] = em28xx_adap_template;
987987 dev->i2c_adap[bus].dev.parent = &dev->intf->dev;
988
- strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev));
988
+ strscpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev),
989
+ sizeof(dev->i2c_adap[bus].name));
989990
990991 dev->i2c_bus[bus].bus = bus;
991992 dev->i2c_bus[bus].algo_type = algo_type;