From patchwork Mon Jan 22 16:11:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13525705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A56BC47DAF for ; Mon, 22 Jan 2024 16:12:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D54D610F573; Mon, 22 Jan 2024 16:12:53 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id D89FD10F575 for ; Mon, 22 Jan 2024 16:12:50 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 8E17DB80E6C; Mon, 22 Jan 2024 16:12:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 049F9C43390; Mon, 22 Jan 2024 16:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705939959; bh=u40yPI1eo5OCBcJ6otQkqT3GuoiQ5GJ9+8tgn1ubg/s=; h=From:To:Cc:Subject:Date:From; b=pM1dKqXL0D39T4s644c17DUpE9aVRYMCKqL2DY9cAHmf7KA70sKxHCbT6ZZhifHk7 yzdaiA8XHCVk8NfFE8lNI+/bw4f5Kt9VmTjhBII3SDeGPyxI35pctal+49+XjHn0g6 8G2/p9p3a+MinQq6vII2pli08Lf7iwTQ12+ilub5Rhu6xvMCtvk8fExWs0XhPZ+lxO j8Fuj0gl2aUeDCe34MpT+uxbmnszi6/1g40H8Y95deHzg3Yoj5u0JBT6503P133d/w Q6F74z+6A8zlqEcwa1ceG4Z9xG/cjQ61zdpKsyCsz2thqSzEepUn4i2BB31Ke9KGkf lWCPhFqKQZ2Ow== From: Arnd Bergmann To: Alyssa Rosenzweig Subject: [PATCH] drm: apple: use strscpy() in place of strlcpy() Date: Mon, 22 Jan 2024 17:11:55 +0100 Message-Id: <20240122161233.125192-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , Arnd Bergmann , Sven Peter , Janne Grunau , Hector Martin , linux-kernel@vger.kernel.org, Maxime Ripard , dri-devel@lists.freedesktop.org, Daniel Vetter , =?utf-8?q?Martin_Povi=C5=A1er?= , David Airlie Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann Since commit d26270061ae6 ("string: Remove strlcpy()"), the strlcpy() function causes a build failure. Since the return value is ignored, changing it to the strscpy() causes no change in behavior but fixes the build failure. Fixes: f237c83e4302 ("drm: apple: DCP AFK/EPIC support") Signed-off-by: Arnd Bergmann --- The apple drm driver is not in mainline linux yet, this patch is against https://github.com/AsahiLinux/linux/tree/bits/200-dcp --- drivers/gpu/drm/apple/afk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/apple/afk.c b/drivers/gpu/drm/apple/afk.c index 99d579d5ce47..9fbcd18878e8 100644 --- a/drivers/gpu/drm/apple/afk.c +++ b/drivers/gpu/drm/apple/afk.c @@ -236,7 +236,7 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel, return; } - strlcpy(name, payload, sizeof(name)); + strscpy(name, payload, sizeof(name)); /* * in DCP firmware 13.2 DCP reports interface-name as name which starts