ASoC: SOF: Intel: Constify sof_probe_compressed_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 26 May 2021 23:10:13 +0000 (01:10 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 1 Jun 2021 13:05:15 +0000 (14:05 +0100)
The only usage of sof_probe_compressed_ops is to assign its address to
the compress_ops field in the snd_soc_component_driver struct, which is
a pointer to const. The assignment is done in sound/soc/sof/pcm.c. Make
it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-6-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/compress.c
sound/soc/sof/compress.h

index 2d4969c705a4e5394e8637ea820a54a9ade0df9e..57d5bf0a171e3d709022ab7ec6885f53a56e02f9 100644 (file)
@@ -13,7 +13,7 @@
 #include "ops.h"
 #include "probe.h"
 
-struct snd_compress_ops sof_probe_compressed_ops = {
+const struct snd_compress_ops sof_probe_compressed_ops = {
        .copy           = sof_probe_compr_copy,
 };
 EXPORT_SYMBOL(sof_probe_compressed_ops);
index ca8790bd4b133968da1998b10153cdf5bad6f967..4448c799e14b002080bf912d6001cc6a3840f51d 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <sound/compress_driver.h>
 
-extern struct snd_compress_ops sof_probe_compressed_ops;
+extern const struct snd_compress_ops sof_probe_compressed_ops;
 
 int sof_probe_compr_open(struct snd_compr_stream *cstream,
                struct snd_soc_dai *dai);