hwmon: move from strlcpy with unused retval to strscpy
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 18 Aug 2022 21:00:11 +0000 (23:00 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 19 Sep 2022 13:17:05 +0000 (06:17 -0700)
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
56 files changed:
drivers/hwmon/adc128d818.c
drivers/hwmon/adm1021.c
drivers/hwmon/adm1025.c
drivers/hwmon/adm1026.c
drivers/hwmon/adm1029.c
drivers/hwmon/adm1031.c
drivers/hwmon/adt7411.c
drivers/hwmon/adt7462.c
drivers/hwmon/adt7475.c
drivers/hwmon/amc6821.c
drivers/hwmon/asb100.c
drivers/hwmon/asc7621.c
drivers/hwmon/dme1737.c
drivers/hwmon/emc1403.c
drivers/hwmon/emc2103.c
drivers/hwmon/emc6w201.c
drivers/hwmon/f75375s.c
drivers/hwmon/fschmd.c
drivers/hwmon/ftsteutates.c
drivers/hwmon/gl518sm.c
drivers/hwmon/gl520sm.c
drivers/hwmon/jc42.c
drivers/hwmon/lm63.c
drivers/hwmon/lm73.c
drivers/hwmon/lm75.c
drivers/hwmon/lm77.c
drivers/hwmon/lm78.c
drivers/hwmon/lm80.c
drivers/hwmon/lm83.c
drivers/hwmon/lm85.c
drivers/hwmon/lm87.c
drivers/hwmon/lm90.c
drivers/hwmon/lm92.c
drivers/hwmon/lm93.c
drivers/hwmon/lm95234.c
drivers/hwmon/lm95241.c
drivers/hwmon/lm95245.c
drivers/hwmon/max1619.c
drivers/hwmon/max1668.c
drivers/hwmon/max31730.c
drivers/hwmon/max6639.c
drivers/hwmon/max6642.c
drivers/hwmon/nct7802.c
drivers/hwmon/nct7904.c
drivers/hwmon/smsc47m192.c
drivers/hwmon/stts751.c
drivers/hwmon/thmc50.c
drivers/hwmon/tmp401.c
drivers/hwmon/tmp421.c
drivers/hwmon/w83781d.c
drivers/hwmon/w83791d.c
drivers/hwmon/w83792d.c
drivers/hwmon/w83793.c
drivers/hwmon/w83795.c
drivers/hwmon/w83l785ts.c
drivers/hwmon/w83l786ng.c

index fd938c70293fb2010f2b535814cf38e17cb7d9fc..e7b9578631ecb1e2a6d8604967c667284e44aeb2 100644 (file)
@@ -384,7 +384,7 @@ static int adc128_detect(struct i2c_client *client, struct i2c_board_info *info)
        if (i2c_smbus_read_byte_data(client, ADC128_REG_BUSY_STATUS) & 0xfc)
                return -ENODEV;
 
-       strlcpy(info->type, "adc128d818", I2C_NAME_SIZE);
+       strscpy(info->type, "adc128d818", I2C_NAME_SIZE);
 
        return 0;
 }
index 91ecfee243bf9e25001d89603e3b29d1a1751316..2dc45e958730e6d0a9557d4dc8ad5682df15deb0 100644 (file)
@@ -426,7 +426,7 @@ static int adm1021_detect(struct i2c_client *client,
 
        pr_debug("Detected chip %s at adapter %d, address 0x%02x.\n",
                 type_name, i2c_adapter_id(adapter), client->addr);
-       strlcpy(info->type, type_name, I2C_NAME_SIZE);
+       strscpy(info->type, type_name, I2C_NAME_SIZE);
 
        return 0;
 }
index 4352f6a884e8f3eec93dd324336a50c4c021dd84..2984c4f98496fe41a0681319d1e0b73a45592489 100644 (file)
@@ -470,7 +470,7 @@ static int adm1025_detect(struct i2c_client *client,
        else
                return -ENODEV;
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 69b3ec752944744aa0e7deacad484b9eacaf65a7..1f084f7087435decd1095a834e03bce61945acc9 100644 (file)
@@ -1610,7 +1610,7 @@ static int adm1026_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "adm1026", I2C_NAME_SIZE);
+       strscpy(info->type, "adm1026", I2C_NAME_SIZE);
 
        return 0;
 }
