aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-11-08 17:40:41 -0500
committerTakashi Iwai <tiwai@suse.de>2015-11-11 02:40:56 -0500
commit43f2cdeb7a61598050028f1eae51b9cb5398af42 (patch)
treefeab7519d5699ecb867fcbaf105ed8d2f46fe20d
parent16771c7c704769c5f3d70c024630b6e5b3eafa67 (diff)
ALSA: ctxfi: constify rsc ops structures
The various rsc ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ctxfi/ctamixer.c6
-rw-r--r--sound/pci/ctxfi/ctamixer.h2
-rw-r--r--sound/pci/ctxfi/ctdaio.c10
-rw-r--r--sound/pci/ctxfi/ctdaio.h4
-rw-r--r--sound/pci/ctxfi/ctresource.c2
-rw-r--r--sound/pci/ctxfi/ctresource.h2
-rw-r--r--sound/pci/ctxfi/ctsrc.c6
-rw-r--r--sound/pci/ctxfi/ctsrc.h4
8 files changed, 18 insertions, 18 deletions
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
index c7dc38d41b7f..5fcbb065d870 100644
--- a/sound/pci/ctxfi/ctamixer.c
+++ b/sound/pci/ctxfi/ctamixer.c
@@ -49,7 +49,7 @@ static int amixer_output_slot(const struct rsc *rsc)
49 return (amixer_index(rsc) << 4) + 0x4; 49 return (amixer_index(rsc) << 4) + 0x4;
50} 50}
51 51
52static struct rsc_ops amixer_basic_rsc_ops = { 52static const struct rsc_ops amixer_basic_rsc_ops = {
53 .master = amixer_master, 53 .master = amixer_master,
54 .next_conj = amixer_next_conj, 54 .next_conj = amixer_next_conj,
55 .index = amixer_index, 55 .index = amixer_index,
@@ -186,7 +186,7 @@ static int amixer_setup(struct amixer *amixer, struct rsc *input,
186 return 0; 186 return 0;
187} 187}
188 188
189static struct amixer_rsc_ops amixer_ops = { 189static const struct amixer_rsc_ops amixer_ops = {
190 .set_input = amixer_set_input, 190 .set_input = amixer_set_input,
191 .set_invalid_squash = amixer_set_invalid_squash, 191 .set_invalid_squash = amixer_set_invalid_squash,
192 .set_scale = amixer_set_y, 192 .set_scale = amixer_set_y,
@@ -357,7 +357,7 @@ static int sum_output_slot(const struct rsc *rsc)
357 return (sum_index(rsc) << 4) + 0xc; 357 return (sum_index(rsc) << 4) + 0xc;
358} 358}
359 359
360static struct rsc_ops sum_basic_rsc_ops = { 360static const struct rsc_ops sum_basic_rsc_ops = {
361 .master = sum_master, 361 .master = sum_master,
362 .next_conj = sum_next_conj, 362 .next_conj = sum_next_conj,
363 .index = sum_index, 363 .index = sum_index,
diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h
index 72f42f27434e..2de18aa6508d 100644
--- a/sound/pci/ctxfi/ctamixer.h
+++ b/sound/pci/ctxfi/ctamixer.h
@@ -58,7 +58,7 @@ struct amixer {
58 unsigned char idx[8]; 58 unsigned char idx[8];
59 struct rsc *input; /* pointer to a resource acting as source */ 59 struct rsc *input; /* pointer to a resource acting as source */
60 struct sum *sum; /* Put amixer output to this summation node */ 60 struct sum *sum; /* Put amixer output to this summation node */
61 struct amixer_rsc_ops *ops; /* AMixer specific operations */ 61 const struct amixer_rsc_ops *ops; /* AMixer specific operations */
62}; 62};
63 63
64struct amixer_rsc_ops { 64struct amixer_rsc_ops {
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 9b87dd28de83..7f089cb433e1 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -83,21 +83,21 @@ static int daio_in_next_conj_20k2(struct rsc *rsc)
83 return rsc->conj += 0x100; 83 return rsc->conj += 0x100;
84} 84}
85 85
86static struct rsc_ops daio_out_rsc_ops = { 86static const struct rsc_ops daio_out_rsc_ops = {
87 .master = daio_master, 87 .master = daio_master,
88 .next_conj = daio_out_next_conj, 88 .next_conj = daio_out_next_conj,
89 .index = daio_index, 89 .index = daio_index,
90 .output_slot = NULL, 90 .output_slot = NULL,
91}; 91};
92 92
93static struct rsc_ops daio_in_rsc_ops_20k1 = { 93static const struct rsc_ops daio_in_rsc_ops_20k1 = {
94 .master = daio_master, 94 .master = daio_master,
95 .next_conj = daio_in_next_conj_20k1, 95 .next_conj = daio_in_next_conj_20k1,
96 .index = NULL, 96 .index = NULL,
97 .output_slot = daio_index, 97 .output_slot = daio_index,
98}; 98};
99 99
100static struct rsc_ops daio_in_rsc_ops_20k2 = { 100static const struct rsc_ops daio_in_rsc_ops_20k2 = {
101 .master = daio_master, 101 .master = daio_master,
102 .next_conj = daio_in_next_conj_20k2, 102 .next_conj = daio_in_next_conj_20k2,
103 .index = NULL, 103 .index = NULL,
@@ -263,7 +263,7 @@ static int dao_clear_right_input(struct dao *dao)
263 return 0; 263 return 0;
264} 264}
265 265
266static struct dao_rsc_ops dao_ops = { 266static const struct dao_rsc_ops dao_ops = {
267 .set_spos = dao_spdif_set_spos, 267 .set_spos = dao_spdif_set_spos,
268 .commit_write = dao_commit_write, 268 .commit_write = dao_commit_write,
269 .get_spos = dao_spdif_get_spos, 269 .get_spos = dao_spdif_get_spos,
@@ -318,7 +318,7 @@ static int dai_commit_write(struct dai *dai)
318 return 0; 318 return 0;
319} 319}
320 320
321static struct dai_rsc_ops dai_ops = { 321static const struct dai_rsc_ops dai_ops = {
322 .set_srt_srcl = dai_set_srt_srcl, 322 .set_srt_srcl = dai_set_srt_srcl,
323 .set_srt_srcr = dai_set_srt_srcr, 323 .set_srt_srcr = dai_set_srt_srcr,
324 .set_srt_msr = dai_set_srt_msr, 324 .set_srt_msr = dai_set_srt_msr,
diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h
index 0ebbf350f51a..a30be73b08ea 100644
--- a/sound/pci/ctxfi/ctdaio.h
+++ b/sound/pci/ctxfi/ctdaio.h
@@ -51,7 +51,7 @@ struct daio {
51 51
52struct dao { 52struct dao {
53 struct daio daio; 53 struct daio daio;
54 struct dao_rsc_ops *ops; /* DAO specific operations */ 54 const struct dao_rsc_ops *ops; /* DAO specific operations */
55 struct imapper **imappers; 55 struct imapper **imappers;
56 struct daio_mgr *mgr; 56 struct daio_mgr *mgr;
57 struct hw *hw; 57 struct hw *hw;
@@ -60,7 +60,7 @@ struct dao {
60 60
61struct dai { 61struct dai {
62 struct daio daio; 62 struct daio daio;
63 struct dai_rsc_ops *ops; /* DAI specific operations */ 63 const struct dai_rsc_ops *ops; /* DAI specific operations */
64 struct hw *hw; 64 struct hw *hw;
65 void *ctrl_blk; 65 void *ctrl_blk;
66}; 66};
diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c
index 1a97e406d8ec..c5124c3c0fd1 100644
--- a/sound/pci/ctxfi/ctresource.c
+++ b/sound/pci/ctxfi/ctresource.c
@@ -127,7 +127,7 @@ static int rsc_master(struct rsc *rsc)
127 return rsc->conj = rsc->idx; 127 return rsc->conj = rsc->idx;
128} 128}
129 129
130static struct rsc_ops rsc_generic_ops = { 130static const struct rsc_ops rsc_generic_ops = {
131 .index = rsc_index, 131 .index = rsc_index,
132 .output_slot = audio_ring_slot, 132 .output_slot = audio_ring_slot,
133 .master = rsc_master, 133 .master = rsc_master,
diff --git a/sound/pci/ctxfi/ctresource.h b/sound/pci/ctxfi/ctresource.h
index 9b746c3719e6..736d9f7e9e16 100644
--- a/sound/pci/ctxfi/ctresource.h
+++ b/sound/pci/ctxfi/ctresource.h
@@ -39,7 +39,7 @@ struct rsc {
39 u32 msr:4; /* The Master Sample Rate a resource working on */ 39 u32 msr:4; /* The Master Sample Rate a resource working on */
40 void *ctrl_blk; /* Chip specific control info block for a resource */ 40 void *ctrl_blk; /* Chip specific control info block for a resource */
41 struct hw *hw; /* Chip specific object for hardware access means */ 41 struct hw *hw; /* Chip specific object for hardware access means */
42 struct rsc_ops *ops; /* Generic resource operations */ 42 const struct rsc_ops *ops; /* Generic resource operations */
43}; 43};
44 44
45struct rsc_ops { 45struct rsc_ops {
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
index ec1f08464d93..a5a72df29801 100644
--- a/sound/pci/ctxfi/ctsrc.c
+++ b/sound/pci/ctxfi/ctsrc.c
@@ -335,7 +335,7 @@ static int src_default_config_arcrw(struct src *src)
335 return 0; 335 return 0;
336} 336}
337 337
338static struct src_rsc_ops src_rsc_ops = { 338static const struct src_rsc_ops src_rsc_ops = {
339 .set_state = src_set_state, 339 .set_state = src_set_state,
340 .set_bm = src_set_bm, 340 .set_bm = src_set_bm,
341 .set_sf = src_set_sf, 341 .set_sf = src_set_sf,
@@ -611,7 +611,7 @@ static int srcimp_index(const struct rsc *rsc)
611 return container_of(rsc, struct srcimp, rsc)->idx[rsc->conj]; 611 return container_of(rsc, struct srcimp, rsc)->idx[rsc->conj];
612} 612}
613 613
614static struct rsc_ops srcimp_basic_rsc_ops = { 614static const struct rsc_ops srcimp_basic_rsc_ops = {
615 .master = srcimp_master, 615 .master = srcimp_master,
616 .next_conj = srcimp_next_conj, 616 .next_conj = srcimp_next_conj,
617 .index = srcimp_index, 617 .index = srcimp_index,
@@ -662,7 +662,7 @@ static int srcimp_unmap(struct srcimp *srcimp)
662 return 0; 662 return 0;
663} 663}
664 664
665static struct srcimp_rsc_ops srcimp_ops = { 665static const struct srcimp_rsc_ops srcimp_ops = {
666 .map = srcimp_map, 666 .map = srcimp_map,
667 .unmap = srcimp_unmap 667 .unmap = srcimp_unmap
668}; 668};
diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h
index da7573c5db9b..92944a012bc4 100644
--- a/sound/pci/ctxfi/ctsrc.h
+++ b/sound/pci/ctxfi/ctsrc.h
@@ -48,7 +48,7 @@ struct src_rsc_ops;
48struct src { 48struct src {
49 struct rsc rsc; /* Basic resource info */ 49 struct rsc rsc; /* Basic resource info */
50 struct src *intlv; /* Pointer to next interleaved SRC in a series */ 50 struct src *intlv; /* Pointer to next interleaved SRC in a series */
51 struct src_rsc_ops *ops; /* SRC specific operations */ 51 const struct src_rsc_ops *ops; /* SRC specific operations */
52 /* Number of contiguous srcs for interleaved usage */ 52 /* Number of contiguous srcs for interleaved usage */
53 unsigned char multi; 53 unsigned char multi;
54 unsigned char mode; /* Working mode of this SRC resource */ 54 unsigned char mode; /* Working mode of this SRC resource */
@@ -110,7 +110,7 @@ struct srcimp {
110 struct imapper *imappers; 110 struct imapper *imappers;
111 unsigned int mapped; /* A bit-map indicating which conj rsc is mapped */ 111 unsigned int mapped; /* A bit-map indicating which conj rsc is mapped */
112 struct srcimp_mgr *mgr; 112 struct srcimp_mgr *mgr;
113 struct srcimp_rsc_ops *ops; 113 const struct srcimp_rsc_ops *ops;
114}; 114};
115 115
116struct srcimp_rsc_ops { 116struct srcimp_rsc_ops {