Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rpmsg: Use strscpy() instead of strscpy_pad()

kzalloc() already zero-initializes the destination buffer, making
strscpy() sufficient for safely copying the name. The additional NUL-
padding performed by strscpy_pad() is unnecessary.

The size parameter is optional, and strscpy() automatically determines
the size of the destination buffer using sizeof() when the argument is
omitted. RPMSG_NAME_SIZE is equal to sizeof(rpdev->id.name) and can be
removed - remove it.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250429104543.66927-2-thorsten.blum@linux.dev
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Thorsten Blum and committed by
Bjorn Andersson
c8a8df49 214ae22e

+2 -2
+1 -1
drivers/rpmsg/qcom_smd.c
··· 1089 1089 1090 1090 /* Assign public information to the rpmsg_device */ 1091 1091 rpdev = &qsdev->rpdev; 1092 - strscpy_pad(rpdev->id.name, channel->name, RPMSG_NAME_SIZE); 1092 + strscpy(rpdev->id.name, channel->name); 1093 1093 rpdev->src = RPMSG_ADDR_ANY; 1094 1094 rpdev->dst = RPMSG_ADDR_ANY; 1095 1095