From: neil.armstrong@linaro.org
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Banajit Goswami <bgoswami@quicinc.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 21/23] ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info
Date: Wed, 12 Jun 2024 18:25:48 +0200 [thread overview]
Message-ID: <441e083f-6565-4b75-bb45-a153d2ba439e@linaro.org> (raw)
In-Reply-To: <20240612-asoc-wcd9xxx-wide-cleanups-v1-21-0d15885b2a06@linaro.org>
On 12/06/2024 18:15, Krzysztof Kozlowski wrote:
> Driver does not modify static wcd939x_sdw_ch_info array, so it can be
> made const for code safety.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> sound/soc/codecs/wcd939x-sdw.c | 4 ++--
> sound/soc/codecs/wcd939x.c | 2 +-
> sound/soc/codecs/wcd939x.h | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/wcd939x-sdw.c b/sound/soc/codecs/wcd939x-sdw.c
> index 8acb5651c5bc..94b1e99a3ca0 100644
> --- a/sound/soc/codecs/wcd939x-sdw.c
> +++ b/sound/soc/codecs/wcd939x-sdw.c
> @@ -23,7 +23,7 @@
>
> #define SWRS_SCP_HOST_CLK_DIV2_CTL_BANK(m) (0xE0 + 0x10 * (m))
>
> -static struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
> +static const struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
> WCD_SDW_CH(WCD939X_HPH_L, WCD939X_HPH_PORT, BIT(0)),
> WCD_SDW_CH(WCD939X_HPH_R, WCD939X_HPH_PORT, BIT(1)),
> WCD_SDW_CH(WCD939X_CLSH, WCD939X_CLSH_PORT, BIT(0)),
> @@ -36,7 +36,7 @@ static struct wcd939x_sdw_ch_info wcd939x_sdw_rx_ch_info[] = {
> WCD_SDW_CH(WCD939X_HIFI_PCM_R, WCD939X_HIFI_PCM_PORT, BIT(1)),
> };
>
> -static struct wcd939x_sdw_ch_info wcd939x_sdw_tx_ch_info[] = {
> +static const struct wcd939x_sdw_ch_info wcd939x_sdw_tx_ch_info[] = {
> WCD_SDW_CH(WCD939X_ADC1, WCD939X_ADC_1_4_PORT, BIT(0)),
> WCD_SDW_CH(WCD939X_ADC2, WCD939X_ADC_1_4_PORT, BIT(1)),
> WCD_SDW_CH(WCD939X_ADC3, WCD939X_ADC_1_4_PORT, BIT(2)),
> diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
> index 1f94f49f9829..66af035bd0e5 100644
> --- a/sound/soc/codecs/wcd939x.c
> +++ b/sound/soc/codecs/wcd939x.c
> @@ -414,7 +414,7 @@ static int wcd939x_io_init(struct snd_soc_component *component)
> return 0;
> }
>
> -static int wcd939x_sdw_connect_port(struct wcd939x_sdw_ch_info *ch_info,
> +static int wcd939x_sdw_connect_port(const struct wcd939x_sdw_ch_info *ch_info,
> struct sdw_port_config *port_config,
> u8 enable)
> {
> diff --git a/sound/soc/codecs/wcd939x.h b/sound/soc/codecs/wcd939x.h
> index 756f497a337c..a6c9c6cee056 100644
> --- a/sound/soc/codecs/wcd939x.h
> +++ b/sound/soc/codecs/wcd939x.h
> @@ -914,7 +914,7 @@ struct wcd939x_sdw_priv {
> struct sdw_stream_config sconfig;
> struct sdw_stream_runtime *sruntime;
> struct sdw_port_config port_config[WCD939X_MAX_SWR_PORTS];
> - struct wcd939x_sdw_ch_info *ch_info;
> + const struct wcd939x_sdw_ch_info *ch_info;
> bool port_enable[WCD939X_MAX_SWR_CH_IDS];
> int active_ports;
> int num_ports;
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2024-06-12 16:25 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 16:15 [PATCH 00/23] ASoC: codecs: wcd family: cleanups Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 01/23] ASoC: codecs: wcd-mbhc: Constify passed MBHC reg fields Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 02/23] ASoC: codecs: wcd9335: Drop unused state container fields Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 03/23] ASoC: codecs: wcd9335: Constify static data Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 04/23] ASoC: codecs: wcd9335: Handle nicer probe deferral and simplify with dev_err_probe() Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 05/23] ASoC: codecs: wcd9335: Drop unneeded error message Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 06/23] ASoC: codecs: wcd9335: Drop unused dmic rate handling Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 07/23] ASoC: codecs: wcd934x: Drop unused interp path enum Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 08/23] ASoC: codecs: wcd934x: Constify static data Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 09/23] ASoC: codecs: wcd934x: Drop unused mic bias voltage fields Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 10/23] ASoC: codecs: wcd934x: Handle nicer probe deferral and simplify with dev_err_probe() Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 11/23] ASoC: codecs: wcd937x: Constify static data Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 12/23] ASoC: codecs: wcd937x: Constify wcd937x_sdw_ch_info Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 13/23] ASoC: codecs: wcd937x: Drop unused enums, defines and types Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 14/23] ASoC: codecs: wcd937x: Drop unused state container fields Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 15/23] ASoC: codecs: wcd937x: Drop unused chipid member Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 16/23] ASoC: codecs: wcd938x: Constify static data Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 17/23] ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 18/23] ASoC: codecs: wcd938x: Drop unused RX/TX direction enum Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 19/23] ASoC: codecs: wcd938x: Drop unused num_ports field Krzysztof Kozlowski
2024-06-12 16:15 ` [PATCH 20/23] ASoC: codecs: wcd939x: Constify static data Krzysztof Kozlowski
2024-06-12 16:25 ` neil.armstrong
2024-06-12 16:15 ` [PATCH 21/23] ASoC: codecs: wcd939x: Constify wcd939x_sdw_ch_info Krzysztof Kozlowski
2024-06-12 16:25 ` neil.armstrong [this message]
2024-06-12 16:15 ` [PATCH 22/23] ASoC: codecs: wcd939x: Drop unused RX/TX direction enum Krzysztof Kozlowski
2024-06-12 16:25 ` neil.armstrong
2024-06-12 16:15 ` [PATCH 23/23] ASoC: codecs: wcd939x: Drop unused num_ports field Krzysztof Kozlowski
2024-06-12 16:26 ` neil.armstrong
2024-06-23 17:21 ` [PATCH 00/23] ASoC: codecs: wcd family: cleanups Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=441e083f-6565-4b75-bb45-a153d2ba439e@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox