From: Thorsten Blum Date: Sat, 18 Oct 2025 10:51:45 +0000 (+0200) Subject: ata: pata_it821x: Replace deprecated strcpy with strscpy in it821x_display_disk X-Git-Tag: v6.19-rc1~128^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ea303d9e9862ff8bd3707f67b267646b8ffd3ec;p=thirdparty%2Flinux.git ata: pata_it821x: Replace deprecated strcpy with strscpy in it821x_display_disk strcpy() is deprecated; use strscpy() instead. Replace the hard-coded buffer size 8 with sizeof(mbuf) when using snprintf() while we're at it. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel --- diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 042f6ad1f7c69..fc762dcc61bfd 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -632,9 +633,9 @@ static void it821x_display_disk(struct ata_port *ap, int n, u8 *buf) cbl = ""; if (mode) - snprintf(mbuf, 8, "%5s%d", mtype, mode - 1); + snprintf(mbuf, sizeof(mbuf), "%5s%d", mtype, mode - 1); else - strcpy(mbuf, "PIO"); + strscpy(mbuf, "PIO"); if (buf[52] == 4) ata_port_info(ap, "%d: %-6s %-8s %s %s\n", n, mbuf, types[buf[52]], id, cbl);