summaryrefslogtreecommitdiffstats
path: root/Documentation/hid
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 22:08:49 +0200
commit220ee02a0b38726a90430e94714c87550dc3d476 (patch)
treed757901fe1d8644d050a3c8afda801b8f75795d9 /Documentation/hid
parentlib: list_sort.c: add a blank line to avoid kernel-doc warnings (diff)
downloadlinux-220ee02a0b38726a90430e94714c87550dc3d476.tar.xz
linux-220ee02a0b38726a90430e94714c87550dc3d476.zip
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/hid')
-rw-r--r--Documentation/hid/hid-transport.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/hid/hid-transport.txt b/Documentation/hid/hid-transport.txt
index 3dcba9fd4a3a..4f41d67f1b4b 100644
--- a/Documentation/hid/hid-transport.txt
+++ b/Documentation/hid/hid-transport.txt
@@ -194,9 +194,9 @@ with HID core:
goto err_<...>;
}
- strlcpy(hid->name, <device-name-src>, 127);
- strlcpy(hid->phys, <device-phys-src>, 63);
- strlcpy(hid->uniq, <device-uniq-src>, 63);
+ strscpy(hid->name, <device-name-src>, sizeof(hid->name));
+ strscpy(hid->phys, <device-phys-src>, sizeof(hid->phys));
+ strscpy(hid->uniq, <device-uniq-src>, sizeof(hid->uniq));
hid->ll_driver = &custom_ll_driver;
hid->bus = <device-bus>;