From patchwork Fri Sep 15 08:22:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 723191 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 0CFC4EE6442 for ; Fri, 15 Sep 2023 08:23:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C32D584C; Fri, 15 Sep 2023 10:22:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C32D584C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694766223; bh=yPmFxqa/oDREoJOGNrmiN24unhnTilxPj/agOz4qrgw=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=SXMya5ChHgANexkr5n30HwlPvDUTT/PWzV/a+jQZqZ0kBCrLxTr3tmzuBZoZMM00X qOvUADyVD6S3h22DdRZmmKN1WYmOkSL7jvP8N5k6bVFDbppqlMs63s5VubzQpTilH9 qclcjz3PuiAWaIwCy7MBeXjmJ2MVVWb0ZRP+/hCI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6152EF80552; Fri, 15 Sep 2023 10:22:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 99FB6F80425; Fri, 15 Sep 2023 10:22:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3C3DFF80425; Fri, 15 Sep 2023 10:22:20 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4CF36F8007C for ; Fri, 15 Sep 2023 10:22:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4CF36F8007C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=g7dfFFhP; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4cCPHdzd Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 88CC6218E5; Fri, 15 Sep 2023 08:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694766136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=o3S9DfckXdFYSaIFJXSrrtRWEgE8xTPJPA0wp0PmiRQ=; b=g7dfFFhPkEVMQNbmEJyRq+qBGNWqp60V6CmE3wIJDOC8+FYcB6geUkSCsf2t3oSZRbSVX1 bxIhgj8m04nbL8ThGNHIO+BNmf/Tsn+8NgvmVJOWM/fix1cjzJhXwyEsmatQe340MIz8Y+ xipENSMv2y65CGDCAXsXTl3zUpDrpwI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694766136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=o3S9DfckXdFYSaIFJXSrrtRWEgE8xTPJPA0wp0PmiRQ=; b=4cCPHdzd6iu4JAZ9K7LcbEecWNqCmKhYAdMI6SdJv6smzZDQc8XgtqtU4xhUKigDYhc7E6 e5DV4/mc69hJOsBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6BB991358A; Fri, 15 Sep 2023 08:22:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gyGJGTgUBGWHPgAAMHmgww (envelope-from ); Fri, 15 Sep 2023 08:22:16 +0000 From: Takashi Iwai To: Mark Brown Cc: alsa-devel@alsa-project.org Subject: [PATCH] ASoC: amd: ps: Fix -Wformat-truncation warning Date: Fri, 15 Sep 2023 10:22:07 +0200 Message-Id: <20230915082207.26200-1-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Message-ID-Hash: RAZZFR3SUYHO67PM4YHPZPBS3EFFD2JH X-Message-ID-Hash: RAZZFR3SUYHO67PM4YHPZPBS3EFFD2JH X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The compile warning with -Wformat-truncation at sdw_amd_scan_controller() is false-positive; the max loop size is AMD_SDW_MAX_MANAGERS (= 2), hence it fits with the given size. For suppressing the warning, replace snprintf() with scnprintf(). As stated in the above, truncation doesn't matter. Signed-off-by: Takashi Iwai --- sound/soc/amd/ps/pci-ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 4af3c3665387..7e4c0ec9e56c 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -274,7 +274,7 @@ static int sdw_amd_scan_controller(struct device *dev) dev_dbg(dev, "ACPI reports %d SoundWire Manager devices\n", count); acp_data->sdw_manager_count = count; for (index = 0; index < count; index++) { - snprintf(name, sizeof(name), "mipi-sdw-link-%d-subproperties", index); + scnprintf(name, sizeof(name), "mipi-sdw-link-%d-subproperties", index); link = fwnode_get_named_child_node(acp_data->sdw_fw_node, name); if (!link) { dev_err(dev, "Manager node %s not found\n", name);