Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2905599rdb; Tue, 12 Sep 2023 16:29:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5YAsB3CZe9ch4x4PJW+GhgM/cAjidfwg31EuOvrSBnSqDXX3KYlo3EVGMuKq3GZzgv5Y7 X-Received: by 2002:a05:6a00:2da0:b0:68e:2bba:b5fe with SMTP id fb32-20020a056a002da000b0068e2bbab5femr1281303pfb.0.1694561370680; Tue, 12 Sep 2023 16:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694561370; cv=none; d=google.com; s=arc-20160816; b=aq4wRm4uDBlWC74jttFfl6T48WIU4zw/M9/g+p4SigaQoFRkp+IO69gjAXvad9BsYD 5bYisuKaLNh7j/+AWz9SZ2sfWbi0fVSO0mwtFVRbV7zd6n1ZczumQzExrFaliiGDqWhu SyX6CECcEZy07Fs41AZ3PlIw4y+rGw9n4SYYvkGWN5QXGdRJj4pztUCPoRDMZT0JBaFa 3X4shrMJeEw02nnPk5KQ5l5sj1vJLWf0yzo+wueYzYGqLW1Ju14Lk1pabP7pQEEwo4e6 Ky0sizExKxG7dd5izuliewj5nDQtiR6GCFU6c3QTBZAxCgLOGv/xfTBzX2P6MEO4WieV RLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=AaRVvFPfI2bzRIL7hx+q18RtZvZUqfDW3vPfBd146jo=; fh=OukbCN6SAkcYsg9D1RXX6w3ozquH3aXq2otVgZ1RgHU=; b=jaYsH2YRGtImQWK/6KtqzEzAEukF90V8E7QStt8MclE3c+DAWHg8Pn17f1aQOiXfr/ DuoJMMAE5FptNWrjb15YK/e12cl2Ce/RWP8tHuDHhZuQc+KBLOoXW8B7D+yKjAJZpIZW dPgPCoUJ06IrdbdzQdIQ0BhRIRKFJ91B+tV3JdFXPqxTRLakwwBR8OKO7xP7tTKClUT3 WIJxtCYZp2HNHeM0IXncRZHgy/Ge8WKE3fc31kn9M5AVP7NwtgMtpVDrjsD4uijOEkhh IauquGZUTmYUiwKf+J6TPaDK1ZW+CKyyWHzsoWtpPOUibFv9o7Iy/F7s3VgB+IX2OLDz A/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=s0OjQwH0; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=1v72ewXb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cu14-20020a056a00448e00b0068fdb060072si2913228pfb.341.2023.09.12.16.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 16:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=s0OjQwH0; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=1v72ewXb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 72CBC826EBBC; Tue, 12 Sep 2023 03:18:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233992AbjILKSi (ORCPT + 99 others); Tue, 12 Sep 2023 06:18:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233975AbjILKSe (ORCPT ); Tue, 12 Sep 2023 06:18:34 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE2CCC3 for ; Tue, 12 Sep 2023 03:18:30 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 1A1E832009AC; Tue, 12 Sep 2023 06:18:27 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 12 Sep 2023 06:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1694513906; x=1694600306; bh=Aa RVvFPfI2bzRIL7hx+q18RtZvZUqfDW3vPfBd146jo=; b=s0OjQwH0jz+h05xwLU jRPvLnJBhKvPubR4at6NcFOEXKZan+jJs7Erwy9WgjvsrNTmuqV23/QIR1IYEXuG bfyXoCiVog+CsCYKVXLnqYAC01xrz9IR1UQ05tks1JhrZACKpfbGBg9uTqmgEi/H qGLBPGGRq6x52RU+SViSUN9KEvZuKKdyUZDpsv0Th60wFExdxeTJ3pPzbbWohUnw d4Glq/UBx66n+TncGg3rf7hJcRvbC7t3TrX1vpJEp3NOsBNAqNRJ0wKUzbv/NPkA a/JAdoXGXHsZIJ6cN4M3GAsxokXsJZp0ou/oa90e9E4F0VpKPtaFsoI3SHx9xZjb NyPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1694513906; x=1694600306; bh=AaRVvFPfI2bzR IL7hx+q18RtZvZUqfDW3vPfBd146jo=; b=1v72ewXb4csmUt0GGYqoutngHVH8c ItPxAG8lBFcR6DRAEkDlrQrBNdXFvvNXEaxlUMCnI3ViNQiYYrraZrKI/BZkgYyy 8GoOTgiEtO7JaFWljLLUwHzlc4AIkxZu+SxG7SwnMJQr1PklbHHVTzra/qL2akcU 6abgBc8KK5xfnNRd/DguVKNMyn0zePrisiJCBCAuWMGjJH6BF/lo+Hw6hh6a6F/1 D6EQOQUhZJ+eZgr3Tk+vMBo8rFBu4gtdFQaFDxDfvI56P6gryvKzXi2mUrWZoIG2 ux7PmnUz/4GyI/aZI+NKiFFoHuDT+gvplEjhLUu9qwWTVbPpEbMXKJ5Yg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeiiedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id F02E5B60089; Tue, 12 Sep 2023 06:18:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-745-g95dd7bea33-fm-20230905.001-g95dd7bea Mime-Version: 1.0 Message-Id: <96c5309d-bb06-486e-a1f8-e3d71b275f13@app.fastmail.com> In-Reply-To: <20230912083910.15994-1-peter.ujfalusi@linux.intel.com> References: <20230912083910.15994-1-peter.ujfalusi@linux.intel.com> Date: Tue, 12 Sep 2023 12:18:04 +0200 From: "Arnd Bergmann" To: "Peter Ujfalusi" , tiwai@suse.com, "Jaroslav Kysela" Cc: "Masahiro Yamada" , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH] ALSA: core: Increase the name array size for debugfs directory name Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:18:41 -0700 (PDT) On Tue, Sep 12, 2023, at 10:39, Peter Ujfalusi wrote: > While the code is correct, we need to silence the compiler somehow. > It could be done by limiting the range in sprintf like > sprintf(name, "card%d", idx % SNDRV_CARDS); > sprintf(name, "card%hhd", idx); > etc > > These are too workaroundish. Increase the name array to 15 instead which > looks better and only adds 7 bytes on stack. It looks like we use the same string for kobject_set_name(), so maybe this would work as well: --- a/sound/core/init.c +++ b/sound/core/init.c @@ -278,9 +278,6 @@ static int snd_card_init(struct snd_card *card, struct device *parent, size_t extra_size) { int err; -#ifdef CONFIG_SND_DEBUG - char name[8]; -#endif if (extra_size > 0) card->private_data = (char *)card + sizeof(struct snd_card); @@ -364,8 +361,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent, } #ifdef CONFIG_SND_DEBUG - sprintf(name, "card%d", idx); - card->debugfs_root = debugfs_create_dir(name, sound_debugfs_root); + card->debugfs_root = debugfs_create_dir(kobject_name(&card->card_dev.kobj), + sound_debugfs_root); #endif return 0; Arnd