WSL2-Linux-Kernel/drivers/rpmsg
Krzysztof Kozlowski d8b1b64a07 rpmsg: qcom: glink: replace strncpy() with strscpy_pad()
commit 766279a8f8 upstream.

The use of strncpy() is considered deprecated for NUL-terminated
strings[1]. Replace strncpy() with strscpy_pad(), to keep existing
pad-behavior of strncpy, similarly to commit 08de420a80 ("rpmsg:
glink: Replace strncpy() with strscpy_pad()").  This fixes W=1 warning:

  In function ‘qcom_glink_rx_close’,
    inlined from ‘qcom_glink_work’ at ../drivers/rpmsg/qcom_glink_native.c:1638:4:
  drivers/rpmsg/qcom_glink_native.c:1549:17: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
   1549 |                 strncpy(chinfo.name, channel->name, sizeof(chinfo.name));

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220519073330.7187-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Andrew Chernyakov <acherniakov@astralinux.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-12 09:53:28 +02:00
..
Kconfig rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
Makefile rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
mtk_rpmsg.c rpmsg: mtk_rpmsg: Fix circular locking dependency 2022-08-17 14:24:03 +02:00
qcom_glink_native.c rpmsg: qcom: glink: replace strncpy() with strscpy_pad() 2022-10-12 09:53:28 +02:00
qcom_glink_native.h rpmsg: glink: Switch to SPDX license identifier 2018-06-03 17:37:15 -07:00
qcom_glink_rpm.c rpmsg: glink: Switch to SPDX license identifier 2018-06-03 17:37:15 -07:00
qcom_glink_smem.c rpmsg: glink: Set tail pointer to 0 at end of FIFO 2019-10-11 11:34:12 -07:00
qcom_glink_ssr.c rpmsg: glink: add include of header file 2021-01-05 22:22:40 -06:00
qcom_smd.c rpmsg: qcom: glink: replace strncpy() with strscpy_pad() 2022-10-12 09:53:28 +02:00
rpmsg_char.c rpmsg: char: Add mutex protection for rpmsg_eptdev_open() 2022-08-17 14:24:03 +02:00
rpmsg_core.c rpmsg: core: Clean up resources on announce_create failure. 2022-01-27 11:05:06 +01:00
rpmsg_internal.h rpmsg: Make rpmsg_{register|unregister}_device() public 2020-11-24 10:11:52 -06:00
rpmsg_ns.c rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
virtio_rpmsg_bus.c rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl 2022-06-14 18:36:05 +02:00