index 3e1999413f3252128d3caeecd251ba396fececf6..eaf6e5e04aac13ec46d82915f359c6c9ecf0519c 100644 (file)
@@ -329,7 +329,7 @@ static int adm1029_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "adm1029", I2C_NAME_SIZE);
+       strscpy(info->type, "adm1029", I2C_NAME_SIZE);
 
        return 0;
 }
index ac841fa3a369d6edd6afc6c44dad920403202579..b42797bcb5b479ed22fa9089299f4fb7e36ba240 100644 (file)
@@ -985,7 +985,7 @@ static int adm1031_detect(struct i2c_client *client,
                return -ENODEV;
        name = (id == 0x30) ? "adm1030" : "adm1031";
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index fad74aa62b642ddc0bd9d2d723383363f282370b..bf5c5618f8d0d92d949d564c135aaebba888fa40 100644 (file)
@@ -590,7 +590,7 @@ static int adt7411_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "adt7411", I2C_NAME_SIZE);
+       strscpy(info->type, "adt7411", I2C_NAME_SIZE);
 
        return 0;
 }
index e75bbd87ad0933bb35575d48db18924b76f0e75a..9c0235849d4b6882ff85c1a245a40321853f9642 100644 (file)
@@ -1782,7 +1782,7 @@ static int adt7462_detect(struct i2c_client *client,
        if (revision != ADT7462_REVISION)
                return -ENODEV;
 
-       strlcpy(info->type, "adt7462", I2C_NAME_SIZE);
+       strscpy(info->type, "adt7462", I2C_NAME_SIZE);
 
        return 0;
 }
index ac480e6e4818b5763b3a0ed9d2b1fdf21a00e945..51b3d16c32233d78a524a9afca79af57dffce362 100644 (file)
@@ -1342,7 +1342,7 @@ static int adt7475_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 0c16face3fd3a686283de57167da5d834e509b63..3bfd12ff4b3ca67aa2cc2883524a9b93b8f26f7d 100644 (file)
@@ -809,7 +809,7 @@ static int amc6821_detect(
        }
 
        dev_info(&adapter->dev, "amc6821: chip found at 0x%02x.\n", address);
-       strlcpy(info->type, "amc6821", I2C_NAME_SIZE);
+       strscpy(info->type, "amc6821", I2C_NAME_SIZE);
 
        return 0;
 }
index 8cf0bcb85eb4e31f55f8b5ff527024e15678588e..45bedf619457b35ef5d60d5d21308c51a7a40c74 100644 (file)
@@ -769,7 +769,7 @@ static int asb100_detect(struct i2c_client *client,
        if (val1 != 0x31 || val2 != 0x06)
                return -ENODEV;
 
-       strlcpy(info->type, "asb100", I2C_NAME_SIZE);
+       strscpy(info->type, "asb100", I2C_NAME_SIZE);
 
        return 0;
 }
