summaryrefslogtreecommitdiff
path: root/Documentation/i2c/instantiating-devices
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2019-06-13 18:25:48 +0200
committerJonathan Corbet <corbet@lwn.net>2019-06-20 14:08:49 -0600
commit220ee02a0b38726a90430e94714c87550dc3d476 (patch)
treed757901fe1d8644d050a3c8afda801b8f75795d9 /Documentation/i2c/instantiating-devices
parent4ae5b8f2140d18788979153370c83cf925092b5c (diff)
downloadlinux-next-220ee02a0b38726a90430e94714c87550dc3d476.tar.gz
docs: stop suggesting strlcpy
Since strlcpy is deprecated, the documentation shouldn't suggest using it. This patch fixes the examples to use strscpy instead. It also uses sizeof instead of underlying constants as far as possible, to simplify future changes to the corresponding data structures. Signed-off-by: Stephen Kitt <steve@sk2.org> Acked-by: Kees Cook <keescook@chromium.org> Acked-by: Federico Vaga <federico.vaga@vaga.pv.it> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/i2c/instantiating-devices')
-rw-r--r--Documentation/i2c/instantiating-devices2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index 5a3e2f331e8c..345e9ea8281a 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -137,7 +137,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev)
(...)
i2c_adap = i2c_get_adapter(2);
memset(&i2c_info, 0, sizeof(struct i2c_board_info));
- strlcpy(i2c_info.type, "isp1301_nxp", I2C_NAME_SIZE);
+ strscpy(i2c_info.type, "isp1301_nxp", sizeof(i2c_info.type));
isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
normal_i2c, NULL);
i2c_put_adapter(i2c_adap);