diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2011-10-31 11:24:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 05:43:46 -0400 |
commit | e2e02ca48878e78393f09a47918501a3a4b374b4 (patch) | |
tree | 38b69e6fb0044acb937e9e6ce3bb18ec8a117e52 /drivers/staging | |
parent | c7a6c00194c05a30fecc84e101d4b9c8d44cffc9 (diff) |
[media] staging: as102: Fix CodingStyle errors in file as10x_cmd_cfg.c
Fix Linux kernel coding style (whitespace and indentation) errors
in file as10x_cmd_cfg.c. No functional changes.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Piotr Chmura <chmooreck@poczta.onet.pl>
Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/as102/as10x_cmd_cfg.c | 262 |
1 files changed, 130 insertions, 132 deletions
diff --git a/drivers/staging/media/as102/as10x_cmd_cfg.c b/drivers/staging/media/as102/as10x_cmd_cfg.c index e3a0f90936d..7b22e190c70 100644 --- a/drivers/staging/media/as102/as10x_cmd_cfg.c +++ b/drivers/staging/media/as102/as10x_cmd_cfg.c | |||
@@ -2,8 +2,6 @@ | |||
2 | 2 | ||
3 | \file as10x_cmd_cfg.c | 3 | \file as10x_cmd_cfg.c |
4 | 4 | ||
5 | \version $Id$ | ||
6 | |||
7 | \author: S. Martinelli | 5 | \author: S. Martinelli |
8 | 6 | ||
9 | ----------------------------------------------------------------------------\n | 7 | ----------------------------------------------------------------------------\n |
@@ -22,7 +20,8 @@ | |||
22 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
23 | #include "as102_drv.h" | 21 | #include "as102_drv.h" |
24 | #elif defined(WIN32) | 22 | #elif defined(WIN32) |
25 | #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) /* win32 ddk implementation */ | 23 | #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) |
24 | /* win32 ddk implementation */ | ||
26 | #include "wdm.h" | 25 | #include "wdm.h" |
27 | #include "Device.h" | 26 | #include "Device.h" |
28 | #include "endian_mgmt.h" /* FIXME */ | 27 | #include "endian_mgmt.h" /* FIXME */ |
@@ -59,52 +58,52 @@ | |||
59 | int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag, | 58 | int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag, |
60 | uint32_t *pvalue) | 59 | uint32_t *pvalue) |
61 | { | 60 | { |
62 | int error; | 61 | int error; |
63 | struct as10x_cmd_t *pcmd, *prsp; | 62 | struct as10x_cmd_t *pcmd, *prsp; |
64 | 63 | ||
65 | ENTER(); | 64 | ENTER(); |
66 | 65 | ||
67 | pcmd = phandle->cmd; | 66 | pcmd = phandle->cmd; |
68 | prsp = phandle->rsp; | 67 | prsp = phandle->rsp; |
69 | 68 | ||
70 | /* prepare command */ | 69 | /* prepare command */ |
71 | as10x_cmd_build(pcmd, (++phandle->cmd_xid), | 70 | as10x_cmd_build(pcmd, (++phandle->cmd_xid), |
72 | sizeof(pcmd->body.context.req)); | 71 | sizeof(pcmd->body.context.req)); |
73 | 72 | ||
74 | /* fill command */ | 73 | /* fill command */ |
75 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); | 74 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); |
76 | pcmd->body.context.req.tag = cpu_to_le16(tag); | 75 | pcmd->body.context.req.tag = cpu_to_le16(tag); |
77 | pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA); | 76 | pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA); |
78 | 77 | ||
79 | /* send command */ | 78 | /* send command */ |
80 | if(phandle->ops->xfer_cmd) { | 79 | if (phandle->ops->xfer_cmd) { |
81 | error = phandle->ops->xfer_cmd(phandle, | 80 | error = phandle->ops->xfer_cmd(phandle, |
82 | (uint8_t *) pcmd, | 81 | (uint8_t *) pcmd, |
83 | sizeof(pcmd->body.context.req) + HEADER_SIZE, | 82 | sizeof(pcmd->body.context.req) |
84 | (uint8_t *) prsp, | 83 | + HEADER_SIZE, |
85 | sizeof(prsp->body.context.rsp) + HEADER_SIZE); | 84 | (uint8_t *) prsp, |
86 | } | 85 | sizeof(prsp->body.context.rsp) |
87 | else{ | 86 | + HEADER_SIZE); |
88 | error = AS10X_CMD_ERROR; | 87 | } else { |
89 | } | 88 | error = AS10X_CMD_ERROR; |
90 | 89 | } | |
91 | if(error < 0) { | 90 | |
92 | goto out; | 91 | if (error < 0) |
93 | } | 92 | goto out; |
94 | 93 | ||
95 | /* parse response: context command do not follow the common response */ | 94 | /* parse response: context command do not follow the common response */ |
96 | /* structure -> specific handling response parse required */ | 95 | /* structure -> specific handling response parse required */ |
97 | error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); | 96 | error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); |
98 | 97 | ||
99 | if(error == 0) { | 98 | if (error == 0) { |
100 | /* Response OK -> get response data */ | 99 | /* Response OK -> get response data */ |
101 | *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); | 100 | *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); |
102 | /* value returned is always a 32-bit value */ | 101 | /* value returned is always a 32-bit value */ |
103 | } | 102 | } |
104 | 103 | ||
105 | out: | 104 | out: |
106 | LEAVE(); | 105 | LEAVE(); |
107 | return(error); | 106 | return error; |
108 | } | 107 | } |
109 | 108 | ||
110 | /** | 109 | /** |
@@ -118,47 +117,48 @@ out: | |||
118 | int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag, | 117 | int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag, |
119 | uint32_t value) | 118 | uint32_t value) |
120 | { | 119 | { |
121 | int error; | 120 | int error; |
122 | struct as10x_cmd_t *pcmd, *prsp; | 121 | struct as10x_cmd_t *pcmd, *prsp; |
123 | 122 | ||
124 | ENTER(); | 123 | ENTER(); |
125 | 124 | ||
126 | pcmd = phandle->cmd; | 125 | pcmd = phandle->cmd; |
127 | prsp = phandle->rsp; | 126 | prsp = phandle->rsp; |
128 | 127 | ||
129 | /* prepare command */ | 128 | /* prepare command */ |
130 | as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.context.req)); | 129 | as10x_cmd_build(pcmd, (++phandle->cmd_xid), |
131 | 130 | sizeof(pcmd->body.context.req)); | |
132 | /* fill command */ | 131 | |
133 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); | 132 | /* fill command */ |
134 | /* pcmd->body.context.req.reg_val.mode initialization is not required */ | 133 | pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); |
135 | pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); | 134 | /* pcmd->body.context.req.reg_val.mode initialization is not required */ |
136 | pcmd->body.context.req.tag = cpu_to_le16(tag); | 135 | pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); |
137 | pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); | 136 | pcmd->body.context.req.tag = cpu_to_le16(tag); |
138 | 137 | pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); | |
139 | /* send command */ | 138 | |
140 | if(phandle->ops->xfer_cmd){ | 139 | /* send command */ |
141 | error = phandle->ops->xfer_cmd(phandle, | 140 | if (phandle->ops->xfer_cmd) { |
142 | (uint8_t *) pcmd, | 141 | error = phandle->ops->xfer_cmd(phandle, |
143 | sizeof(pcmd->body.context.req) + HEADER_SIZE, | 142 | (uint8_t *) pcmd, |
144 | (uint8_t *) prsp, | 143 | sizeof(pcmd->body.context.req) |
145 | sizeof(prsp->body.context.rsp) + HEADER_SIZE); | 144 | + HEADER_SIZE, |
146 | } | 145 | (uint8_t *) prsp, |
147 | else{ | 146 | sizeof(prsp->body.context.rsp) |
148 | error = AS10X_CMD_ERROR; | 147 | + HEADER_SIZE); |
149 | } | 148 | } else { |
150 | 149 | error = AS10X_CMD_ERROR; | |
151 | if(error < 0) { | 150 | } |
152 | goto out; | 151 | |
153 | } | 152 | if (error < 0) |
154 | 153 | goto out; | |
155 | /* parse response: context command do not follow the common response */ | 154 | |
156 | /* structure -> specific handling response parse required */ | 155 | /* parse response: context command do not follow the common response */ |
157 | error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); | 156 | /* structure -> specific handling response parse required */ |
157 | error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); | ||
158 | 158 | ||
159 | out: | 159 | out: |
160 | LEAVE(); | 160 | LEAVE(); |
161 | return(error); | 161 | return error; |
162 | } | 162 | } |
163 | 163 | ||
164 | /** | 164 | /** |
@@ -175,45 +175,43 @@ out: | |||
175 | */ | 175 | */ |
176 | int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode) | 176 | int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode) |
177 | { | 177 | { |
178 | int error; | 178 | int error; |
179 | struct as10x_cmd_t *pcmd, *prsp; | 179 | struct as10x_cmd_t *pcmd, *prsp; |
180 | 180 | ||
181 | ENTER(); | 181 | ENTER(); |
182 | 182 | ||
183 | pcmd = phandle->cmd; | 183 | pcmd = phandle->cmd; |
184 | prsp = phandle->rsp; | 184 | prsp = phandle->rsp; |
185 | 185 | ||
186 | /* prepare command */ | 186 | /* prepare command */ |
187 | as10x_cmd_build(pcmd, (++phandle->cmd_xid), | 187 | as10x_cmd_build(pcmd, (++phandle->cmd_xid), |
188 | sizeof(pcmd->body.cfg_change_mode.req)); | 188 | sizeof(pcmd->body.cfg_change_mode.req)); |
189 | 189 | ||
190 | /* fill command */ | 190 | /* fill command */ |
191 | pcmd->body.cfg_change_mode.req.proc_id = | 191 | pcmd->body.cfg_change_mode.req.proc_id = |
192 | cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE); | 192 | cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE); |
193 | pcmd->body.cfg_change_mode.req.mode = mode; | 193 | pcmd->body.cfg_change_mode.req.mode = mode; |
194 | 194 | ||
195 | /* send command */ | 195 | /* send command */ |
196 | if(phandle->ops->xfer_cmd){ | 196 | if (phandle->ops->xfer_cmd) { |
197 | error = phandle->ops->xfer_cmd(phandle, | 197 | error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd, |
198 | (uint8_t *) pcmd, | 198 | sizeof(pcmd->body.cfg_change_mode.req) |
199 | sizeof(pcmd->body.cfg_change_mode.req) + HEADER_SIZE, | 199 | + HEADER_SIZE, (uint8_t *) prsp, |
200 | (uint8_t *) prsp, | 200 | sizeof(prsp->body.cfg_change_mode.rsp) |
201 | sizeof(prsp->body.cfg_change_mode.rsp) + HEADER_SIZE); | 201 | + HEADER_SIZE); |
202 | } | 202 | } else { |
203 | else{ | 203 | error = AS10X_CMD_ERROR; |
204 | error = AS10X_CMD_ERROR; | 204 | } |
205 | } | 205 | |
206 | 206 | if (error < 0) | |
207 | if(error < 0) { | 207 | goto out; |
208 | goto out; | 208 | |
209 | } | 209 | /* parse response */ |
210 | 210 | error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP); | |
211 | /* parse response */ | ||
212 | error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP); | ||
213 | 211 | ||
214 | out: | 212 | out: |
215 | LEAVE(); | 213 | LEAVE(); |
216 | return(error); | 214 | return error; |
217 | } | 215 | } |
218 | 216 | ||
219 | /** | 217 | /** |
@@ -225,15 +223,15 @@ out: | |||
225 | ABILIS_RC_NOK | 223 | ABILIS_RC_NOK |
226 | \callgraph | 224 | \callgraph |
227 | */ | 225 | */ |
228 | int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id) { | 226 | int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id) |
229 | 227 | { | |
230 | int err; | 228 | int err; |
231 | 229 | ||
232 | err = prsp->body.context.rsp.error; | 230 | err = prsp->body.context.rsp.error; |
233 | 231 | ||
234 | if((err == 0) && | 232 | if ((err == 0) && |
235 | (le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) { | 233 | (le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) { |
236 | return 0; | 234 | return 0; |
237 | } | 235 | } |
238 | return AS10X_CMD_ERROR; | 236 | return AS10X_CMD_ERROR; |
239 | } | 237 | } |