From patchwork Mon May 13 17:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663583 Received: from msa.smtpout.orange.fr (smtp-77.smtpout.orange.fr [80.12.242.77]) (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 741632C1A0; Mon, 13 May 2024 17:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621937; cv=none; b=pfJU4+ZsPDnrBFvQSBk3TNJ9K3cBH+/cM1PYrCnE84tlOc55wvQJ/HNWMToqVGkL//wCsDzoM9k44KhkafTgpJ2FkqAeFmHS3uMuuXrb5WPRtx2ZLoWi2W1VQTYCqDG3arWKnS0VbwmZ+Fo/o0l95EziySktYVBxpJgZ7TIBO/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621937; c=relaxed/simple; bh=Ze4YnXQ9+Ruy/YlREfo5kfMqxowQDPvZTQDp2yrWKWk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nDBM45R/YW/Z0bjmndlO+TO3szcvTk6BtCbPcCOSPkcpt1+GyYfbPZbM0URZ7ZCcvIwojO+QldE/buSgIHZMJhgzq0f4ROqDxACDHGXmWNb6xTUA9MbYjyGAySW/iKWb5rs9aQMydUhWbQxEv7sgweaQA23NIG0RZycclcVnxns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=NMO3deRZ; arc=none smtp.client-ip=80.12.242.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="NMO3deRZ" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcDsL7zL; Mon, 13 May 2024 19:37:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621857; bh=mUQBjk+s3SNdJ92QJBlXrlaeh+q14MQJ4sqID/f3sz8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NMO3deRZtCm5rDDebG9M7A7LwCm4uV4f+sAz704wyybGDhXxX8Or/waFg25iNWZ48 KC88iB5AnZCkLGd4/ejfRKI6lDxfivEGiy42vwPOPvgV7EOAtmconRrWNG5abdIKP1 NhsMyrL4lniKsWUSNxIvFs44Y9rs/14Zmq6w/TRgJpkkwBsrPrz0ETpc6LzgxDoU4A 5s61tRwo132xm/WP5fXuHOWw2iZA5No1lav/OhJBGhdX3V9m9hsTOwdjjLwMw7KTb9 a3t18nt/SSvlN5CCYR30dwt96vmTn2rkH/NYZSHs22JRiOBs44XiGLVgNDJTCrF7rQ sttZOFEvI3jxw== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:37 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/6] ASoC: topology: Constify an argument of snd_soc_tplg_component_load() Date: Mon, 13 May 2024 19:37:20 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 snd_soc_tplg_component_load() does not modify its "*ops" argument. It only read some values and stores it in "soc_tplg.ops". This argument and the ops field in "struct soc_tplg" can be made const. Signed-off-by: Christophe JAILLET Reviewed-by: Amadeusz Sławiński Tested-by: Pierre-Louis Bossart --- include/sound/soc-topology.h | 2 +- sound/soc/soc-topology.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h index f055c6917f6c..1eedd203ac29 100644 --- a/include/sound/soc-topology.h +++ b/include/sound/soc-topology.h @@ -178,7 +178,7 @@ static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr) /* Dynamic Object loading and removal for component drivers */ int snd_soc_tplg_component_load(struct snd_soc_component *comp, - struct snd_soc_tplg_ops *ops, const struct firmware *fw); + const struct snd_soc_tplg_ops *ops, const struct firmware *fw); int snd_soc_tplg_component_remove(struct snd_soc_component *comp); /* Binds event handlers to dynamic widgets */ diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 90ca37e008b3..b00ec01361c2 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -73,7 +73,7 @@ struct soc_tplg { int bytes_ext_ops_count; /* optional fw loading callbacks to component drivers */ - struct snd_soc_tplg_ops *ops; + const struct snd_soc_tplg_ops *ops; }; /* check we dont overflow the data for this control chunk */ @@ -2334,7 +2334,7 @@ static int soc_tplg_load(struct soc_tplg *tplg) /* load audio component topology from "firmware" file */ int snd_soc_tplg_component_load(struct snd_soc_component *comp, - struct snd_soc_tplg_ops *ops, const struct firmware *fw) + const struct snd_soc_tplg_ops *ops, const struct firmware *fw) { struct soc_tplg tplg; int ret; From patchwork Mon May 13 17:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663592 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0509EC25B10 for ; Mon, 13 May 2024 17:38:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 49C8D1FA; Mon, 13 May 2024 19:38:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 49C8D1FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1715621920; bh=WdpcdrePfNwFsbix0el9X+8Z4a1fgWVJwTo9rg3XJJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e0mJ3vqdNU9ciaBlUj8E/yNfmZWjbuJ2QUz30Obs9EcjB7NVpepmbPdzAXlqOe/8S MJg5hOCC+3+HE2QD0MiQmhMKBY6IEEKP8lx7zO4G4kqgrNZF86OuxsICZpgSf72jcD oUTfYvokCEwju3mHmWkD9q1tSDCoyDl6dSWN+N78= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5506EF80615; Mon, 13 May 2024 19:37:55 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 59B56F805BF; Mon, 13 May 2024 19:37:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17092F800E9; Mon, 13 May 2024 19:37:47 +0200 (CEST) Received: from msa.smtpout.orange.fr (out-69.smtpout.orange.fr [193.252.22.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BEDADF800E9; Mon, 13 May 2024 19:37:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BEDADF800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.a=rsa-sha256 header.s=t20230301 header.b=ES/EOgJ9 Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcIsL80i; Mon, 13 May 2024 19:37:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621859; bh=1XoI0qrkb16jr4M55oFmdJGGB7I4eLKt6bnnOAdsEJI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ES/EOgJ9+o9BPNKuuyYur0AGTIYX0XLGxXu2HluR7bjjtu66uy6rWHVo/iKF3pU6y JKm8sxRQdmfgDD+XHlvwH2DntmE4uF+hgUONv6Fm9DVXj+7xJx/fxE9u4xsDv9LPeS v7BsukwIRkRJyPM1aXye/w95YCk+GS974eSBzFDfL7UVUw37BZBFvLusX7U1Ub68j+ +rZrfOifHQCi6Z+/ddV6+kmhlsmaBFUJT2FHLjGLBTQASPoijThCxFctm3OcdLxOdU TWuJqJCJTUBqR8qdb00OEtPkmTi+UFBkrCfMVMg4IjWlGu9pa38fiHwTr5d0/OrP4o 0UPNRn9pa9/9A== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:39 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/6] ASoC: Intel: avs: Constify struct snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:21 +0200 Message-ID: <01de0157088de0475970c79738284d6c86d702fe.1715526069.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: KRQHBT5NFXQK54SO37ZVRKKYGEA7LEAW X-Message-ID-Hash: KRQHBT5NFXQK54SO37ZVRKKYGEA7LEAW X-MailFrom: christophe.jaillet@wanadoo.fr X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Constifying "struct snd_soc_tplg_ops" moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 28046 794 0 28840 70a8 sound/soc/intel/avs/topology.o After: text data bss dec hex filename 28206 614 0 28820 7094 sound/soc/intel/avs/topology.o Signed-off-by: Christophe JAILLET Reviewed-by: Amadeusz Sławiński --- Compile tested-only. --- sound/soc/intel/avs/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c index 02bae207f6ec..35381a835c93 100644 --- a/sound/soc/intel/avs/topology.c +++ b/sound/soc/intel/avs/topology.c @@ -1889,7 +1889,7 @@ avs_control_load(struct snd_soc_component *comp, int index, struct snd_kcontrol_ return 0; } -static struct snd_soc_tplg_ops avs_tplg_ops = { +static const struct snd_soc_tplg_ops avs_tplg_ops = { .io_ops = avs_control_ops, .io_ops_count = ARRAY_SIZE(avs_control_ops), .control_load = avs_control_load, From patchwork Mon May 13 17:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663580 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) (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 487372837D; Mon, 13 May 2024 17:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.23 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621869; cv=none; b=G4r+Jt4DEJfDgGQHVibQE6cbFkm3/IHLcbnMiifCYDl6mENf/8xFOVHufD4I47KtsXHEhUnqXXCcjM9dyHtrbXHZQGw5wBehrLOb5Rj1Dex4TWeikWjIEtWvpJuBlsW32WTmTCOXAc9tRoMSdHOgVWsOLCy+Ol/Kr6oJm3jJ1Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621869; c=relaxed/simple; bh=a0hGDqbnr8QfjOn4UWdQQVFTsm1YKoftP6R8ds04QtU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rXPyHyljk3K9np+kop+2iN6QmUJmvuXV+Gq2aW92oZiRlaR56fJH/dHVV6i5nb4RaS9ehtC7uJ16kGU5TAL536h/5GK4UstXBlbwg0ydcYE6zhHYEHvA7ZkvSWFm9eMNQQKPtRsCOw6jkV0Vy/CW4uHyLyuseAs+TEuYXzLExhE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=m90FUVvG; arc=none smtp.client-ip=80.12.242.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="m90FUVvG" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcKsL81A; Mon, 13 May 2024 19:37:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621860; bh=vPx09WkVDSPEOpN7HAXVn6S1kGIy/0oMa/odUP4ITxc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=m90FUVvGUYAng9KWUEjKYM1eIH1fEklPDwdWolN/ZVlGtl+EpR9oNiMZT/sXgwwhJ oEH/6thb5Alo3o7a9uzF/JMtkmqmrnJm75rObyvke+qoOfymnHbV1IBuD2miuuY4UJ +YzXUW56a9zUu0SMrd5qUoGnbk4iTh3qv6lLA1l6jz6TE5ipLRdqWkp64+byy34C22 yKngk6yqD/8ThHFwNaxSKJbUPiaYoGhj146tVS80EsfD2P3kWMJdHiT/7gOZrUvSKG YDFbRkJkbW0qdW3Z0LbubPyPtgvp3qTmP0AjaUrCgXYh40/5PH7mDpr/wz1y+fW5nd zc0rz5ydwA+ew== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:40 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 3/6] ASoC: qdsp6: audioreach: Constify struct snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:22 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Constifying "struct snd_soc_tplg_ops" moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 19942 832 0 20774 5126 sound/soc/qcom/qdsp6/topology.o After: text data bss dec hex filename 20102 652 0 20754 5112 sound/soc/qcom/qdsp6/topology.o Signed-off-by: Christophe JAILLET --- Compile tested-only. --- sound/soc/qcom/qdsp6/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 70572c83e101..c15d1a2b6dbf 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -1240,7 +1240,7 @@ static const struct snd_soc_tplg_kcontrol_ops audioreach_io_ops[] = { audioreach_put_vol_ctrl_audio_mixer, snd_soc_info_volsw}, }; -static struct snd_soc_tplg_ops audioreach_tplg_ops = { +static const struct snd_soc_tplg_ops audioreach_tplg_ops = { .io_ops = audioreach_io_ops, .io_ops_count = ARRAY_SIZE(audioreach_io_ops), From patchwork Mon May 13 17:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663581 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (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 718DF2C1A0; Mon, 13 May 2024 17:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621872; cv=none; b=S6N90BkYAG23yY+KI5lQyjP/lJzXc43dFe1uKhj0mef7axoDecNH//G9NIq8OOU0qItYfRXnR8vnpFPUdYBMoYz6wEA4D1rWVSCVJjJAQEnbM32T76hEL2bSLralmFb36kSrfpf7d+jQRCTb4b/U99hUehES5RQ0dd7lL2rmW5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621872; c=relaxed/simple; bh=mmp/3E5t0JWgl4/OYoYB0/Z3Zg7EBCcBulwzfpIlR2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ElQzqRw7btoLi+SnmGpQB3mnisaDzAtjFXyixbe0QlNUcuHWavL/2D/eM3rigul1d1fGlckWoA2CDB25O8cBYmYJqTX6cjQIzOytsdBYyUK6rjyMSZkEV3DoZi9BN+qMG7ZBYd8rwv5flq+alIZsUrsbm4XMbidrpBNOoJLtyzE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=W1sQ4L4K; arc=none smtp.client-ip=80.12.242.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="W1sQ4L4K" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcMsL81f; Mon, 13 May 2024 19:37:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621863; bh=A26Rl7MtM3B51oWgHFeoUVOcPLJ5BY3Z+dYCWIU7CTA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=W1sQ4L4KZKDLj0JG8sMTDYYCXP31N2hT7k41A6sBY2Z8c0LmZkf9HmTV/yO2SncVE fgorRdt1du9JSEGgtxOsjW91X/7ATkARIMK+pmfb4WbV5x5hzRPtusgNdtVHouDF3L OqZrK0UvU6SQ01Fi6g0FG6FOTaZCiJYN0Gf9HnzRQi9gSWxCC0eUxSXeKuAXU4mWy6 4YJe+ZsrlXunh3/sPF2VAAlGiwUES0zAWQEt38sO9Ba/mnlhnzUWeKbsfmSIp373kF bygSM8HADDUbJfdv1hbyvQ+HVlzyFBhQ6LoWuQd0F44GMSmFGRJHgiwtSqXZQVu79B mp4n6S/LpS+PA== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:43 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 4/6] ASoC: Intel: Skylake: Constify struct snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:23 +0200 Message-ID: <48f096b6dc617ecf3ca53211c2a696a4df33b21a.1715526069.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Constifying "struct snd_soc_tplg_ops" moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 58844 5282 56 64182 fab6 sound/soc/intel/skylake/skl-topology.o After: text data bss dec hex filename 59004 5122 56 64182 fab6 sound/soc/intel/skylake/skl-topology.o Signed-off-by: Christophe JAILLET Reviewed-by: Amadeusz Sławiński --- Compile tested-only. --- sound/soc/intel/skylake/skl-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index e27f0fc3d897..602ef4321122 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3470,7 +3470,7 @@ static int skl_tplg_complete(struct snd_soc_component *component) return 0; } -static struct snd_soc_tplg_ops skl_tplg_ops = { +static const struct snd_soc_tplg_ops skl_tplg_ops = { .widget_load = skl_tplg_widget_load, .control_load = skl_tplg_control_load, .bytes_ext_ops = skl_tlv_ops, From patchwork Mon May 13 17:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663582 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (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 80305339A1; Mon, 13 May 2024 17:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621873; cv=none; b=vA1nW6LYEPTK5nmDKHHwu7jAsO+p+lo57Bj/dPegaYOYU2S3N7Mw93sgimB/wNt0f5UtxrONdCqf+PfV5Pms+tearZlMpTenH9+twMsOyKCRhIBLdbZJeUDRYcE1j2vq4d8AgKgdLAJw586lwM9byVhb/yRwuXti7KUQvNg8/bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621873; c=relaxed/simple; bh=5NI70CwdCr6ds3UXpAse5bSY/w2S2qX7EJ/03/SHaBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hjRdjKEGl0Yn7G1XSpPD45ac9hcn6GL2i9cqwZsWkiPm6MQMSb5JmnfuBxNl6Nb4GpOXYA5cy6BO59fo4bThQILth/bFZwUq4VpHg8XTjOrTKPumAaLaxK1VnQXQm6HS35+tZPXtWsdu2EgviNS/hHTd5StZrcpiaUZY0aWQ3MA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=XWQayaUl; arc=none smtp.client-ip=80.12.242.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="XWQayaUl" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcNsL821; Mon, 13 May 2024 19:37:44 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621864; bh=tArMz3CXGARffdI7GxCeEXs4RlHzAXyCNuBRtNfPV0w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XWQayaUl7WTsSQ5YM4kr8gQgm3qMIo2et81SM55AGN8EHTknUjJSUpj7xQgEorIfj DZZKp+bwgM9AZ1sZbI6vdNeIVUpfeq1TdYFqCuAWrzGTfnHxSIndH6ykKyqmx49ZQv jRWlYChvnRad263+ngdk3IM+02SqNMmSmYz3vyvVxVuCrDCQpDf9O3vLAk/xsZHCBE RbH2p5/tC5iwGfuJTqWO7WMCcAHiX6jS4LxkAiu6mEWGSJJa2G9U/td4xAI46ONVCA UrqCRtoobwviGkpEGdSt3fdbiEQjYrRa/2NJOCX/8pR6OioW5xKWtQTRE8S1h0ngfF 0PWWuO4oLY+KQ== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:44 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 5/6] ASoC: SOF: topology: Constify struct snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:24 +0200 Message-ID: <2d9f5b75e979eb38b6f3baf85dfa1f0fdb3447ef.1715526069.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Constifying "struct snd_soc_tplg_ops" moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 44519 2888 48 47455 b95f sound/soc/sof/topology.o After: text data bss dec hex filename 44839 2552 48 47439 b94f sound/soc/sof/topology.o Signed-off-by: Christophe JAILLET --- Compile tested-only. --- sound/soc/sof/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index da182314aa87..b54382131991 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2278,7 +2278,7 @@ static const struct snd_soc_tplg_bytes_ext_ops sof_bytes_ext_ops[] = { {SOF_TPLG_KCTL_BYTES_VOLATILE_RO, snd_sof_bytes_ext_volatile_get}, }; -static struct snd_soc_tplg_ops sof_tplg_ops = { +static const struct snd_soc_tplg_ops sof_tplg_ops = { /* external kcontrol init - used for any driver specific init */ .control_load = sof_control_load, .control_unload = sof_control_unload, @@ -2433,7 +2433,7 @@ static int sof_dspless_link_load(struct snd_soc_component *scomp, int index, return 0; } -static struct snd_soc_tplg_ops sof_dspless_tplg_ops = { +static const struct snd_soc_tplg_ops sof_dspless_tplg_ops = { /* external widget init - used for any driver specific init */ .widget_ready = sof_dspless_widget_ready, .widget_unload = sof_dspless_widget_unload, From patchwork Mon May 13 17:37:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13663579 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) (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 4871528371; Mon, 13 May 2024 17:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.23 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621869; cv=none; b=YPH0XydVavauXcL1GxRAxGcxDxS7RUm0UkNkGFBc6DfUL1QVJFbxpRV6PW7bpjpX9w8iFh5OyckmDkheNnDl/rWgwU06MJAExQQnzjriKa/Exwq2Kbtxtz3H8ecxYPF0OXd5viorOhoAVlX7M9OZgWTituVoJMchqtEhSkJA5MQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715621869; c=relaxed/simple; bh=9OE/14Txm8aXh36Jq+hSFTjslOY8o75MZHgMuNfCtzE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iN9Dzscn2YV2ZWgsKbTk/oYIyPtwknL2RIMEf7G3+pZ9TYQZK4m9WYgH3KxM8wUjxusZsDk5F9NG8w2YLckqCBBHUMfOT6v/yCM+tyy4nqpkIsHOqTMxpQ2nIOS7dVbqc3Rng4uqXNq8eAVRnWkg1rE+ULvLh6z0oM8jSM9Mx+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=gD8obcW1; arc=none smtp.client-ip=80.12.242.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="gD8obcW1" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6ZcDs0lh7ME2z6ZcPsL82R; Mon, 13 May 2024 19:37:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715621865; bh=gwrzcGjxkeip9bzIrX/+Ukodp6IKjva1jKsX16KOX4Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=gD8obcW16mCMoDFz7RHcqZs7l87rOrifGN6K+j5KMXrj9kPV7yPVGw7fCKw8G2+vu p8Q9MUoLJoW6bv/CU2Cpz2KjWbbM7UApwJTa17j5I6BKlr1naAOAzi6Kr0aGoMvjxX kGqUU7uoQ2rewDsEnUHUWNoHAIk/7KTHcDceLosN5iW9EBl0hp3TedYZRsNOXGh1lq GrzDeqBOxx99uIXvMLZmYZP6QFZBAqeF6bxW1AVjsHrtvIfGCnBiAuAvFgnVUJuLC0 8tiv0RNEM+pd6RHnaYwbQJr5hHVRCvkrwr0+CKHV3dZ0JFLqIFLFhyAdu0r4N4AxuY ipu2cmYzo+OhQ== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 13 May 2024 19:37:45 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, daniel.baluta@nxp.com Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 6/6] const_structs.checkpatch: add snd_soc_tplg_ops Date: Mon, 13 May 2024 19:37:25 +0200 Message-ID: <6936369a414077265c11115c98364ae21e3cbdda.1715526069.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that the soc-topology can handle "const struct snd_soc_tplg_ops" make sure that new usages of the struct already enter the tree as const. Signed-off-by: Christophe JAILLET --- scripts/const_structs.checkpatch | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch index fa96cfd16e99..bae41780bd39 100644 --- a/scripts/const_structs.checkpatch +++ b/scripts/const_structs.checkpatch @@ -78,6 +78,7 @@ snd_rawmidi_ops snd_soc_component_driver snd_soc_dai_ops snd_soc_ops +snd_soc_tplg_ops soc_pcmcia_socket_ops stacktrace_ops sysfs_ops