index e835605a7456991a12dd4fff1fbf8ee8e870ff1c..8385dadf7e198c3f71f7ccf9f562bc2ecd8a6096 100644 (file)
@@ -1153,7 +1153,7 @@ static int asc7621_detect(struct i2c_client *client,
 
                if (company == asc7621_chips[chip_index].company_id &&
                    verstep == asc7621_chips[chip_index].verstep_id) {
-                       strlcpy(info->type, asc7621_chips[chip_index].name,
+                       strscpy(info->type, asc7621_chips[chip_index].name,
                                I2C_NAME_SIZE);
 
                        dev_info(&adapter->dev, "Matched %s at 0x%02x\n",
index e3ad4c2d0038c8225ef7c54551995e496390d637..ae309e90477aa6636187a2ecdcf9917ff63cf9fe 100644 (file)
@@ -2456,7 +2456,7 @@ static int dme1737_i2c_detect(struct i2c_client *client,
        dev_info(dev, "Found a %s chip at 0x%02x (rev 0x%02x).\n",
                 verstep == SCH5027_VERSTEP ? "SCH5027" : "DME1737",
                 client->addr, verstep);
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 314838272049940109a9fed32f69aa9e4517795b..61d59189a6d10759fd03d1ab832adb191a84d10f 100644 (file)
@@ -329,22 +329,22 @@ static int emc1403_detect(struct i2c_client *client,
        id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
        switch (id) {
        case 0x20:
-               strlcpy(info->type, "emc1402", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1402", I2C_NAME_SIZE);
                break;
        case 0x21:
-               strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1403", I2C_NAME_SIZE);
                break;
        case 0x22:
-               strlcpy(info->type, "emc1422", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1422", I2C_NAME_SIZE);
                break;
        case 0x23:
-               strlcpy(info->type, "emc1423", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1423", I2C_NAME_SIZE);
                break;
        case 0x25:
-               strlcpy(info->type, "emc1404", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1404", I2C_NAME_SIZE);
                break;
        case 0x27:
-               strlcpy(info->type, "emc1424", I2C_NAME_SIZE);
+               strscpy(info->type, "emc1424", I2C_NAME_SIZE);
                break;
        default:
                return -ENODEV;
index e4c95ca9e19fa094c8cf5363fb2cb070d8ea0043..361cf9292456d62e3b6138c17bd5d1dfd84d1e5f 100644 (file)
@@ -643,7 +643,7 @@ emc2103_detect(struct i2c_client *new_client, struct i2c_board_info *info)
        if ((product != 0x24) && (product != 0x26))
                return -ENODEV;
 
-       strlcpy(info->type, "emc2103", I2C_NAME_SIZE);
+       strscpy(info->type, "emc2103", I2C_NAME_SIZE);
 
        return 0;
 }
index 29082c8463f4984fe31ef3a77c055c78a3557566..bcd93f0fe982b9e911dd8b1bea1a0bb89653e75b 100644 (file)
@@ -439,7 +439,7 @@ static int emc6w201_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "emc6w201", I2C_NAME_SIZE);
+       strscpy(info->type, "emc6w201", I2C_NAME_SIZE);
 
        return 0;
 }
index 57c8a473698d20968fc9f104e4be7645aa272d80..8a469b2df5e11534fca71aa42820e10aec765121 100644 (file)
@@ -897,7 +897,7 @@ static int f75375_detect(struct i2c_client *client,
 
        version = f75375_read8(client, F75375_REG_VERSION);
        dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index c26195e3aad78076c5c471427183de70ab7e953d..82652990063aee0fc5122b346d6c834fe83f8ec0 100644 (file)
@@ -1075,7 +1075,7 @@ static int fschmd_detect(struct i2c_client *client,
        else
                return -ENODEV;
 
-       strlcpy(info->type, fschmd_id[kind].name, I2C_NAME_SIZE);
+       strscpy(info->type, fschmd_id[kind].name, I2C_NAME_SIZE);
 
        return 0;
 }
index ceffc76a0c515437f70387d7f0eba2378597aae9..bb26ca97abbd868563693181c6a36f0a1104cb91 100644 (file)
@@ -739,7 +739,7 @@ static int fts_detect(struct i2c_client *client,
        if (val != 0x11)
                return -ENODEV;
 
-       strlcpy(info->type, fts_id[0].name, I2C_NAME_SIZE);
+       strscpy(info->type, fts_id[0].name, I2C_NAME_SIZE);
        info->flags = 0;
        return 0;
 }
index dd683b0a648f9a6d8526d1866e037f109f33b6c3..95286c40f55a966e94ad7d64478985cecea84272 100644 (file)
@@ -586,7 +586,7 @@ static int gl518_detect(struct i2c_client *client, struct i2c_board_info *info)
        if (rev != 0x00 && rev != 0x80)
                return -ENODEV;
 
-       strlcpy(info->type, "gl518sm", I2C_NAME_SIZE);
+       strscpy(info->type, "gl518sm", I2C_NAME_SIZE);
 
        return 0;
 }
index 096ba97972115477dce57c5f149aa2b1dd007025..394da4ac977c5a8613e24e6be1454928f0815e72 100644 (file)
@@ -811,7 +811,7 @@ static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info)
                return -ENODEV;
        }
 
-       strlcpy(info->type, "gl520sm", I2C_NAME_SIZE);
+       strscpy(info->type, "gl520sm", I2C_NAME_SIZE);
 
        return 0;
 }
index 07f7f8b5b73d74ddf6d45d60d8ffbd24dea62bf0..8379a5da46b82de6826419215dec418c52862f5d 100644 (file)
@@ -441,7 +441,7 @@ static int jc42_detect(struct i2c_client *client, struct i2c_board_info *info)
                struct jc42_chips *chip = &jc42_chips[i];
                if (manid == chip->manid &&
                    (devid & chip->devid_mask) == chip->devid) {
-                       strlcpy(info->type, "jc42", I2C_NAME_SIZE);
+                       strscpy(info->type, "jc42", I2C_NAME_SIZE);
                        return 0;
                }
        }
index 339a145afc093c06247818ce0277b217f6b6fe16..9ab2cab4c7106d00d7e329d30bd10d9c5693bb1f 100644 (file)
@@ -996,11 +996,11 @@ static int lm63_detect(struct i2c_client *client,
        }
 
        if (chip_id == 0x41 && address == 0x4c)
-               strlcpy(info->type, "lm63", I2C_NAME_SIZE);
+               strscpy(info->type, "lm63", I2C_NAME_SIZE);
        else if (chip_id == 0x51 && (address == 0x18 || address == 0x4e))
-               strlcpy(info->type, "lm64", I2C_NAME_SIZE);
+               strscpy(info->type, "lm64", I2C_NAME_SIZE);
        else if (chip_id == 0x49 && address == 0x4c)
-               strlcpy(info->type, "lm96163", I2C_NAME_SIZE);
+               strscpy(info->type, "lm96163", I2C_NAME_SIZE);
        else
                return -ENODEV;
 
index beb0d61bcd821c9baef68eec568e7a3e6bf74004..1346b3b3f4635a8460ee99be69c9b8b69c5264db 100644 (file)
@@ -257,7 +257,7 @@ static int lm73_detect(struct i2c_client *new_client,
        if (id < 0 || id != LM73_ID)
                return -ENODEV;
 
-       strlcpy(info->type, "lm73", I2C_NAME_SIZE);
+       strscpy(info->type, "lm73", I2C_NAME_SIZE);
 
        return 0;
 }
index 66dc826f7962c69ac912f66a0f5f1f18118cbf4d..bcc3adcb3af1a5574b0f0ac1d2095b5e52cf117d 100644 (file)
@@ -893,7 +893,7 @@ static int lm75_detect(struct i2c_client *new_client,
                        return -ENODEV;
        }
 
-       strlcpy(info->type, is_lm75a ? "lm75a" : "lm75", I2C_NAME_SIZE);
+       strscpy(info->type, is_lm75a ? "lm75a" : "lm75", I2C_NAME_SIZE);
 
        return 0;
 }
index df6af85e170aa838380ad49d9e5caacea0db662c..645cb2191abe433ee25b6f302e766cfc70bfb929 100644 (file)
@@ -302,7 +302,7 @@ static int lm77_detect(struct i2c_client *client, struct i2c_board_info *info)
         || i2c_smbus_read_word_data(client, 7) != min)
                return -ENODEV;
 
-       strlcpy(info->type, "lm77", I2C_NAME_SIZE);
+       strscpy(info->type, "lm77", I2C_NAME_SIZE);
 
        return 0;
 }
index 5e129cbec1cbbd90948c08ce87891a8ad0525054..694e171cab7f02700d8b741b247e4ec1681ebafc 100644 (file)
@@ -617,7 +617,7 @@ static int lm78_i2c_detect(struct i2c_client *client,
        if (isa)
                mutex_unlock(&isa->update_lock);
 
-       strlcpy(info->type, client_name, I2C_NAME_SIZE);
+       strscpy(info->type, client_name, I2C_NAME_SIZE);
 
        return 0;
 
index e85e062bbf327dbca2d4e41225cd1515e99b17bd..35db0b97f9128b174ec9ef7c7866fe445e893774 100644 (file)
@@ -586,7 +586,7 @@ static int lm80_detect(struct i2c_client *client, struct i2c_board_info *info)
                name = "lm80";
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 905f5689f9074df702352e6507016b24893deaad..616449f2cc504367fc98a2e12b44e24a3daf660e 100644 (file)
@@ -412,7 +412,7 @@ static int lm83_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 88cf2012d34b415911f673b14d3dc97b31f05cb1..8d33c24847553459ccd6e20c6b8bd5c37cfbbb92 100644 (file)
@@ -1539,7 +1539,7 @@ static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info)
        if (!type_name)
                return -ENODEV;
 
-       strlcpy(info->type, type_name, I2C_NAME_SIZE);
+       strscpy(info->type, type_name, I2C_NAME_SIZE);
 
        return 0;
 }
