From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB584375F96 for ; Thu, 5 Mar 2026 10:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772705102; cv=none; b=Wf2Vi21Ukj7Z2Iqd7EKBYs+MIyXUAp9ID4WT3wt3HwO0759zYvQCKtQhwv5AfsLQQoO9aoj6cxjtK7EgH8JPQV2id1DNGNDmI/fg4XDnOarfMBEDgytkN8NyJuLiGObsPej4gIKl6a1y/ozx+TZaClvVndBrP9Ny6Zb5m5XTF+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772705102; c=relaxed/simple; bh=PK+lmcJgCr33KPHfKMa4Fj90Y6ypafAkz8NSiwaWXJ4=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=jt2HMrjhJ1heMRFOFJJSxBgd2Rfwb0CKRVS/RyFNVgB3XZJxOKrjF896LtUH0390xxv0bDqB8aQJHG0dE/DvacxxOhbt+U1/WRd74jbHUq1SO1IHMme/pgZNExiruIrIU+5yRo7R8X+F6jXjahNIyLoZL9p83VXyMbEqm02U46s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=pYHGoofg; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1SPRpQ/j; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=pYHGoofg; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=1SPRpQ/j; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="pYHGoofg"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1SPRpQ/j"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="pYHGoofg"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="1SPRpQ/j" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 2947E3F8CF; Thu, 5 Mar 2026 10:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1772705099; 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=OLLIuUupvLUHzcyOCwC+BYpKrNbpWCDU1+MQcaHm6wE=; b=pYHGoofgUf8kVSNyOQfC+9ZOBvUUzDU4LWLHTPex0+n70FIkFD2kcRKwZeE9Huo17tVn4z +Rzp3T5X06JkMsdOHviQiravM9OVyo3aPGl4qjca5qhkLbrbJGOZRjgqkwMq5Ri/G6sR9/ gLMTIm8riEjM/wGgnjd3p2V4IWUjgr8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1772705099; 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=OLLIuUupvLUHzcyOCwC+BYpKrNbpWCDU1+MQcaHm6wE=; b=1SPRpQ/jX2SqHr218sf3bYl4HKP3ouENo5AXeimOTQKsfbBSIUeEi/bqAlCMVHeT5KfRWS VpHltP5wgJPo9QCQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=pYHGoofg; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="1SPRpQ/j" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1772705099; 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=OLLIuUupvLUHzcyOCwC+BYpKrNbpWCDU1+MQcaHm6wE=; b=pYHGoofgUf8kVSNyOQfC+9ZOBvUUzDU4LWLHTPex0+n70FIkFD2kcRKwZeE9Huo17tVn4z +Rzp3T5X06JkMsdOHviQiravM9OVyo3aPGl4qjca5qhkLbrbJGOZRjgqkwMq5Ri/G6sR9/ gLMTIm8riEjM/wGgnjd3p2V4IWUjgr8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1772705099; 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=OLLIuUupvLUHzcyOCwC+BYpKrNbpWCDU1+MQcaHm6wE=; b=1SPRpQ/jX2SqHr218sf3bYl4HKP3ouENo5AXeimOTQKsfbBSIUeEi/bqAlCMVHeT5KfRWS VpHltP5wgJPo9QCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EB3723EA68; Thu, 5 Mar 2026 10:04:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id NqcBOEpVqWlIVQAAD6G6ig (envelope-from ); Thu, 05 Mar 2026 10:04:58 +0000 Date: Thu, 05 Mar 2026 11:04:58 +0100 Message-ID: <87v7fay4l1.wl-tiwai@suse.de> From: Takashi Iwai To: Maciej Strozek Cc: Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org Subject: Re: [PATCH v3 2/2] ALSA: control: add ioctl to retrieve full card components In-Reply-To: References: <20260303145815.9930-1-mstrozek@opensource.cirrus.com> <20260303145815.9930-2-mstrozek@opensource.cirrus.com> <87seagx6c4.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/30.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid] X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -3.51 X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 2947E3F8CF On Thu, 05 Mar 2026 10:54:35 +0100, Maciej Strozek wrote: > > W dniu wto, 03.03.2026 o godzinie 16∶47 +0100, użytkownik Takashi Iwai > napisał: > > > > > > + */ > > > +struct snd_ctl_card_components { > > > + int card; > > > + unsigned int length; > > > + unsigned char *components; > > > +}; > > > > And the ioctl can serve for two purposes: > > > > - When length=0 is set, the kernel stores the current number of bytes > >   and returns without copying.  User-space can use this mode for > >   allocating the buffer. > > > In alsa-lib all data must be allocated beforehand, so this length==0 > query is not very useful there, it will just go into a [512] array > anyway. Are there any other users that may benefit from this? My suggested API can work even with the fixed size 512, too, if 512 is hight enough. It's just more flexible. And there is no restriction about alsa-lib data allocation; the function can query the size then allocate, too. Takashi