diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-24 09:51:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-26 05:47:52 -0400 |
commit | d51a12c962f26fcb859203372fa196c2dfcd5f77 (patch) | |
tree | cb58fa942949f534bf840d6d782dac5cb7bf2497 | |
parent | 71d1b2bec07c8aec4252111a84699273f50fdc52 (diff) |
[media] as102: fix endiannes casts
Smatch complains a lot about endiannes issues on as102:
drivers/media/usb/as102/as10x_cmd_stream.c:41:47: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:41:47: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_stream.c:41:47: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_stream.c:43:43: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:43:43: expected unsigned short [unsigned] [usertype] pid
drivers/media/usb/as102/as10x_cmd_stream.c:43:43: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_stream.c:98:47: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:98:47: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_stream.c:98:47: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_stream.c:100:43: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:100:43: expected unsigned short [unsigned] [usertype] pid
drivers/media/usb/as102/as10x_cmd_stream.c:100:43: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_stream.c:142:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:142:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_stream.c:142:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_stream.c:185:47: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_stream.c:185:47: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_stream.c:185:47: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:46:40: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:46:40: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_cfg.c:46:40: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:47:36: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:47:36: expected unsigned short [unsigned] [usertype] tag
drivers/media/usb/as102/as10x_cmd_cfg.c:47:36: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:48:37: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:48:37: expected unsigned short [unsigned] [usertype] type
drivers/media/usb/as102/as10x_cmd_cfg.c:48:37: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:72:27: warning: cast to restricted __le32
drivers/media/usb/as102/as10x_cmd_cfg.c:102:40: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:102:40: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_cfg.c:102:40: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:104:50: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:104:50: expected unsigned int [unsigned] [usertype] value32
drivers/media/usb/as102/as10x_cmd_cfg.c:104:50: got restricted __le32 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:105:36: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:105:36: expected unsigned short [unsigned] [usertype] tag
drivers/media/usb/as102/as10x_cmd_cfg.c:105:36: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:106:37: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:106:37: expected unsigned short [unsigned] [usertype] type
drivers/media/usb/as102/as10x_cmd_cfg.c:106:37: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:156:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd_cfg.c:156:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd_cfg.c:156:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd_cfg.c:197:14: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:40:40: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:40:40: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:40:40: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:81:41: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:81:41: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:81:41: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:123:41: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:123:41: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:123:41: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:124:43: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:124:43: expected unsigned int [unsigned] [usertype] freq
drivers/media/usb/as102/as10x_cmd.c:124:43: got restricted __le32 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:178:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:178:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:178:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:202:17: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:203:24: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:204:24: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:230:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:230:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:230:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:262:25: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:289:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:289:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:289:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:313:17: warning: cast to restricted __le32
drivers/media/usb/as102/as10x_cmd.c:315:17: warning: cast to restricted __le32
drivers/media/usb/as102/as10x_cmd.c:317:17: warning: cast to restricted __le32
drivers/media/usb/as102/as10x_cmd.c:319:17: warning: cast to restricted __le16
drivers/media/usb/as102/as10x_cmd.c:349:48: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:349:48: expected unsigned short [unsigned] [usertype] proc_id
drivers/media/usb/as102/as10x_cmd.c:349:48: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:387:29: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:387:29: expected unsigned short [unsigned] [usertype] req_id
drivers/media/usb/as102/as10x_cmd.c:387:29: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:388:27: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:388:27: expected unsigned short [unsigned] [usertype] prog
drivers/media/usb/as102/as10x_cmd.c:388:27: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:389:30: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:389:30: expected unsigned short [unsigned] [usertype] version
drivers/media/usb/as102/as10x_cmd.c:389:30: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:390:31: warning: incorrect type in assignment (different base types)
drivers/media/usb/as102/as10x_cmd.c:390:31: expected unsigned short [unsigned] [usertype] data_len
drivers/media/usb/as102/as10x_cmd.c:390:31: got restricted __le16 [usertype] <noident>
drivers/media/usb/as102/as10x_cmd.c:408:14: warning: cast to restricted __le16
This happens because of the command endiannes that are sent/received to
the firmware. So, add the correct endiannes tags to the command fields.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/as102/as10x_cmd.c | 18 | ||||
-rw-r--r-- | drivers/media/usb/as102/as10x_cmd.h | 100 | ||||
-rw-r--r-- | drivers/media/usb/as102/as10x_cmd_cfg.c | 4 |
3 files changed, 61 insertions, 61 deletions
diff --git a/drivers/media/usb/as102/as10x_cmd.c b/drivers/media/usb/as102/as10x_cmd.c index ef238022dfe5..870617994410 100644 --- a/drivers/media/usb/as102/as10x_cmd.c +++ b/drivers/media/usb/as102/as10x_cmd.c | |||
@@ -121,7 +121,7 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap, | |||
121 | 121 | ||
122 | /* fill command */ | 122 | /* fill command */ |
123 | preq->body.set_tune.req.proc_id = cpu_to_le16(CONTROL_PROC_SETTUNE); | 123 | preq->body.set_tune.req.proc_id = cpu_to_le16(CONTROL_PROC_SETTUNE); |
124 | preq->body.set_tune.req.args.freq = cpu_to_le32(ptune->freq); | 124 | preq->body.set_tune.req.args.freq = (__force __u32)cpu_to_le32(ptune->freq); |
125 | preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; | 125 | preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; |
126 | preq->body.set_tune.req.args.hier_select = ptune->hier_select; | 126 | preq->body.set_tune.req.args.hier_select = ptune->hier_select; |
127 | preq->body.set_tune.req.args.modulation = ptune->modulation; | 127 | preq->body.set_tune.req.args.modulation = ptune->modulation; |
@@ -199,9 +199,9 @@ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap, | |||
199 | /* Response OK -> get response data */ | 199 | /* Response OK -> get response data */ |
200 | pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; | 200 | pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; |
201 | pstatus->signal_strength = | 201 | pstatus->signal_strength = |
202 | le16_to_cpu(prsp->body.get_tune_status.rsp.sts.signal_strength); | 202 | le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.signal_strength); |
203 | pstatus->PER = le16_to_cpu(prsp->body.get_tune_status.rsp.sts.PER); | 203 | pstatus->PER = le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.PER); |
204 | pstatus->BER = le16_to_cpu(prsp->body.get_tune_status.rsp.sts.BER); | 204 | pstatus->BER = le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.BER); |
205 | 205 | ||
206 | out: | 206 | out: |
207 | return error; | 207 | return error; |
@@ -259,7 +259,7 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps) | |||
259 | ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; | 259 | ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; |
260 | ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; | 260 | ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; |
261 | ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; | 261 | ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; |
262 | ptps->cell_ID = le16_to_cpu(prsp->body.get_tps.rsp.tps.cell_ID); | 262 | ptps->cell_ID = le16_to_cpu((__force __le16)prsp->body.get_tps.rsp.tps.cell_ID); |
263 | 263 | ||
264 | out: | 264 | out: |
265 | return error; | 265 | return error; |
@@ -310,13 +310,13 @@ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap, | |||
310 | 310 | ||
311 | /* Response OK -> get response data */ | 311 | /* Response OK -> get response data */ |
312 | pdemod_stats->frame_count = | 312 | pdemod_stats->frame_count = |
313 | le32_to_cpu(prsp->body.get_demod_stats.rsp.stats.frame_count); | 313 | le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.frame_count); |
314 | pdemod_stats->bad_frame_count = | 314 | pdemod_stats->bad_frame_count = |
315 | le32_to_cpu(prsp->body.get_demod_stats.rsp.stats.bad_frame_count); | 315 | le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.bad_frame_count); |
316 | pdemod_stats->bytes_fixed_by_rs = | 316 | pdemod_stats->bytes_fixed_by_rs = |
317 | le32_to_cpu(prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); | 317 | le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); |
318 | pdemod_stats->mer = | 318 | pdemod_stats->mer = |
319 | le16_to_cpu(prsp->body.get_demod_stats.rsp.stats.mer); | 319 | le16_to_cpu((__force __le16)prsp->body.get_demod_stats.rsp.stats.mer); |
320 | pdemod_stats->has_started = | 320 | pdemod_stats->has_started = |
321 | prsp->body.get_demod_stats.rsp.stats.has_started; | 321 | prsp->body.get_demod_stats.rsp.stats.has_started; |
322 | 322 | ||
diff --git a/drivers/media/usb/as102/as10x_cmd.h b/drivers/media/usb/as102/as10x_cmd.h index 09134f73ba3d..e06b84e2ff79 100644 --- a/drivers/media/usb/as102/as10x_cmd.h +++ b/drivers/media/usb/as102/as10x_cmd.h | |||
@@ -92,12 +92,12 @@ union as10x_turn_on { | |||
92 | /* request */ | 92 | /* request */ |
93 | struct { | 93 | struct { |
94 | /* request identifier */ | 94 | /* request identifier */ |
95 | uint16_t proc_id; | 95 | __le16 proc_id; |
96 | } __packed req; | 96 | } __packed req; |
97 | /* response */ | 97 | /* response */ |
98 | struct { | 98 | struct { |
99 | /* response identifier */ | 99 | /* response identifier */ |
100 | uint16_t proc_id; | 100 | __le16 proc_id; |
101 | /* error */ | 101 | /* error */ |
102 | uint8_t error; | 102 | uint8_t error; |
103 | } __packed rsp; | 103 | } __packed rsp; |
@@ -107,12 +107,12 @@ union as10x_turn_off { | |||
107 | /* request */ | 107 | /* request */ |
108 | struct { | 108 | struct { |
109 | /* request identifier */ | 109 | /* request identifier */ |
110 | uint16_t proc_id; | 110 | __le16 proc_id; |
111 | } __packed req; | 111 | } __packed req; |
112 | /* response */ | 112 | /* response */ |
113 | struct { | 113 | struct { |
114 | /* response identifier */ | 114 | /* response identifier */ |
115 | uint16_t proc_id; | 115 | __le16 proc_id; |
116 | /* error */ | 116 | /* error */ |
117 | uint8_t err; | 117 | uint8_t err; |
118 | } __packed rsp; | 118 | } __packed rsp; |
@@ -122,14 +122,14 @@ union as10x_set_tune { | |||
122 | /* request */ | 122 | /* request */ |
123 | struct { | 123 | struct { |
124 | /* request identifier */ | 124 | /* request identifier */ |
125 | uint16_t proc_id; | 125 | __le16 proc_id; |
126 | /* tune params */ | 126 | /* tune params */ |
127 | struct as10x_tune_args args; | 127 | struct as10x_tune_args args; |
128 | } __packed req; | 128 | } __packed req; |
129 | /* response */ | 129 | /* response */ |
130 | struct { | 130 | struct { |
131 | /* response identifier */ | 131 | /* response identifier */ |
132 | uint16_t proc_id; | 132 | __le16 proc_id; |
133 | /* response error */ | 133 | /* response error */ |
134 | uint8_t error; | 134 | uint8_t error; |
135 | } __packed rsp; | 135 | } __packed rsp; |
@@ -139,12 +139,12 @@ union as10x_get_tune_status { | |||
139 | /* request */ | 139 | /* request */ |
140 | struct { | 140 | struct { |
141 | /* request identifier */ | 141 | /* request identifier */ |
142 | uint16_t proc_id; | 142 | __le16 proc_id; |
143 | } __packed req; | 143 | } __packed req; |
144 | /* response */ | 144 | /* response */ |
145 | struct { | 145 | struct { |
146 | /* response identifier */ | 146 | /* response identifier */ |
147 | uint16_t proc_id; | 147 | __le16 proc_id; |
148 | /* response error */ | 148 | /* response error */ |
149 | uint8_t error; | 149 | uint8_t error; |
150 | /* tune status */ | 150 | /* tune status */ |
@@ -156,12 +156,12 @@ union as10x_get_tps { | |||
156 | /* request */ | 156 | /* request */ |
157 | struct { | 157 | struct { |
158 | /* request identifier */ | 158 | /* request identifier */ |
159 | uint16_t proc_id; | 159 | __le16 proc_id; |
160 | } __packed req; | 160 | } __packed req; |
161 | /* response */ | 161 | /* response */ |
162 | struct { | 162 | struct { |
163 | /* response identifier */ | 163 | /* response identifier */ |
164 | uint16_t proc_id; | 164 | __le16 proc_id; |
165 | /* response error */ | 165 | /* response error */ |
166 | uint8_t error; | 166 | uint8_t error; |
167 | /* tps details */ | 167 | /* tps details */ |
@@ -173,12 +173,12 @@ union as10x_common { | |||
173 | /* request */ | 173 | /* request */ |
174 | struct { | 174 | struct { |
175 | /* request identifier */ | 175 | /* request identifier */ |
176 | uint16_t proc_id; | 176 | __le16 proc_id; |
177 | } __packed req; | 177 | } __packed req; |
178 | /* response */ | 178 | /* response */ |
179 | struct { | 179 | struct { |
180 | /* response identifier */ | 180 | /* response identifier */ |
181 | uint16_t proc_id; | 181 | __le16 proc_id; |
182 | /* response error */ | 182 | /* response error */ |
183 | uint8_t error; | 183 | uint8_t error; |
184 | } __packed rsp; | 184 | } __packed rsp; |
@@ -188,9 +188,9 @@ union as10x_add_pid_filter { | |||
188 | /* request */ | 188 | /* request */ |
189 | struct { | 189 | struct { |
190 | /* request identifier */ | 190 | /* request identifier */ |
191 | uint16_t proc_id; | 191 | __le16 proc_id; |
192 | /* PID to filter */ | 192 | /* PID to filter */ |
193 | uint16_t pid; | 193 | __le16 pid; |
194 | /* stream type (MPE, PSI/SI or PES )*/ | 194 | /* stream type (MPE, PSI/SI or PES )*/ |
195 | uint8_t stream_type; | 195 | uint8_t stream_type; |
196 | /* PID index in filter table */ | 196 | /* PID index in filter table */ |
@@ -199,7 +199,7 @@ union as10x_add_pid_filter { | |||
199 | /* response */ | 199 | /* response */ |
200 | struct { | 200 | struct { |
201 | /* response identifier */ | 201 | /* response identifier */ |
202 | uint16_t proc_id; | 202 | __le16 proc_id; |
203 | /* response error */ | 203 | /* response error */ |
204 | uint8_t error; | 204 | uint8_t error; |
205 | /* Filter id */ | 205 | /* Filter id */ |
@@ -211,14 +211,14 @@ union as10x_del_pid_filter { | |||
211 | /* request */ | 211 | /* request */ |
212 | struct { | 212 | struct { |
213 | /* request identifier */ | 213 | /* request identifier */ |
214 | uint16_t proc_id; | 214 | __le16 proc_id; |
215 | /* PID to remove */ | 215 | /* PID to remove */ |
216 | uint16_t pid; | 216 | __le16 pid; |
217 | } __packed req; | 217 | } __packed req; |
218 | /* response */ | 218 | /* response */ |
219 | struct { | 219 | struct { |
220 | /* response identifier */ | 220 | /* response identifier */ |
221 | uint16_t proc_id; | 221 | __le16 proc_id; |
222 | /* response error */ | 222 | /* response error */ |
223 | uint8_t error; | 223 | uint8_t error; |
224 | } __packed rsp; | 224 | } __packed rsp; |
@@ -228,12 +228,12 @@ union as10x_start_streaming { | |||
228 | /* request */ | 228 | /* request */ |
229 | struct { | 229 | struct { |
230 | /* request identifier */ | 230 | /* request identifier */ |
231 | uint16_t proc_id; | 231 | __le16 proc_id; |
232 | } __packed req; | 232 | } __packed req; |
233 | /* response */ | 233 | /* response */ |
234 | struct { | 234 | struct { |
235 | /* response identifier */ | 235 | /* response identifier */ |
236 | uint16_t proc_id; | 236 | __le16 proc_id; |
237 | /* error */ | 237 | /* error */ |
238 | uint8_t error; | 238 | uint8_t error; |
239 | } __packed rsp; | 239 | } __packed rsp; |
@@ -243,12 +243,12 @@ union as10x_stop_streaming { | |||
243 | /* request */ | 243 | /* request */ |
244 | struct { | 244 | struct { |
245 | /* request identifier */ | 245 | /* request identifier */ |
246 | uint16_t proc_id; | 246 | __le16 proc_id; |
247 | } __packed req; | 247 | } __packed req; |
248 | /* response */ | 248 | /* response */ |
249 | struct { | 249 | struct { |
250 | /* response identifier */ | 250 | /* response identifier */ |
251 | uint16_t proc_id; | 251 | __le16 proc_id; |
252 | /* error */ | 252 | /* error */ |
253 | uint8_t error; | 253 | uint8_t error; |
254 | } __packed rsp; | 254 | } __packed rsp; |
@@ -258,12 +258,12 @@ union as10x_get_demod_stats { | |||
258 | /* request */ | 258 | /* request */ |
259 | struct { | 259 | struct { |
260 | /* request identifier */ | 260 | /* request identifier */ |
261 | uint16_t proc_id; | 261 | __le16 proc_id; |
262 | } __packed req; | 262 | } __packed req; |
263 | /* response */ | 263 | /* response */ |
264 | struct { | 264 | struct { |
265 | /* response identifier */ | 265 | /* response identifier */ |
266 | uint16_t proc_id; | 266 | __le16 proc_id; |
267 | /* error */ | 267 | /* error */ |
268 | uint8_t error; | 268 | uint8_t error; |
269 | /* demod stats */ | 269 | /* demod stats */ |
@@ -275,12 +275,12 @@ union as10x_get_impulse_resp { | |||
275 | /* request */ | 275 | /* request */ |
276 | struct { | 276 | struct { |
277 | /* request identifier */ | 277 | /* request identifier */ |
278 | uint16_t proc_id; | 278 | __le16 proc_id; |
279 | } __packed req; | 279 | } __packed req; |
280 | /* response */ | 280 | /* response */ |
281 | struct { | 281 | struct { |
282 | /* response identifier */ | 282 | /* response identifier */ |
283 | uint16_t proc_id; | 283 | __le16 proc_id; |
284 | /* error */ | 284 | /* error */ |
285 | uint8_t error; | 285 | uint8_t error; |
286 | /* impulse response ready */ | 286 | /* impulse response ready */ |
@@ -292,22 +292,22 @@ union as10x_fw_context { | |||
292 | /* request */ | 292 | /* request */ |
293 | struct { | 293 | struct { |
294 | /* request identifier */ | 294 | /* request identifier */ |
295 | uint16_t proc_id; | 295 | __le16 proc_id; |
296 | /* value to write (for set context)*/ | 296 | /* value to write (for set context)*/ |
297 | struct as10x_register_value reg_val; | 297 | struct as10x_register_value reg_val; |
298 | /* context tag */ | 298 | /* context tag */ |
299 | uint16_t tag; | 299 | __le16 tag; |
300 | /* context request type */ | 300 | /* context request type */ |
301 | uint16_t type; | 301 | __le16 type; |
302 | } __packed req; | 302 | } __packed req; |
303 | /* response */ | 303 | /* response */ |
304 | struct { | 304 | struct { |
305 | /* response identifier */ | 305 | /* response identifier */ |
306 | uint16_t proc_id; | 306 | __le16 proc_id; |
307 | /* value read (for get context) */ | 307 | /* value read (for get context) */ |
308 | struct as10x_register_value reg_val; | 308 | struct as10x_register_value reg_val; |
309 | /* context request type */ | 309 | /* context request type */ |
310 | uint16_t type; | 310 | __le16 type; |
311 | /* error */ | 311 | /* error */ |
312 | uint8_t error; | 312 | uint8_t error; |
313 | } __packed rsp; | 313 | } __packed rsp; |
@@ -317,7 +317,7 @@ union as10x_set_register { | |||
317 | /* request */ | 317 | /* request */ |
318 | struct { | 318 | struct { |
319 | /* response identifier */ | 319 | /* response identifier */ |
320 | uint16_t proc_id; | 320 | __le16 proc_id; |
321 | /* register description */ | 321 | /* register description */ |
322 | struct as10x_register_addr reg_addr; | 322 | struct as10x_register_addr reg_addr; |
323 | /* register content */ | 323 | /* register content */ |
@@ -326,7 +326,7 @@ union as10x_set_register { | |||
326 | /* response */ | 326 | /* response */ |
327 | struct { | 327 | struct { |
328 | /* response identifier */ | 328 | /* response identifier */ |
329 | uint16_t proc_id; | 329 | __le16 proc_id; |
330 | /* error */ | 330 | /* error */ |
331 | uint8_t error; | 331 | uint8_t error; |
332 | } __packed rsp; | 332 | } __packed rsp; |
@@ -336,14 +336,14 @@ union as10x_get_register { | |||
336 | /* request */ | 336 | /* request */ |
337 | struct { | 337 | struct { |
338 | /* response identifier */ | 338 | /* response identifier */ |
339 | uint16_t proc_id; | 339 | __le16 proc_id; |
340 | /* register description */ | 340 | /* register description */ |
341 | struct as10x_register_addr reg_addr; | 341 | struct as10x_register_addr reg_addr; |
342 | } __packed req; | 342 | } __packed req; |
343 | /* response */ | 343 | /* response */ |
344 | struct { | 344 | struct { |
345 | /* response identifier */ | 345 | /* response identifier */ |
346 | uint16_t proc_id; | 346 | __le16 proc_id; |
347 | /* error */ | 347 | /* error */ |
348 | uint8_t error; | 348 | uint8_t error; |
349 | /* register content */ | 349 | /* register content */ |
@@ -355,24 +355,24 @@ union as10x_cfg_change_mode { | |||
355 | /* request */ | 355 | /* request */ |
356 | struct { | 356 | struct { |
357 | /* request identifier */ | 357 | /* request identifier */ |
358 | uint16_t proc_id; | 358 | __le16 proc_id; |
359 | /* mode */ | 359 | /* mode */ |
360 | uint8_t mode; | 360 | uint8_t mode; |
361 | } __packed req; | 361 | } __packed req; |
362 | /* response */ | 362 | /* response */ |
363 | struct { | 363 | struct { |
364 | /* response identifier */ | 364 | /* response identifier */ |
365 | uint16_t proc_id; | 365 | __le16 proc_id; |
366 | /* error */ | 366 | /* error */ |
367 | uint8_t error; | 367 | uint8_t error; |
368 | } __packed rsp; | 368 | } __packed rsp; |
369 | } __packed; | 369 | } __packed; |
370 | 370 | ||
371 | struct as10x_cmd_header_t { | 371 | struct as10x_cmd_header_t { |
372 | uint16_t req_id; | 372 | __le16 req_id; |
373 | uint16_t prog; | 373 | __le16 prog; |
374 | uint16_t version; | 374 | __le16 version; |
375 | uint16_t data_len; | 375 | __le16 data_len; |
376 | } __packed; | 376 | } __packed; |
377 | 377 | ||
378 | #define DUMP_BLOCK_SIZE 16 | 378 | #define DUMP_BLOCK_SIZE 16 |
@@ -381,18 +381,18 @@ union as10x_dump_memory { | |||
381 | /* request */ | 381 | /* request */ |
382 | struct { | 382 | struct { |
383 | /* request identifier */ | 383 | /* request identifier */ |
384 | uint16_t proc_id; | 384 | __le16 proc_id; |
385 | /* dump memory type request */ | 385 | /* dump memory type request */ |
386 | uint8_t dump_req; | 386 | uint8_t dump_req; |
387 | /* register description */ | 387 | /* register description */ |
388 | struct as10x_register_addr reg_addr; | 388 | struct as10x_register_addr reg_addr; |
389 | /* nb blocks to read */ | 389 | /* nb blocks to read */ |
390 | uint16_t num_blocks; | 390 | __le16 num_blocks; |
391 | } __packed req; | 391 | } __packed req; |
392 | /* response */ | 392 | /* response */ |
393 | struct { | 393 | struct { |
394 | /* response identifier */ | 394 | /* response identifier */ |
395 | uint16_t proc_id; | 395 | __le16 proc_id; |
396 | /* error */ | 396 | /* error */ |
397 | uint8_t error; | 397 | uint8_t error; |
398 | /* dump response */ | 398 | /* dump response */ |
@@ -400,8 +400,8 @@ union as10x_dump_memory { | |||
400 | /* data */ | 400 | /* data */ |
401 | union { | 401 | union { |
402 | uint8_t data8[DUMP_BLOCK_SIZE]; | 402 | uint8_t data8[DUMP_BLOCK_SIZE]; |
403 | uint16_t data16[DUMP_BLOCK_SIZE / sizeof(uint16_t)]; | 403 | __le16 data16[DUMP_BLOCK_SIZE / sizeof(__le16)]; |
404 | uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; | 404 | __le32 data32[DUMP_BLOCK_SIZE / sizeof(__le32)]; |
405 | } __packed u; | 405 | } __packed u; |
406 | } __packed rsp; | 406 | } __packed rsp; |
407 | } __packed; | 407 | } __packed; |
@@ -409,13 +409,13 @@ union as10x_dump_memory { | |||
409 | union as10x_dumplog_memory { | 409 | union as10x_dumplog_memory { |
410 | struct { | 410 | struct { |
411 | /* request identifier */ | 411 | /* request identifier */ |
412 | uint16_t proc_id; | 412 | __le16 proc_id; |
413 | /* dump memory type request */ | 413 | /* dump memory type request */ |
414 | uint8_t dump_req; | 414 | uint8_t dump_req; |
415 | } __packed req; | 415 | } __packed req; |
416 | struct { | 416 | struct { |
417 | /* request identifier */ | 417 | /* request identifier */ |
418 | uint16_t proc_id; | 418 | __le16 proc_id; |
419 | /* error */ | 419 | /* error */ |
420 | uint8_t error; | 420 | uint8_t error; |
421 | /* dump response */ | 421 | /* dump response */ |
@@ -428,13 +428,13 @@ union as10x_dumplog_memory { | |||
428 | union as10x_raw_data { | 428 | union as10x_raw_data { |
429 | /* request */ | 429 | /* request */ |
430 | struct { | 430 | struct { |
431 | uint16_t proc_id; | 431 | __le16 proc_id; |
432 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) | 432 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) |
433 | - 2 /* proc_id */]; | 433 | - 2 /* proc_id */]; |
434 | } __packed req; | 434 | } __packed req; |
435 | /* response */ | 435 | /* response */ |
436 | struct { | 436 | struct { |
437 | uint16_t proc_id; | 437 | __le16 proc_id; |
438 | uint8_t error; | 438 | uint8_t error; |
439 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) | 439 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) |
440 | - 2 /* proc_id */ - 1 /* rc */]; | 440 | - 2 /* proc_id */ - 1 /* rc */]; |
diff --git a/drivers/media/usb/as102/as10x_cmd_cfg.c b/drivers/media/usb/as102/as10x_cmd_cfg.c index 6f9dea1d860b..c87f2ca223a2 100644 --- a/drivers/media/usb/as102/as10x_cmd_cfg.c +++ b/drivers/media/usb/as102/as10x_cmd_cfg.c | |||
@@ -69,7 +69,7 @@ int as10x_cmd_get_context(struct as10x_bus_adapter_t *adap, uint16_t tag, | |||
69 | 69 | ||
70 | if (error == 0) { | 70 | if (error == 0) { |
71 | /* Response OK -> get response data */ | 71 | /* Response OK -> get response data */ |
72 | *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); | 72 | *pvalue = le32_to_cpu((__force __le32)prsp->body.context.rsp.reg_val.u.value32); |
73 | /* value returned is always a 32-bit value */ | 73 | /* value returned is always a 32-bit value */ |
74 | } | 74 | } |
75 | 75 | ||
@@ -101,7 +101,7 @@ int as10x_cmd_set_context(struct as10x_bus_adapter_t *adap, uint16_t tag, | |||
101 | /* fill command */ | 101 | /* fill command */ |
102 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); | 102 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); |
103 | /* pcmd->body.context.req.reg_val.mode initialization is not required */ | 103 | /* pcmd->body.context.req.reg_val.mode initialization is not required */ |
104 | pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); | 104 | pcmd->body.context.req.reg_val.u.value32 = (__force u32)cpu_to_le32(value); |
105 | pcmd->body.context.req.tag = cpu_to_le16(tag); | 105 | pcmd->body.context.req.tag = cpu_to_le16(tag); |
106 | pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); | 106 | pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); |
107 | 107 | ||