index 1750bc588856c22011012cb07c325d05d4b77e11..818fb619524572ba4f167b312401123f115eb1c7 100644 (file)
@@ -833,7 +833,7 @@ static int lm87_detect(struct i2c_client *client, struct i2c_board_info *info)
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 221de01a327aa5c8b99273442ef520754447191f..c151c0bf43f25250ebd03ef7c486b7b85429119c 100644 (file)
@@ -2547,7 +2547,7 @@ static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info)
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
 
        return 0;
 }
index 5bae6eedcaf1f8c0f426c4e2d4c3bbac3248a331..2ff3044a677d896acc7b3b0c17994562f5d14cb1 100644 (file)
@@ -287,7 +287,7 @@ static int lm92_detect(struct i2c_client *new_client,
        else
                return -ENODEV;
 
-       strlcpy(info->type, "lm92", I2C_NAME_SIZE);
+       strscpy(info->type, "lm92", I2C_NAME_SIZE);
 
        return 0;
 }
index dc67bf954b2164573b920374ed497703a1a481b8..4cf50d5f4f5949e90145f7818ef6cf8caac34550 100644 (file)
@@ -2575,7 +2575,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
        dev_dbg(&adapter->dev, "loading %s at %d, 0x%02x\n",
                client->name, i2c_adapter_id(client->adapter),
                client->addr);
