Skip to content

Commit 0b0221d

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: move core from strlcpy to strscpy
Follow the advice of the below link and prefer 'strscpy'. Conversion is easy because no code used the return value. It has been done with a simple sed invocation. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent ea1558c commit 0b0221d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/i2c/i2c-core-base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf
933933
client->init_irq = i2c_dev_irq_from_resources(info->resources,
934934
info->num_resources);
935935

936-
strlcpy(client->name, info->type, sizeof(client->name));
936+
strscpy(client->name, info->type, sizeof(client->name));
937937

938938
status = i2c_check_addr_validity(client->addr, client->flags);
939939
if (status) {

drivers/i2c/i2c-smbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void i2c_register_spd(struct i2c_adapter *adap)
391391
unsigned short addr_list[2];
392392

393393
memset(&info, 0, sizeof(struct i2c_board_info));
394-
strlcpy(info.type, name, I2C_NAME_SIZE);
394+
strscpy(info.type, name, I2C_NAME_SIZE);
395395
addr_list[0] = 0x50 + n;
396396
addr_list[1] = I2C_CLIENT_END;
397397

0 commit comments

Comments
 (0)