From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 953FB13D896; Tue, 23 Jul 2024 18:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721760074; cv=none; b=mJKAxDEsA+wMVrs+wFvoRmqTrfAyf/G/tYSql9YbPl9dKTYagl2nBNDEwul7nLBioFy21kggRMT22xUwCesfgK38az7gvfAFgcjG/i/uxLOxK6szJHwjs1NuAUV2YilMa87CyaMyktl9dPans8/mOs65YbJGZkIsEZfDDA2s6JA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721760074; c=relaxed/simple; bh=R0npayD2raiKeQr618mWdTKWiizv5nYHTLzx4GerW+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f6JI0VtLD/xwiQQJdfwyPmdaGK5S26OfYUjkH4DrD1kA/FTjhQS5SxU3XjKfOaSANrgT7HXaQqZ52UZlMUsSHASKf/GpmrbUW0PpkjG62d6WHTzDe8axJAzs7wGVfZLJdPZLtDgUSwDcm+iQlgPxp0wzyqHzsfrwP19ERTAI2LY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qxOG6KOB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qxOG6KOB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BE48C4AF09; Tue, 23 Jul 2024 18:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721760074; bh=R0npayD2raiKeQr618mWdTKWiizv5nYHTLzx4GerW+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxOG6KOBUn2s8f51/dQtW1LdzvhfaUe0t9cipDs7O30K2ECct1RVUAGkcR3ET7P3T jyy/gVg+6TZ+LKQLgy3SCMncHUU0Zqoao6+njtpa7A5FfSlKEi5NEgJin/PdaPM4jJ vYZzMVr7YDfbbrcmqRbxhNyZK8n3VLSguaeQAoIo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cezary Rojewski , =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Mark Brown , Sasha Levin Subject: [PATCH 6.9 094/163] ASoC: topology: Do not assign fields that are already set Date: Tue, 23 Jul 2024 20:23:43 +0200 Message-ID: <20240723180147.110056932@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723180143.461739294@linuxfoundation.org> References: <20240723180143.461739294@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Amadeusz Sławiński [ Upstream commit daf0b99d4720c9f05bdb81c73b2efdb43fa9def3 ] The routes are allocated with kzalloc(), so all fields are zeroed by default, skip unnecessary assignments. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20240603102818.36165-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-topology.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 7add1dbf1d214..ce22613bf9690 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1072,11 +1072,7 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, break; } - /* set to NULL atm for tplg users */ - route->connected = NULL; - if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0) { - route->control = NULL; - } else { + if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) != 0) { route->control = devm_kmemdup(tplg->dev, elem->control, min(strlen(elem->control), SNDRV_CTL_ELEM_ID_NAME_MAXLEN), -- 2.43.0