From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9074CA0EC3 for ; Tue, 12 Sep 2023 13:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235520AbjILNbe (ORCPT ); Tue, 12 Sep 2023 09:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235447AbjILNbd (ORCPT ); Tue, 12 Sep 2023 09:31:33 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F05010D0 for ; Tue, 12 Sep 2023 06:31:29 -0700 (PDT) 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 CA7DC1F45A; Tue, 12 Sep 2023 13:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694525487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QsgcKrpCBQmwIVUIkIa0mU20jeiAaYjLhhAbrQIvNAM=; b=yQvOiNTp0A3PZHjYu6gXqQ+UHmiwvE9aFTRQIflH0m3cwkmqOOFdauZEOQzfqVqn1Aa7b3 qtVyHChQCBd048K+rqtcQzaO9IBw96zvun8s2720rR4jT73HM+jbdrCikqk1Ue5APby+61 sh3xhcDK/OEDlO2df3spXOUznfPOvHw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694525487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QsgcKrpCBQmwIVUIkIa0mU20jeiAaYjLhhAbrQIvNAM=; b=dsZSMuAiQzaRzROLaJX4x1MDRmCBWp/xgSBwFWUGUa4+w9CDIf5YUVQS2squYzZZbJ5P4S jHG6DJUNowwYGFCQ== 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 8EB0F139DB; Tue, 12 Sep 2023 13:31:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WB/dIS9oAGVUOQAAMHmgww (envelope-from ); Tue, 12 Sep 2023 13:31:27 +0000 Date: Tue, 12 Sep 2023 15:31:26 +0200 Message-ID: <87zg1r5xht.wl-tiwai@suse.de> From: Takashi Iwai To: Peter Ujfalusi Cc: tiwai@suse.com, perex@perex.cz, arnd@arndb.de, masahiroy@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH] ALSA: core: Use dev_name of card_dev as debugfs directory name In-Reply-To: <20230912110113.3166-1-peter.ujfalusi@linux.intel.com> References: <20230912110113.3166-1-peter.ujfalusi@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Sep 2023 13:01:13 +0200, Peter Ujfalusi wrote: > > There is no need to use temporary string for the debugfs directory name as > we can use the device name of the card. > > This change will also fixes the following compiler warning/error (W=1): > > sound/core/init.c: In function ¡snd_card_init¢: > sound/core/init.c:367:28: error: ¡%d¢ directive writing between 1 and 10 bytes into a region of size 4 [-Werror=format-overflow=] > 367 | sprintf(name, "card%d", idx); > | ^~ > sound/core/init.c:367:23: note: directive argument in the range [0, 2147483646] > 367 | sprintf(name, "card%d", idx); > | ^~~~~~~~ > sound/core/init.c:367:9: note: ¡sprintf¢ output between 6 and 15 bytes into a destination of size 8 > 367 | sprintf(name, "card%d", idx); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > The idx is guarantied to be less than SNDRV_CARDS (max 256 or 8) by the > code in snd_card_init(), however the compiler does not see that. > > The warnings got brought to light by a recent patch upstream: > commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1") > > Suggested-by: Arnd Bergmann > Suggested-by: Takashi Iwai > Signed-off-by: Peter Ujfalusi Thanks, applied now. Takashi