diff options
| author | Sylwester Nawrocki <snjw23@gmail.com> | 2011-11-06 14:31:39 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-08 08:24:44 -0500 |
| commit | c06271e052cd00217a26d5aadfa7cf937eaa97a6 (patch) | |
| tree | a102ba28c4e5933c39776add31c6fa0b4efb1b73 /drivers/staging | |
| parent | 7f033e3354b40fdb5c4c8a15cce733cecd0f963a (diff) | |
[media] staging: as102: Remove unnecessary typedefs
According to the kernel coding rules typedefs should be avoided,
so replace theit occurances with explicit enum/union types.
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
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.h | 127 |
1 files changed, 63 insertions, 64 deletions
diff --git a/drivers/staging/media/as102/as10x_cmd.h b/drivers/staging/media/as102/as10x_cmd.h index 6f837b1545d3..8f13bea5b7ed 100644 --- a/drivers/staging/media/as102/as10x_cmd.h +++ b/drivers/staging/media/as102/as10x_cmd.h | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | /*********************************/ | 52 | /*********************************/ |
| 53 | /* TYPE DEFINITION */ | 53 | /* TYPE DEFINITION */ |
| 54 | /*********************************/ | 54 | /*********************************/ |
| 55 | typedef enum { | 55 | enum control_proc { |
| 56 | CONTROL_PROC_TURNON = 0x0001, | 56 | CONTROL_PROC_TURNON = 0x0001, |
| 57 | CONTROL_PROC_TURNON_RSP = 0x0100, | 57 | CONTROL_PROC_TURNON_RSP = 0x0100, |
| 58 | CONTROL_PROC_SET_REGISTER = 0x0002, | 58 | CONTROL_PROC_SET_REGISTER = 0x0002, |
| @@ -92,11 +92,11 @@ typedef enum { | |||
| 92 | CONTROL_PROC_DUMPLOG_MEMORY_RSP = 0xFE00, | 92 | CONTROL_PROC_DUMPLOG_MEMORY_RSP = 0xFE00, |
| 93 | CONTROL_PROC_TURNOFF = 0x00FF, | 93 | CONTROL_PROC_TURNOFF = 0x00FF, |
| 94 | CONTROL_PROC_TURNOFF_RSP = 0xFF00 | 94 | CONTROL_PROC_TURNOFF_RSP = 0xFF00 |
| 95 | } control_proc; | 95 | }; |
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | #pragma pack(1) | 98 | #pragma pack(1) |
| 99 | typedef union { | 99 | union as10x_turn_on { |
| 100 | /* request */ | 100 | /* request */ |
| 101 | struct { | 101 | struct { |
| 102 | /* request identifier */ | 102 | /* request identifier */ |
| @@ -109,9 +109,9 @@ typedef union { | |||
| 109 | /* error */ | 109 | /* error */ |
| 110 | uint8_t error; | 110 | uint8_t error; |
| 111 | } rsp; | 111 | } rsp; |
| 112 | } TURN_ON; | 112 | }; |
| 113 | 113 | ||
| 114 | typedef union { | 114 | union as10x_turn_off { |
| 115 | /* request */ | 115 | /* request */ |
| 116 | struct { | 116 | struct { |
| 117 | /* request identifier */ | 117 | /* request identifier */ |
| @@ -124,9 +124,9 @@ typedef union { | |||
| 124 | /* error */ | 124 | /* error */ |
| 125 | uint8_t err; | 125 | uint8_t err; |
| 126 | } rsp; | 126 | } rsp; |
| 127 | } TURN_OFF; | 127 | }; |
| 128 | 128 | ||
| 129 | typedef union { | 129 | union as10x_set_tune { |
| 130 | /* request */ | 130 | /* request */ |
| 131 | struct { | 131 | struct { |
| 132 | /* request identifier */ | 132 | /* request identifier */ |
| @@ -141,9 +141,9 @@ typedef union { | |||
| 141 | /* response error */ | 141 | /* response error */ |
| 142 | uint8_t error; | 142 | uint8_t error; |
| 143 | } rsp; | 143 | } rsp; |
| 144 | } SET_TUNE; | 144 | }; |
| 145 | 145 | ||
| 146 | typedef union { | 146 | union as10x_get_tune_status { |
| 147 | /* request */ | 147 | /* request */ |
| 148 | struct { | 148 | struct { |
| 149 | /* request identifier */ | 149 | /* request identifier */ |
| @@ -158,9 +158,9 @@ typedef union { | |||
| 158 | /* tune status */ | 158 | /* tune status */ |
| 159 | struct as10x_tune_status sts; | 159 | struct as10x_tune_status sts; |
| 160 | } rsp; | 160 | } rsp; |
| 161 | } GET_TUNE_STATUS; | 161 | }; |
| 162 | 162 | ||
| 163 | typedef union { | 163 | union as10x_get_tps { |
| 164 | /* request */ | 164 | /* request */ |
| 165 | struct { | 165 | struct { |
| 166 | /* request identifier */ | 166 | /* request identifier */ |
| @@ -175,9 +175,9 @@ typedef union { | |||
| 175 | /* tps details */ | 175 | /* tps details */ |
| 176 | struct as10x_tps tps; | 176 | struct as10x_tps tps; |
| 177 | } rsp; | 177 | } rsp; |
| 178 | } GET_TPS; | 178 | }; |
| 179 | 179 | ||
| 180 | typedef union { | 180 | union as10x_common { |
| 181 | /* request */ | 181 | /* request */ |
| 182 | struct { | 182 | struct { |
| 183 | /* request identifier */ | 183 | /* request identifier */ |
| @@ -190,9 +190,9 @@ typedef union { | |||
| 190 | /* response error */ | 190 | /* response error */ |
| 191 | uint8_t error; | 191 | uint8_t error; |
| 192 | } rsp; | 192 | } rsp; |
| 193 | } COMMON; | 193 | }; |
| 194 | 194 | ||
| 195 | typedef union { | 195 | union as10x_add_pid_filter { |
| 196 | /* request */ | 196 | /* request */ |
| 197 | struct { | 197 | struct { |
| 198 | /* request identifier */ | 198 | /* request identifier */ |
| @@ -213,9 +213,9 @@ typedef union { | |||
| 213 | /* Filter id */ | 213 | /* Filter id */ |
| 214 | uint8_t filter_id; | 214 | uint8_t filter_id; |
| 215 | } rsp; | 215 | } rsp; |
| 216 | } ADD_PID_FILTER; | 216 | }; |
| 217 | 217 | ||
| 218 | typedef union { | 218 | union as10x_del_pid_filter { |
| 219 | /* request */ | 219 | /* request */ |
| 220 | struct { | 220 | struct { |
| 221 | /* request identifier */ | 221 | /* request identifier */ |
| @@ -230,9 +230,9 @@ typedef union { | |||
| 230 | /* response error */ | 230 | /* response error */ |
| 231 | uint8_t error; | 231 | uint8_t error; |
| 232 | } rsp; | 232 | } rsp; |
| 233 | } DEL_PID_FILTER; | 233 | }; |
| 234 | 234 | ||
| 235 | typedef union { | 235 | union as10x_start_streaming { |
| 236 | /* request */ | 236 | /* request */ |
| 237 | struct { | 237 | struct { |
| 238 | /* request identifier */ | 238 | /* request identifier */ |
| @@ -245,9 +245,9 @@ typedef union { | |||
| 245 | /* error */ | 245 | /* error */ |
| 246 | uint8_t error; | 246 | uint8_t error; |
| 247 | } rsp; | 247 | } rsp; |
| 248 | } START_STREAMING; | 248 | }; |
| 249 | 249 | ||
| 250 | typedef union { | 250 | union as10x_stop_streaming { |
| 251 | /* request */ | 251 | /* request */ |
| 252 | struct { | 252 | struct { |
| 253 | /* request identifier */ | 253 | /* request identifier */ |
| @@ -260,9 +260,9 @@ typedef union { | |||
| 260 | /* error */ | 260 | /* error */ |
| 261 | uint8_t error; | 261 | uint8_t error; |
| 262 | } rsp; | 262 | } rsp; |
| 263 | } STOP_STREAMING; | 263 | }; |
| 264 | 264 | ||
| 265 | typedef union { | 265 | union as10x_get_demod_stats { |
| 266 | /* request */ | 266 | /* request */ |
| 267 | struct { | 267 | struct { |
| 268 | /* request identifier */ | 268 | /* request identifier */ |
| @@ -277,9 +277,9 @@ typedef union { | |||
| 277 | /* demod stats */ | 277 | /* demod stats */ |
| 278 | struct as10x_demod_stats stats; | 278 | struct as10x_demod_stats stats; |
| 279 | } rsp; | 279 | } rsp; |
| 280 | } GET_DEMOD_STATS; | 280 | }; |
| 281 | 281 | ||
| 282 | typedef union { | 282 | union as10x_get_impulse_resp { |
| 283 | /* request */ | 283 | /* request */ |
| 284 | struct { | 284 | struct { |
| 285 | /* request identifier */ | 285 | /* request identifier */ |
| @@ -294,9 +294,9 @@ typedef union { | |||
| 294 | /* impulse response ready */ | 294 | /* impulse response ready */ |
| 295 | uint8_t is_ready; | 295 | uint8_t is_ready; |
| 296 | } rsp; | 296 | } rsp; |
| 297 | } GET_IMPULSE_RESP; | 297 | }; |
| 298 | 298 | ||
| 299 | typedef union { | 299 | union as10x_fw_context { |
| 300 | /* request */ | 300 | /* request */ |
| 301 | struct { | 301 | struct { |
| 302 | /* request identifier */ | 302 | /* request identifier */ |
| @@ -319,9 +319,9 @@ typedef union { | |||
| 319 | /* error */ | 319 | /* error */ |
| 320 | uint8_t error; | 320 | uint8_t error; |
| 321 | } rsp; | 321 | } rsp; |
| 322 | } FW_CONTEXT; | 322 | }; |
| 323 | 323 | ||
| 324 | typedef union { | 324 | union as10x_set_register { |
| 325 | /* request */ | 325 | /* request */ |
| 326 | struct { | 326 | struct { |
| 327 | /* response identifier */ | 327 | /* response identifier */ |
| @@ -338,9 +338,9 @@ typedef union { | |||
| 338 | /* error */ | 338 | /* error */ |
| 339 | uint8_t error; | 339 | uint8_t error; |
| 340 | } rsp; | 340 | } rsp; |
| 341 | } SET_REGISTER; | 341 | }; |
| 342 | 342 | ||
| 343 | typedef union { | 343 | union as10x_get_register { |
| 344 | /* request */ | 344 | /* request */ |
| 345 | struct { | 345 | struct { |
| 346 | /* response identifier */ | 346 | /* response identifier */ |
| @@ -357,9 +357,9 @@ typedef union { | |||
| 357 | /* register content */ | 357 | /* register content */ |
| 358 | struct as10x_register_value reg_val; | 358 | struct as10x_register_value reg_val; |
| 359 | } rsp; | 359 | } rsp; |
| 360 | } GET_REGISTER; | 360 | }; |
| 361 | 361 | ||
| 362 | typedef union { | 362 | union as10x_cfg_change_mode { |
| 363 | /* request */ | 363 | /* request */ |
| 364 | struct { | 364 | struct { |
| 365 | /* request identifier */ | 365 | /* request identifier */ |
| @@ -374,7 +374,7 @@ typedef union { | |||
| 374 | /* error */ | 374 | /* error */ |
| 375 | uint8_t error; | 375 | uint8_t error; |
| 376 | } rsp; | 376 | } rsp; |
| 377 | } CFG_CHANGE_MODE; | 377 | }; |
| 378 | 378 | ||
| 379 | struct as10x_cmd_header_t { | 379 | struct as10x_cmd_header_t { |
| 380 | uint16_t req_id; | 380 | uint16_t req_id; |
| @@ -384,7 +384,8 @@ struct as10x_cmd_header_t { | |||
| 384 | }; | 384 | }; |
| 385 | 385 | ||
| 386 | #define DUMP_BLOCK_SIZE 16 | 386 | #define DUMP_BLOCK_SIZE 16 |
| 387 | typedef union { | 387 | |
| 388 | union as10x_dump_memory { | ||
| 388 | /* request */ | 389 | /* request */ |
| 389 | struct { | 390 | struct { |
| 390 | /* request identifier */ | 391 | /* request identifier */ |
| @@ -411,9 +412,9 @@ typedef union { | |||
| 411 | uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; | 412 | uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; |
| 412 | } u; | 413 | } u; |
| 413 | } rsp; | 414 | } rsp; |
| 414 | } DUMP_MEMORY; | 415 | }; |
| 415 | 416 | ||
| 416 | typedef union { | 417 | union as10x_dumplog_memory { |
| 417 | struct { | 418 | struct { |
| 418 | /* request identifier */ | 419 | /* request identifier */ |
| 419 | uint16_t proc_id; | 420 | uint16_t proc_id; |
| @@ -430,9 +431,9 @@ typedef union { | |||
| 430 | /* dump data */ | 431 | /* dump data */ |
| 431 | uint8_t data[DUMP_BLOCK_SIZE]; | 432 | uint8_t data[DUMP_BLOCK_SIZE]; |
| 432 | } rsp; | 433 | } rsp; |
| 433 | } DUMPLOG_MEMORY; | 434 | }; |
| 434 | 435 | ||
| 435 | typedef union { | 436 | union as10x_raw_data { |
| 436 | /* request */ | 437 | /* request */ |
| 437 | struct { | 438 | struct { |
| 438 | uint16_t proc_id; | 439 | uint16_t proc_id; |
| @@ -445,33 +446,31 @@ typedef union { | |||
| 445 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) /* header */ | 446 | uint8_t data[64 - sizeof(struct as10x_cmd_header_t) /* header */ |
| 446 | - 2 /* proc_id */ - 1 /* rc */]; | 447 | - 2 /* proc_id */ - 1 /* rc */]; |
| 447 | } rsp; | 448 | } rsp; |
| 448 | } RAW_DATA; | 449 | }; |
| 449 | 450 | ||
| 450 | struct as10x_cmd_t { | 451 | struct as10x_cmd_t { |
| 451 | /* header */ | 452 | struct as10x_cmd_header_t header; |
| 452 | struct as10x_cmd_header_t header; | 453 | union { |
| 453 | /* body */ | 454 | union as10x_turn_on turn_on; |
| 454 | union { | 455 | union as10x_turn_off turn_off; |
| 455 | TURN_ON turn_on; | 456 | union as10x_set_tune set_tune; |
| 456 | TURN_OFF turn_off; | 457 | union as10x_get_tune_status get_tune_status; |
| 457 | SET_TUNE set_tune; | 458 | union as10x_get_tps get_tps; |
| 458 | GET_TUNE_STATUS get_tune_status; | 459 | union as10x_common common; |
| 459 | GET_TPS get_tps; | 460 | union as10x_add_pid_filter add_pid_filter; |
| 460 | COMMON common; | 461 | union as10x_del_pid_filter del_pid_filter; |
| 461 | ADD_PID_FILTER add_pid_filter; | 462 | union as10x_start_streaming start_streaming; |
| 462 | DEL_PID_FILTER del_pid_filter; | 463 | union as10x_stop_streaming stop_streaming; |
| 463 | START_STREAMING start_streaming; | 464 | union as10x_get_demod_stats get_demod_stats; |
| 464 | STOP_STREAMING stop_streaming; | 465 | union as10x_get_impulse_resp get_impulse_rsp; |
| 465 | GET_DEMOD_STATS get_demod_stats; | 466 | union as10x_fw_context context; |
| 466 | GET_IMPULSE_RESP get_impulse_rsp; | 467 | union as10x_set_register set_register; |
| 467 | FW_CONTEXT context; | 468 | union as10x_get_register get_register; |
| 468 | SET_REGISTER set_register; | 469 | union as10x_cfg_change_mode cfg_change_mode; |
| 469 | GET_REGISTER get_register; | 470 | union as10x_dump_memory dump_memory; |
| 470 | CFG_CHANGE_MODE cfg_change_mode; | 471 | union as10x_dumplog_memory dumplog_memory; |
| 471 | DUMP_MEMORY dump_memory; | 472 | union as10x_raw_data raw_data; |
| 472 | DUMPLOG_MEMORY dumplog_memory; | 473 | } body; |
| 473 | RAW_DATA raw_data; | ||
| 474 | } body; | ||
| 475 | }; | 474 | }; |
| 476 | 475 | ||
| 477 | struct as10x_token_cmd_t { | 476 | struct as10x_token_cmd_t { |