index ac169a994ae007d3fc1b433af72de5ce9ac0be7e..b4a9d0c223c4a1a1d119935ed76bb5e1489e37ad 100644 (file)
@@ -644,7 +644,7 @@ static int lm95234_detect(struct i2c_client *client,
        if (val & model_mask)
                return -ENODEV;
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
        return 0;
 }
 
index 8ea46ff20be5fac7f28fde75da56b412af667560..f1ed777a87353ccd5bea8fac6c2a9ade0410b28e 100644 (file)
@@ -389,7 +389,7 @@ static int lm95241_detect(struct i2c_client *new_client,
        }
 
        /* Fill the i2c board info */
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
        return 0;
 }
 
index 29388fcf5f74d64617acaeb649dbe42a98e59af9..c433f0af2d3185fefca94430e1f74123eef1e92f 100644 (file)
@@ -461,7 +461,7 @@ static int lm95245_detect(struct i2c_client *new_client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name, I2C_NAME_SIZE);
        return 0;
 }
 
index eae9e68027bcbe7085a1cef803a746c79e8405b2..445c77197f69f12097c521e14396a6a6bc1e8ecb 100644 (file)
@@ -241,7 +241,7 @@ static int max1619_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "max1619", I2C_NAME_SIZE);
+       strscpy(info->type, "max1619", I2C_NAME_SIZE);
 
        return 0;
 }
index 78688e6cb87d99be3094df1933c52b675e421706..9f748973d6a371d62aa15ead2b38e4afc911b36e 100644 (file)
@@ -386,7 +386,7 @@ static int max1668_detect(struct i2c_client *client,
        if (!type_name)
                return -ENODEV;
 
-       strlcpy(info->type, type_name, I2C_NAME_SIZE);
+       strscpy(info->type, type_name, I2C_NAME_SIZE);
 
        return 0;
 }
index 23598b8b879343e80cd9b098a21fd0420d7dc6c7..9bdff881f59c36703b2c51684a52a43baaf74484 100644 (file)
@@ -399,7 +399,7 @@ static int max31730_detect(struct i2c_client *client,
                        return -ENODEV;
        }
 
-       strlcpy(info->type, "max31730", I2C_NAME_SIZE);
+       strscpy(info->type, "max31730", I2C_NAME_SIZE);
 
        return 0;
 }
