From patchwork Fri Sep 15 08:27:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 723984 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 F05DDEE643D for ; Fri, 15 Sep 2023 08:29:39 +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 48A8C206; Fri, 15 Sep 2023 10:28:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 48A8C206 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694766577; bh=yG+VpIY7wdPHAu3FPDRZEyR1zG2xDN+YQQnSl35mbgU=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=SfWaW7uwfhV9YEQU4kO2RZ9BYfBmfzlzRzd62LJiXo+VXKKniHF1cneeEviRidGjL 3+gc3VframCDq51FgjxWDgL9eMGbnpHUtUlCQCml8o89cHV4SBPbV3zkaFKBw7Z0em Rb3+mG6zpercwrmNdvzpvqWUFusdsizyPChm8C9M= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE58FF80568; Fri, 15 Sep 2023 10:28:17 +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 3BE29F80558; Fri, 15 Sep 2023 10:28:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF307F80567; Fri, 15 Sep 2023 10:28:12 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (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 0EF0CF80551 for ; Fri, 15 Sep 2023 10:28:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0EF0CF80551 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=MAsImQrD; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=XJvXnRvj 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-out2.suse.de (Postfix) with ESMTPS id 058641F854; Fri, 15 Sep 2023 08:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694766487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ynXYPd2uD0C5NDK4NdLWI9mGj1vcafvL56YCrd5YFpA=; b=MAsImQrDy7HJc4TZaBtasv0T/yXl/vNBao5X5NQ5YSN2a0Lw0qTQi1FjJTmmUFQrYxE8B7 BXPxqoXV0FESWnkYhaknM+9H0L9xiH55HNBcMRlmjzPhHaWiLpDdPegJyFbtoVPeNzBPtS 9dsBN0I6MGj0n51a9iTky7q8Z1B1U/k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694766487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ynXYPd2uD0C5NDK4NdLWI9mGj1vcafvL56YCrd5YFpA=; b=XJvXnRvjQBH9DQWsGQSH1XbEUkkWlLxqy/qC+a321rPvhMfsdzNftj/9lMvJDutpWqN03y Jslov75+BEoT2fBQ== 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 DACBE13A34; Fri, 15 Sep 2023 08:28:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UKKDNJYVBGVfQQAAMHmgww (envelope-from ); Fri, 15 Sep 2023 08:28:06 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH 04/13] ALSA: caiaq: Fix -Wformat-truncation warning Date: Fri, 15 Sep 2023 10:27:53 +0200 Message-Id: <20230915082802.28684-5-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230915082802.28684-1-tiwai@suse.de> References: <20230915082802.28684-1-tiwai@suse.de> MIME-Version: 1.0 Message-ID-Hash: HP45GJBBSLCQT5DDP7CUTKRPM2XM5E2F X-Message-ID-Hash: HP45GJBBSLCQT5DDP7CUTKRPM2XM5E2F 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 filling of card->longname can be gracefully truncated, as it's only informative. Use scnprintf() and suppress the superfluous compile warning with -Wformat-truncation. Signed-off-by: Takashi Iwai --- sound/usb/caiaq/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 49f63f878e6f..b5cbf1f195c4 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c @@ -485,7 +485,7 @@ static int init_card(struct snd_usb_caiaqdev *cdev) } usb_make_path(usb_dev, usbpath, sizeof(usbpath)); - snprintf(card->longname, sizeof(card->longname), "%s %s (%s)", + scnprintf(card->longname, sizeof(card->longname), "%s %s (%s)", cdev->vendor_name, cdev->product_name, usbpath); setup_card(cdev);