From patchwork Mon Jun 17 10:05:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13700461 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 2285A188CD0 for ; Mon, 17 Jun 2024 10:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618707; cv=none; b=CbrMkB0xYFk7KH6Hrx5E75yiXMB37dz3avbG6YCJy+UmER6MeCR+t3kv9KLOltWjaPUPfd+C8Tnzb3AIsMsilYNkJl4uoOLQi0FWjJZSRlYdQHe+MR2QCJ3NnmnRcGl+fUDZawLvhcmLq6er+C+oyKWuqmes+EPWp62v29gyEE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618707; c=relaxed/simple; bh=g+WLk0RxS2EMN89vGbWXtSgiG7lvPqlCfBroFDzC+t8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SgOMtuURjOy0sCRPysshdz6LWujOzu5m5wzGsOE4UI9S5cC/3QkDhQtHJzDzsuM3W8Jie+K5uUPEAcoT24I14pyILzyDPvvvBcesJHNtLC2drsbtfNXbi3e8XAauKzqm+I1ACYxnd+zTqUZSp83AOCwF7VF/dTNOPhKb5hlqw/c= 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=LbUWT9BE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=s8sPyYam; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=LbUWT9BE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=s8sPyYam; arc=none smtp.client-ip=195.135.223.131 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="LbUWT9BE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="s8sPyYam"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="LbUWT9BE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="s8sPyYam" Received: from imap1.dmz-prg2.suse.org (unknown [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-out2.suse.de (Postfix) with ESMTPS id 755625FE6C; Mon, 17 Jun 2024 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=wWzN4pkCW6pGExmpRwFdiKxFYEVrUUKYdKert3dyulA=; b=LbUWT9BE0H3GYq7SRZC6lxCnLlD+d9moGJVUZ713RKW33/SgWKaeFA+i23U7UN3dlTRoOF AoP/K3pMiGbVIPr49+grV5QZ6vldsO4FmePz7NYrSv72b2X/DXBu4V7yPK4G8ayhlDd5hl 0kprEdeTiZTnl1J6hidP7osQd3lAU4E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=wWzN4pkCW6pGExmpRwFdiKxFYEVrUUKYdKert3dyulA=; b=s8sPyYamXYBSF7d1Rj4UQiH3l2LnaiRMAJyg4qnZGFyC5mNCu80OX5JnvIuaR0xiKSH0vq zgUGc/xmIBGJORBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=wWzN4pkCW6pGExmpRwFdiKxFYEVrUUKYdKert3dyulA=; b=LbUWT9BE0H3GYq7SRZC6lxCnLlD+d9moGJVUZ713RKW33/SgWKaeFA+i23U7UN3dlTRoOF AoP/K3pMiGbVIPr49+grV5QZ6vldsO4FmePz7NYrSv72b2X/DXBu4V7yPK4G8ayhlDd5hl 0kprEdeTiZTnl1J6hidP7osQd3lAU4E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=wWzN4pkCW6pGExmpRwFdiKxFYEVrUUKYdKert3dyulA=; b=s8sPyYamXYBSF7d1Rj4UQiH3l2LnaiRMAJyg4qnZGFyC5mNCu80OX5JnvIuaR0xiKSH0vq zgUGc/xmIBGJORBA== 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 5968313AAF; Mon, 17 Jun 2024 10:05:04 +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 iGjiE1AKcGYfAgAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 10:05:04 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 1/5] ALSA: control: Allow NULL passed to snd_ctl_remove() Date: Mon, 17 Jun 2024 12:05:23 +0200 Message-ID: <20240617100529.6667-2-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617100529.6667-1-tiwai@suse.de> References: <20240617100529.6667-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; URIBL_BLOCKED(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: There are lots of code checking NULL for kcontrol passed to snd_ctl_remove() in the caller side. Let's make snd_ctl_remove() accepting the NULL kcontrol instead a la free(), so that we can clean up the caller side. Signed-off-by: Takashi Iwai --- sound/core/control.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/core/control.c b/sound/core/control.c index fb0c60044f7b..7f0999d1671e 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -604,6 +604,7 @@ static inline int snd_ctl_remove_locked(struct snd_card *card, * * Removes the control from the card and then releases the instance. * You don't need to call snd_ctl_free_one(). + * Passing NULL to @kcontrol argument is allowed as noop. * * Return: 0 if successful, or a negative error code on failure. * @@ -611,6 +612,8 @@ static inline int snd_ctl_remove_locked(struct snd_card *card, */ int snd_ctl_remove(struct snd_card *card, struct snd_kcontrol *kcontrol) { + if (!kcontrol) + return 0; guard(rwsem_write)(&card->controls_rwsem); return snd_ctl_remove_locked(card, kcontrol); } From patchwork Mon Jun 17 10:05:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13700462 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 45D8818FDAE for ; Mon, 17 Jun 2024 10:05:06 +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=1718618707; cv=none; b=RxU09NhUsm51c5OhNYlmomnBFmm6sAqXpAEMm/EuIuW7HHoXp5FyXztplu+YAldun7gCvRnteHZCur7azLd9SXtYd4EO5iM6Mr6YPUHCbRojnmgFSj5RkvHgFGJIXnQ8KM2F2NGA4H5Kg1zshc0pG+iTESY7iIF/TJxETpqjKhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618707; c=relaxed/simple; bh=25Iuf5SCWi2roC2jKlT6qLg2k1w/hOk/X4xbN1Yd+Ek=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jZjiFGJRCZVB3AcOyYtLDhY18tg6YJXqCzboSznJncIEJ4TNAtN/B6enHamSOoKJhfpFjSDKFnIcOp8qGb1jWO5HtzDUjXDn6m3cr/+DxU+ag5waDeMYs+jENgv4m1t/j7X5RREEV+JHntJ02RemzjK9bhbvlGlbg1DmkEKfrg4= 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=r19x+qZm; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tkw2hPf4; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=r19x+qZm; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tkw2hPf4; 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="r19x+qZm"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tkw2hPf4"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="r19x+qZm"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tkw2hPf4" 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 9C98537FCD; Mon, 17 Jun 2024 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=ATFjaMa14uwYey0BBiN1F4g6bXEYhtMLwkCf9tpMg4Q=; b=r19x+qZmUIlb5OeByKp89WvD2JfCVvRc6ZHHGwXSWkWDr3PPWGsFVvhY/UyH4ZapObYsh2 6E7/H7o6mIcPiFml8nc9ixiALNMEhlcN4SodaS9/8OR+A3GSk0jcychYF4nBYUpPVklMx3 Aozng/9j5mB9n3dOb78IK/plLm1rVgU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=ATFjaMa14uwYey0BBiN1F4g6bXEYhtMLwkCf9tpMg4Q=; b=tkw2hPf4uQfFQolrsZxM06AJej1ETMWnTnrK0jxIGhoPNJ/oGjk/cvHLyD5AOz4kODaNdt nHPfwvttbqjcuFCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=r19x+qZm; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tkw2hPf4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=ATFjaMa14uwYey0BBiN1F4g6bXEYhtMLwkCf9tpMg4Q=; b=r19x+qZmUIlb5OeByKp89WvD2JfCVvRc6ZHHGwXSWkWDr3PPWGsFVvhY/UyH4ZapObYsh2 6E7/H7o6mIcPiFml8nc9ixiALNMEhlcN4SodaS9/8OR+A3GSk0jcychYF4nBYUpPVklMx3 Aozng/9j5mB9n3dOb78IK/plLm1rVgU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=ATFjaMa14uwYey0BBiN1F4g6bXEYhtMLwkCf9tpMg4Q=; b=tkw2hPf4uQfFQolrsZxM06AJej1ETMWnTnrK0jxIGhoPNJ/oGjk/cvHLyD5AOz4kODaNdt nHPfwvttbqjcuFCg== 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 7B5A913AC0; Mon, 17 Jun 2024 10:05:04 +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 GIrhHFAKcGYfAgAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 10:05:04 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 2/5] ALSA: sb: Drop NULL check for snd_ctl_remove() Date: Mon, 17 Jun 2024 12:05:24 +0200 Message-ID: <20240617100529.6667-3-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617100529.6667-1-tiwai@suse.de> References: <20240617100529.6667-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 9C98537FCD X-Spam-Score: -3.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can drop the check in the caller side. Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000.c | 6 ++---- sound/isa/sb/sb16_csp.c | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index a6405772d537..af478c36ce5b 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -1039,10 +1039,8 @@ snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu) return 0; __error: - for (i = 0; i < EMU8000_NUM_CONTROLS; i++) { - if (emu->controls[i]) - snd_ctl_remove(card, emu->controls[i]); - } + for (i = 0; i < EMU8000_NUM_CONTROLS; i++) + snd_ctl_remove(card, emu->controls[i]); return err; } diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c index 8d8357019719..fdb992733bde 100644 --- a/sound/isa/sb/sb16_csp.c +++ b/sound/isa/sb/sb16_csp.c @@ -1080,14 +1080,10 @@ static void snd_sb_qsound_destroy(struct snd_sb_csp * p) card = p->chip->card; - if (p->qsound_switch) { - snd_ctl_remove(card, p->qsound_switch); - p->qsound_switch = NULL; - } - if (p->qsound_space) { - snd_ctl_remove(card, p->qsound_space); - p->qsound_space = NULL; - } + snd_ctl_remove(card, p->qsound_switch); + p->qsound_switch = NULL; + snd_ctl_remove(card, p->qsound_space); + p->qsound_space = NULL; /* cancel pending transfer of QSound parameters */ spin_lock_irqsave (&p->q_lock, flags); From patchwork Mon Jun 17 10:05:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13700463 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 7B48F19047F for ; Mon, 17 Jun 2024 10:05:06 +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=1718618707; cv=none; b=H+/J1ZyzvSxpvqbw63wUN2vp4tcCJN1cXuNztyzkz8pnbAAOsQTmcjhWcbbq3kmdbDX+Q3d6ElbyIsZTs0dVpbChg3HHI1JM6jDJ1fyP8GkcK+LeswMknTrGuVjXuci6US+NfcPDodSJpH79KvMcegTtlftsn+Xhv5lUFN/jZNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618707; c=relaxed/simple; bh=rOGJN3dEEeXhfh9VRmegir8SjBGFmJOwvGPAJ2OxRts=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gne834cPPnXdYoQp0KMEhz66+VjJODIc5zFFb+ceE+OhoKn9oSz4ruMXMlts1POBODjdNQAYQ0dYRPWXAs6+KGjbHQYSztHzsx9hHj47ToInHN8/BReDoDEX5252M/gDo8F4tHTvC1r8HbB/H5UUhvFXrtKHlvyC24eoLCdrXf8= 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=0Y3MBDx8; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/LllwXAL; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=0Y3MBDx8; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/LllwXAL; 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="0Y3MBDx8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/LllwXAL"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="0Y3MBDx8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/LllwXAL" 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 B878537FCE; Mon, 17 Jun 2024 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=JTSz3xCQbF1FkIS8O1r2SLhzKMlYtOs7VGil3BDwEeQ=; b=0Y3MBDx8cOU4ZDtsPZ5/goUbCyHSAyErBu06ysO6vVDOwkBaAT3YIQn4SC/+gYhBnRZm/Q 2AA+Gs0lwhBtJDGtiL0NhhSFo0ay5uLTixGJAyYHTp2Tl/RUQQj7ED7Thvn9j+Z5LOkxQC ujqr538t8eFEgy1qLTWqvED1e1DMfvI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=JTSz3xCQbF1FkIS8O1r2SLhzKMlYtOs7VGil3BDwEeQ=; b=/LllwXALhW/TE7cpGbMdEy4FGZmW3aNZuH8Wv2rglR2WitZNIUFMElSX9UEfvQf6z8hHj4 z679gc8/HofjelDw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=0Y3MBDx8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/LllwXAL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=JTSz3xCQbF1FkIS8O1r2SLhzKMlYtOs7VGil3BDwEeQ=; b=0Y3MBDx8cOU4ZDtsPZ5/goUbCyHSAyErBu06ysO6vVDOwkBaAT3YIQn4SC/+gYhBnRZm/Q 2AA+Gs0lwhBtJDGtiL0NhhSFo0ay5uLTixGJAyYHTp2Tl/RUQQj7ED7Thvn9j+Z5LOkxQC ujqr538t8eFEgy1qLTWqvED1e1DMfvI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=JTSz3xCQbF1FkIS8O1r2SLhzKMlYtOs7VGil3BDwEeQ=; b=/LllwXALhW/TE7cpGbMdEy4FGZmW3aNZuH8Wv2rglR2WitZNIUFMElSX9UEfvQf6z8hHj4 z679gc8/HofjelDw== 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 9F419139AB; Mon, 17 Jun 2024 10:05:04 +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 eKO5JVAKcGYfAgAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 10:05:04 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 3/5] ALSA: emu10k1: Drop NULL check for snd_ctl_remove() Date: Mon, 17 Jun 2024 12:05:25 +0200 Message-ID: <20240617100529.6667-4-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617100529.6667-1-tiwai@suse.de> References: <20240617100529.6667-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_TLS_ALL(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: B878537FCE X-Spam-Flag: NO X-Spam-Score: -3.01 X-Spam-Level: Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can drop the check in the caller side. Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emufx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index 03efc317e05f..34f385b5cd46 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -959,7 +959,6 @@ static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu, { unsigned int i; struct emu10k1_ctl_elem_id id; - struct snd_emu10k1_fx8010_ctl *ctl; struct snd_card *card = emu->card; int err; @@ -968,9 +967,7 @@ static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu, in_kernel); if (err < 0) return err; - ctl = snd_emu10k1_look_for_ctl(emu, &id); - if (ctl) - snd_ctl_remove(card, ctl->kcontrol); + snd_ctl_remove(card, snd_emu10k1_look_for_ctl(emu, &id)); } return 0; } From patchwork Mon Jun 17 10:05:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13700465 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 7ECD819049F for ; Mon, 17 Jun 2024 10:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618708; cv=none; b=IuVv3kkTAt/6e1nfJ5+8J41jZjy2BJtgKzVNKH4/zcRLsW8eAnaZ4RNkZ1qyjZDV0HtubyROINparPkrgnxUThBy9vuv+fvQ+vbzqxuW58PoFuY957Om+MAXLFJNYocs/5DmN2Ad6AGpWnvnsBdyePNroqq1blK2DNGjkdizrz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618708; c=relaxed/simple; bh=WZwp6Iowaw6PLVc6bsNtIMJM5dbIJbvXWNRADEIQlhw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uRF3r5BvAYp8hwVLcfnMm0SHBwv1XLPhmZtLK/wdpKu3Od+4ZOOaSjnm8mzIDm9yONiHPE7cat9OdF4WKDWD6jX9PB348ua2CFqMK4a05IKB8I0iHGm0ero1CwnH+PYLa9JG1yjBnYTtR0LkviaJ8PwTRBdV2tnzJgqZehQXff4= 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=XDQ1Ez1r; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hCnBEUIh; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=XDQ1Ez1r; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hCnBEUIh; arc=none smtp.client-ip=195.135.223.131 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="XDQ1Ez1r"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hCnBEUIh"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="XDQ1Ez1r"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hCnBEUIh" 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-out2.suse.de (Postfix) with ESMTPS id E58C75FE6F; Mon, 17 Jun 2024 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=LHEnHuFrQDtoCsqFLFky4hGVPl2ZIqIHDfamXgmqWuE=; b=XDQ1Ez1rFeh/fYEL6B6+AClJR55Y2qvZZtXEgbTa/Vj6czz31gVpC7lt4OVHr0Vj2ueVul 6qqrHLyHBVVsX9tgDqca7e3Q3lhhvqJImqCnl2DBNsNFt+MkZX4tDi/eoWHof4fD9otjPt dAJc9eQH1H7ksuIiOeGMkQI1IxkSotw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=LHEnHuFrQDtoCsqFLFky4hGVPl2ZIqIHDfamXgmqWuE=; b=hCnBEUIhYBKwHtKphGKy9xlykhFVEtroThpbmrmiwWzp4qOvS/z8a9g3LgwsdeoMIFgtMs Kc5x70K/IYWFsRDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=XDQ1Ez1r; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=hCnBEUIh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618704; 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=LHEnHuFrQDtoCsqFLFky4hGVPl2ZIqIHDfamXgmqWuE=; b=XDQ1Ez1rFeh/fYEL6B6+AClJR55Y2qvZZtXEgbTa/Vj6czz31gVpC7lt4OVHr0Vj2ueVul 6qqrHLyHBVVsX9tgDqca7e3Q3lhhvqJImqCnl2DBNsNFt+MkZX4tDi/eoWHof4fD9otjPt dAJc9eQH1H7ksuIiOeGMkQI1IxkSotw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618704; 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=LHEnHuFrQDtoCsqFLFky4hGVPl2ZIqIHDfamXgmqWuE=; b=hCnBEUIhYBKwHtKphGKy9xlykhFVEtroThpbmrmiwWzp4qOvS/z8a9g3LgwsdeoMIFgtMs Kc5x70K/IYWFsRDw== 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 BDFE213AAF; Mon, 17 Jun 2024 10:05:04 +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 EKcqLVAKcGYfAgAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 10:05:04 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 4/5] ALSA: hda: Drop NULL check for snd_ctl_remove() Date: Mon, 17 Jun 2024 12:05:26 +0200 Message-ID: <20240617100529.6667-5-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617100529.6667-1-tiwai@suse.de> References: <20240617100529.6667-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: E58C75FE6F X-Spam-Score: -3.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; URIBL_BLOCKED(0.00)[suse.de:email,suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can drop the check in the caller side. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_cs_dsp_ctl.c | 2 +- sound/pci/hda/tas2781_hda_i2c.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sound/pci/hda/hda_cs_dsp_ctl.c b/sound/pci/hda/hda_cs_dsp_ctl.c index e6e876998e71..deb74c247082 100644 --- a/sound/pci/hda/hda_cs_dsp_ctl.c +++ b/sound/pci/hda/hda_cs_dsp_ctl.c @@ -207,7 +207,7 @@ void hda_cs_dsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl) struct hda_cs_dsp_coeff_ctl *ctl = cs_ctl->priv; /* ctl and kctl may already have been removed by ALSA private_free */ - if (ctl && ctl->kctl) + if (ctl) snd_ctl_remove(ctl->card, ctl->kctl); } EXPORT_SYMBOL_NS_GPL(hda_cs_dsp_control_remove, SND_HDA_CS_DSP_CONTROLS); diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 75f7674c66ee..c878967cb66a 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -597,18 +597,13 @@ static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda) { struct hda_codec *codec = tas_hda->priv->codec; - if (tas_hda->dsp_prog_ctl) - snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); - - if (tas_hda->dsp_conf_ctl) - snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); + snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); + snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) - if (tas_hda->snd_ctls[i]) - snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); + snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); - if (tas_hda->prof_ctl) - snd_ctl_remove(codec->card, tas_hda->prof_ctl); + snd_ctl_remove(codec->card, tas_hda->prof_ctl); } static void tasdev_fw_ready(const struct firmware *fmw, void *context) From patchwork Mon Jun 17 10:05:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13700464 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 C24CF190682 for ; Mon, 17 Jun 2024 10:05:06 +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=1718618708; cv=none; b=AgHW/wcQuE4wJPpMezg0SMXsrXKAnP+X9UebvuV9TX7xKw6HFZjX6grt8ijVf/cK5Hj0G5PZ8Pac9jMdoRIenZFl7vShZzePBt0UNQVbdM3cDcjnMwXKcTUjf5j3f6zj9jegI6CdBEEzMrxJ0NN5KQ0+m5QRnqsb2FWhnkg3xtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718618708; c=relaxed/simple; bh=0MHpYgIx6ad588In1TCr3DXy3wEgZxTNVNMQ3FIL7WA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xb27efZLSdtvfStSMTzDc+kDyRYFpsWDBZeF2ZzIUlHj8CEoXSjS+vKum8HVuhctL0JMuy12AX9zQbZctL14nbkHKgyWcHob+Gh/Be6qA6oA04w1eKYwRzJHxtpBw4xCPgwEjEJl772y0eEQ9T1bwoqkl1rbECyr22X+10IUwOY= 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=MPAp1O7R; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=V+HSCnY2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MPAp1O7R; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=V+HSCnY2; 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="MPAp1O7R"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="V+HSCnY2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MPAp1O7R"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="V+HSCnY2" 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 0BF4637FCF; Mon, 17 Jun 2024 10:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618705; 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=cBh0gYve4T3U5Br9133HFh4LoR0k6JYig8NSngfVLTg=; b=MPAp1O7RsJ2rCJf14jbmzDOi5U++1ypEcB95N+fmR/QVECn+SPCgEgs8PFiKhvJNyrvb0B y6S7SSwukWF7y+IawKYvDQmydGDYHnui8afE3nJWX9ZLIHwlQVizqZWqbStUZX87TJW6cD 8P7RC6W2iM9Sg6E8tOgzKYJA60U+Tws= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618705; 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=cBh0gYve4T3U5Br9133HFh4LoR0k6JYig8NSngfVLTg=; b=V+HSCnY24xv8Mvv/uMObqZ8Ea/SF9C6ZjbAbAcBbADDQOXR4q/lg5yNCn9iRmTT6YEHB4m rrpus6aZ8GBxgoAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=MPAp1O7R; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=V+HSCnY2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718618705; 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=cBh0gYve4T3U5Br9133HFh4LoR0k6JYig8NSngfVLTg=; b=MPAp1O7RsJ2rCJf14jbmzDOi5U++1ypEcB95N+fmR/QVECn+SPCgEgs8PFiKhvJNyrvb0B y6S7SSwukWF7y+IawKYvDQmydGDYHnui8afE3nJWX9ZLIHwlQVizqZWqbStUZX87TJW6cD 8P7RC6W2iM9Sg6E8tOgzKYJA60U+Tws= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718618705; 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=cBh0gYve4T3U5Br9133HFh4LoR0k6JYig8NSngfVLTg=; b=V+HSCnY24xv8Mvv/uMObqZ8Ea/SF9C6ZjbAbAcBbADDQOXR4q/lg5yNCn9iRmTT6YEHB4m rrpus6aZ8GBxgoAw== 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 E603C139AB; Mon, 17 Jun 2024 10:05:04 +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 cAjxNlAKcGYfAgAAD6G6ig (envelope-from ); Mon, 17 Jun 2024 10:05:04 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 5/5] ALSA: spi: Drop NULL check for snd_ctl_remove() Date: Mon, 17 Jun 2024 12:05:27 +0200 Message-ID: <20240617100529.6667-6-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617100529.6667-1-tiwai@suse.de> References: <20240617100529.6667-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_TLS_ALL(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 0BF4637FCF X-Spam-Flag: NO X-Spam-Score: -3.01 X-Spam-Level: Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can drop the check in the caller side. Signed-off-by: Takashi Iwai --- sound/spi/at73c213.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index 5648d744aa79..8f6929ced2c8 100644 --- a/sound/spi/at73c213.c +++ b/sound/spi/at73c213.c @@ -726,12 +726,8 @@ static int snd_at73c213_mixer(struct snd_at73c213 *chip) return 0; cleanup: - for (idx = 1; idx < ARRAY_SIZE(snd_at73c213_controls) + 1; idx++) { - struct snd_kcontrol *kctl; - kctl = snd_ctl_find_numid(card, idx); - if (kctl) - snd_ctl_remove(card, kctl); - } + for (idx = 1; idx < ARRAY_SIZE(snd_at73c213_controls) + 1; idx++) + snd_ctl_remove(card, snd_ctl_find_numid(card, idx)); return errval; }