index 14bb7726f8d7e18582e4404323851bc43a498a0a..936861131d74077d52729798ed11b3d106fe7891 100644 (file)
@@ -514,7 +514,7 @@ static int max6639_detect(struct i2c_client *client,
        if (dev_id != 0x58 || manu_id != 0x4D)
                return -ENODEV;
 
-       strlcpy(info->type, "max6639", I2C_NAME_SIZE);
+       strscpy(info->type, "max6639", I2C_NAME_SIZE);
 
        return 0;
 }
index 699d265aae2e718d1fc40b50cad33cb645872124..47ea34ff78f3d1a5a677595e702158dfd585b8cc 100644 (file)
@@ -148,7 +148,7 @@ static int max6642_detect(struct i2c_client *client,
        if ((reg_status & 0x2b) != 0x00)
                return -ENODEV;
 
-       strlcpy(info->type, "max6642", I2C_NAME_SIZE);
+       strscpy(info->type, "max6642", I2C_NAME_SIZE);
 
        return 0;
 }
index d1eeef02b6dc8375ee7a3f818f6e6eff37588ed0..a175f8283695e459ff52fd679a0054748275b35f 100644 (file)
@@ -1038,7 +1038,7 @@ static int nct7802_detect(struct i2c_client *client,
        if (reg < 0 || (reg & 0x3f))
                return -ENODEV;
 
-       strlcpy(info->type, "nct7802", I2C_NAME_SIZE);
+       strscpy(info->type, "nct7802", I2C_NAME_SIZE);
        return 0;
 }
 
index b1c837fc407af9bdb2175fe496b6aa46cea9eca1..ecc5db0011a3e40d8e2f3024730371e2a8e14d1a 100644 (file)
@@ -798,7 +798,7 @@ static int nct7904_detect(struct i2c_client *client,
            (i2c_smbus_read_byte_data(client, BANK_SEL_REG) & 0xf8) != 0x00)
                return -ENODEV;
 
-       strlcpy(info->type, "nct7904", I2C_NAME_SIZE);
+       strscpy(info->type, "nct7904", I2C_NAME_SIZE);
 
        return 0;
 }
index a5db15c087ae1b8d0da37778f90a8cf4b059d97b..70d2152234e210700cbe32b67f767d43dd631b77 100644 (file)
@@ -582,7 +582,7 @@ static int smsc47m192_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "smsc47m192", I2C_NAME_SIZE);
+       strscpy(info->type, "smsc47m192", I2C_NAME_SIZE);
 
        return 0;
 }
index 0ed28408aa077c3ed20133d2087e31fd5f28fba8..2f67c6747eadbf4f80a029c77dcf1ef1a57f06e5 100644 (file)
@@ -692,7 +692,7 @@ static int stts751_detect(struct i2c_client *new_client,
        }
        dev_dbg(&new_client->dev, "Chip %s detected", name);
 
-       strlcpy(info->type, stts751_id[0].name, I2C_NAME_SIZE);
+       strscpy(info->type, stts751_id[0].name, I2C_NAME_SIZE);
        return 0;
 }
 
index 6a804f5036f4774fb28105ca6cf300df69edf9c6..81cdb012993caca0ce4072e9aa7043bad390ea81 100644 (file)
@@ -352,7 +352,7 @@ static int thmc50_detect(struct i2c_client *client,
        pr_debug("thmc50: Detected %s (version %x, revision %x)\n",
                 type_name, (revision >> 4) - 0xc, revision & 0xf);
 
-       strlcpy(info->type, type_name, I2C_NAME_SIZE);
+       strscpy(info->type, type_name, I2C_NAME_SIZE);
 
        return 0;
 }
index cc0a1c219b1f962bfb16fa227d45e4e83673f305..f358ba67962675352fae9cfa3daa024dac4b8453 100644 (file)
@@ -671,7 +671,7 @@ static int tmp401_detect(struct i2c_client *client,
        if (reg > 15)
                return -ENODEV;
 
-       strlcpy(info->type, tmp401_id[kind].name, I2C_NAME_SIZE);
+       strscpy(info->type, tmp401_id[kind].name, I2C_NAME_SIZE);
 
        return 0;
 }
