Skip to content

Commit 4c14d7a

Browse files
Wolfram Sangmpe
authored andcommitted
macintosh: move from strlcpy with unused retval to strscpy
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. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lore.kernel.org/r/[email protected]
1 parent 14be375 commit 4c14d7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/macintosh/therm_windtunnel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ static void do_attach(struct i2c_adapter *adapter)
321321
if (np) {
322322
of_node_put(np);
323323
} else {
324-
strlcpy(info.type, "MAC,ds1775", I2C_NAME_SIZE);
324+
strscpy(info.type, "MAC,ds1775", I2C_NAME_SIZE);
325325
i2c_new_scanned_device(adapter, &info, scan_ds1775, NULL);
326326
}
327327

328328
np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,adm1030");
329329
if (np) {
330330
of_node_put(np);
331331
} else {
332-
strlcpy(info.type, "MAC,adm1030", I2C_NAME_SIZE);
332+
strscpy(info.type, "MAC,adm1030", I2C_NAME_SIZE);
333333
i2c_new_scanned_device(adapter, &info, scan_adm1030, NULL);
334334
}
335335
}

0 commit comments

Comments
 (0)