diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-11 16:17:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:55:26 -0400 |
commit | 4d270cfb36683f623f2c23f96b695deb1812476e (patch) | |
tree | 4ab8017b0fa150d1d2b2078ce694cac903db1809 /drivers/media/video/saa7164/saa7164-cmd.c | |
parent | 5cecdc813b864bb89382f8dd67e75398cd8dfd43 (diff) |
[media] saa7164: Don't use typedefs
According with CodingStyle, drivers shouldn't use typedef, except on very
special cases. This is not the case of saa7164. So, convert all usecases
to struct/enum.
After changing the saa7164-types.h, all we need to do is to run those scripts
to fix all occurrences of the bad types and double check/fix everything that
might be broken after the test (of course, I did a small script to generate those scripts).
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmBusType_t/enum tmBusType/; print " \>a \&\& mv a tmBusType; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResCmd_t/enum tmComResCmd/; print " \>a \&\& mv a tmComResCmd; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTermType_t/enum tmComResTermType/; print " \>a \&\& mv a tmComResTermType; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmBufferFlag_t/enum tmBufferFlag/; print " \>a \&\& mv a tmBufferFlag; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResHWDescr_t/struct tmComResHWDescr/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResInterfaceDescr_t/struct tmComResInterfaceDescr/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResBusDescr_t/struct tmComResBusDescr/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmBusType_t/struct tmBusType/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResBusInfo_t/struct tmComResBusInfo/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResInfo_t/struct tmComResInfo/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResCmd_t/struct tmComResCmd/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmDescriptor_t/struct tmDescriptor/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResDescrHeader_t/struct tmComResDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResExtDevDescrHeader_t/struct tmComResExtDevDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResGPIO_t/struct tmComResGPIO/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResPathDescrHeader_t/struct tmComResPathDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTermType_t/struct tmComResTermType/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResAntTermDescrHeader_t/struct tmComResAntTermDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTunerDescrHeader_t/struct tmComResTunerDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmBufferFlag_t/struct tmBufferFlag/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmBuffer_t/struct tmBuffer/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmHWStreamParameters_t/struct tmHWStreamParameters/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmStreamParameters_t/struct tmStreamParameters/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResDMATermDescrHeader_t/struct tmComResDMATermDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTSFormatDescrHeader_t/struct tmComResTSFormatDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResSelDescrHeader_t/struct tmComResSelDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResProcDescrHeader_t/struct tmComResProcDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResEncVideoBitRate_t/struct tmComResEncVideoBitRate/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResEncVideoInputAspectRatio_t/struct tmComResEncVideoInputAspectRatio/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResEncVideoGopStructure_t/struct tmComResEncVideoGopStructure/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResEncoderDescrHeader_t/struct tmComResEncoderDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResAFeatureDescrHeader_t/struct tmComResAFeatureDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResAudioDefaults_t/struct tmComResAudioDefaults/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResEncAudioBitRate_t/struct tmComResEncAudioBitRate/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTunerStandard_t/struct tmComResTunerStandard/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResTunerStandardAuto_t/struct tmComResTunerStandardAuto/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResPSFormatDescrHeader_t/struct tmComResPSFormatDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResVBIFormatDescrHeader_t/struct tmComResVBIFormatDescrHeader/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResProbeCommit_t/struct tmComResProbeCommit/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResDebugSetLevel_t/struct tmComResDebugSetLevel/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmComResDebugGetData_t/struct tmComResDebugGetData/g; print " $i >a && mv a $i; done
for i in drivers/media/video/saa7164/*.[ch]; do perl -ne "s/tmFwInfoStruct_t/struct tmFwInfoStruct/g; print " $i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-cmd.c')
-rw-r--r-- | drivers/media/video/saa7164/saa7164-cmd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/video/saa7164/saa7164-cmd.c b/drivers/media/video/saa7164/saa7164-cmd.c index e4ec44f5c7cc..301a9e302f45 100644 --- a/drivers/media/video/saa7164/saa7164-cmd.c +++ b/drivers/media/video/saa7164/saa7164-cmd.c | |||
@@ -92,7 +92,7 @@ int saa7164_irq_dequeue(struct saa7164_dev *dev) | |||
92 | do { | 92 | do { |
93 | 93 | ||
94 | /* Peek the msg bus */ | 94 | /* Peek the msg bus */ |
95 | tmComResInfo_t tRsp = { 0, 0, 0, 0, 0, 0 }; | 95 | struct tmComResInfo tRsp = { 0, 0, 0, 0, 0, 0 }; |
96 | ret = saa7164_bus_get(dev, &tRsp, NULL, 1); | 96 | ret = saa7164_bus_get(dev, &tRsp, NULL, 1); |
97 | if (ret != SAA_OK) | 97 | if (ret != SAA_OK) |
98 | break; | 98 | break; |
@@ -143,7 +143,7 @@ int saa7164_cmd_dequeue(struct saa7164_dev *dev) | |||
143 | 143 | ||
144 | while (loop) { | 144 | while (loop) { |
145 | 145 | ||
146 | tmComResInfo_t tRsp = { 0, 0, 0, 0, 0, 0 }; | 146 | struct tmComResInfo tRsp = { 0, 0, 0, 0, 0, 0 }; |
147 | ret = saa7164_bus_get(dev, &tRsp, NULL, 1); | 147 | ret = saa7164_bus_get(dev, &tRsp, NULL, 1); |
148 | if (ret == SAA_ERR_EMPTY) | 148 | if (ret == SAA_ERR_EMPTY) |
149 | return SAA_OK; | 149 | return SAA_OK; |
@@ -186,9 +186,9 @@ int saa7164_cmd_dequeue(struct saa7164_dev *dev) | |||
186 | return SAA_OK; | 186 | return SAA_OK; |
187 | } | 187 | } |
188 | 188 | ||
189 | int saa7164_cmd_set(struct saa7164_dev *dev, tmComResInfo_t* msg, void *buf) | 189 | int saa7164_cmd_set(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf) |
190 | { | 190 | { |
191 | tmComResBusInfo_t *bus = &dev->bus; | 191 | struct tmComResBusInfo *bus = &dev->bus; |
192 | u8 cmd_sent; | 192 | u8 cmd_sent; |
193 | u16 size, idx; | 193 | u16 size, idx; |
194 | u32 cmds; | 194 | u32 cmds; |
@@ -339,11 +339,11 @@ void saa7164_cmd_signal(struct saa7164_dev *dev, u8 seqno) | |||
339 | mutex_unlock(&dev->lock); | 339 | mutex_unlock(&dev->lock); |
340 | } | 340 | } |
341 | 341 | ||
342 | int saa7164_cmd_send(struct saa7164_dev *dev, u8 id, tmComResCmd_t command, | 342 | int saa7164_cmd_send(struct saa7164_dev *dev, u8 id, enum tmComResCmd command, |
343 | u16 controlselector, u16 size, void *buf) | 343 | u16 controlselector, u16 size, void *buf) |
344 | { | 344 | { |
345 | tmComResInfo_t command_t, *pcommand_t; | 345 | struct tmComResInfo command_t, *pcommand_t; |
346 | tmComResInfo_t response_t, *presponse_t; | 346 | struct tmComResInfo response_t, *presponse_t; |
347 | u8 errdata[256]; | 347 | u8 errdata[256]; |
348 | u16 resp_dsize; | 348 | u16 resp_dsize; |
349 | u16 data_recd; | 349 | u16 data_recd; |