index 1fd8d41d90c84a76c7d6467d3f75c52f85c6941a..45fd7fb5ee01f5c688d5b80d8922ef0353de0e9b 100644 (file)
@@ -353,7 +353,7 @@ static int tmp421_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, tmp421_id[kind].name, I2C_NAME_SIZE);
+       strscpy(info->type, tmp421_id[kind].name, I2C_NAME_SIZE);
        dev_info(&adapter->dev, "Detected TI %s chip at 0x%02x\n",
                 names[kind], client->addr);
 
index b3579721265f7529d8823ac74a98396600db3d7d..35a847dfce68356888c50e5a5e28eeddba2e97da 100644 (file)
@@ -1171,7 +1171,7 @@ w83781d_detect(struct i2c_client *client, struct i2c_board_info *info)
        if (isa)
                mutex_unlock(&isa->update_lock);
 
-       strlcpy(info->type, client_name, I2C_NAME_SIZE);
+       strscpy(info->type, client_name, I2C_NAME_SIZE);
 
        return 0;
 
index 80a9a78d7ce98a52a1791d4b95c67578b30af235..85ea408e28d1267763d6af6ae9581f726ae59e7a 100644 (file)
@@ -1333,7 +1333,7 @@ static int w83791d_detect(struct i2c_client *client,
        if (val1 != 0x71 || val2 != 0x5c)
                return -ENODEV;
 
-       strlcpy(info->type, "w83791d", I2C_NAME_SIZE);
+       strscpy(info->type, "w83791d", I2C_NAME_SIZE);
 
        return 0;
 }
index 31a1cdc308779ac1288813b4266a6fbb9c22bfd4..2c766a9209dae8e8139dff272b3b751c18acde15 100644 (file)
@@ -1346,7 +1346,7 @@ w83792d_detect(struct i2c_client *client, struct i2c_board_info *info)
        if (val1 != 0x7a || val2 != 0x5c)
                return -ENODEV;
 
-       strlcpy(info->type, "w83792d", I2C_NAME_SIZE);
+       strscpy(info->type, "w83792d", I2C_NAME_SIZE);
 
        return 0;
 }
index 0a65d164c8f094847f3042da81a479e5e20bc2c2..0c59162a7bf510f6945a9adaeb52517e26329eee 100644 (file)
@@ -1636,7 +1636,7 @@ static int w83793_detect(struct i2c_client *client,
        if (chip_id != 0x7b)
                return -ENODEV;
 
-       strlcpy(info->type, "w83793", I2C_NAME_SIZE);
+       strscpy(info->type, "w83793", I2C_NAME_SIZE);
 
        return 0;
 }
index 45b12c4287dfafdf8b788d8d3a47271d45207f14..be5bb19e9afe8bf9a62363850e1c6372560e9d09 100644 (file)
@@ -1967,7 +1967,7 @@ static int w83795_detect(struct i2c_client *client,
        else
                chip_name = "w83795g";
 
-       strlcpy(info->type, chip_name, I2C_NAME_SIZE);
+       strscpy(info->type, chip_name, I2C_NAME_SIZE);
        dev_info(&adapter->dev, "Found %s rev. %c at 0x%02hx\n", chip_name,
                 'A' + (device_id & 0xf), address);
 
index a41f989d66e2702ffac5b86315b89991f66e9f3d..56359350fd7fa91845a532eb3a6d4f4c48a4acf1 100644 (file)
@@ -157,7 +157,7 @@ static int w83l785ts_detect(struct i2c_client *client,
                return -ENODEV;
        }
 
-       strlcpy(info->type, "w83l785ts", I2C_NAME_SIZE);
+       strscpy(info->type, "w83l785ts", I2C_NAME_SIZE);
 
        return 0;
 }
index 11ba23c1af855cbf87da0ac125e1b3de1b48e576..2c4646fa84260dc3de1c07e6bce3a67b1cb21b3a 100644 (file)
@@ -687,7 +687,7 @@ w83l786ng_detect(struct i2c_client *client, struct i2c_board_info *info)
                return -ENODEV;
        }
 
-       strlcpy(info->type, "w83l786ng", I2C_NAME_SIZE);
+       strscpy(info->type, "w83l786ng", I2C_NAME_SIZE);
 
        return 0;
 }