aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164/saa7164-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-11 16:17:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:55:26 -0400
commit4d270cfb36683f623f2c23f96b695deb1812476e (patch)
tree4ab8017b0fa150d1d2b2078ce694cac903db1809 /drivers/media/video/saa7164/saa7164-core.c
parent5cecdc813b864bb89382f8dd67e75398cd8dfd43 (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-core.c')
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index 903d880d63f4..46c2fb2ecf5e 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -825,8 +825,8 @@ void saa7164_dumpregs(struct saa7164_dev *dev, u32 addr)
825 825
826static void saa7164_dump_hwdesc(struct saa7164_dev *dev) 826static void saa7164_dump_hwdesc(struct saa7164_dev *dev)
827{ 827{
828 dprintk(1, "@0x%p hwdesc sizeof(tmComResHWDescr_t) = %d bytes\n", 828 dprintk(1, "@0x%p hwdesc sizeof(struct tmComResHWDescr) = %d bytes\n",
829 &dev->hwdesc, (u32)sizeof(tmComResHWDescr_t)); 829 &dev->hwdesc, (u32)sizeof(struct tmComResHWDescr));
830 830
831 dprintk(1, " .bLength = 0x%x\n", dev->hwdesc.bLength); 831 dprintk(1, " .bLength = 0x%x\n", dev->hwdesc.bLength);
832 dprintk(1, " .bDescriptorType = 0x%x\n", dev->hwdesc.bDescriptorType); 832 dprintk(1, " .bDescriptorType = 0x%x\n", dev->hwdesc.bDescriptorType);
@@ -856,8 +856,8 @@ static void saa7164_dump_hwdesc(struct saa7164_dev *dev)
856static void saa7164_dump_intfdesc(struct saa7164_dev *dev) 856static void saa7164_dump_intfdesc(struct saa7164_dev *dev)
857{ 857{
858 dprintk(1, "@0x%p intfdesc " 858 dprintk(1, "@0x%p intfdesc "
859 "sizeof(tmComResInterfaceDescr_t) = %d bytes\n", 859 "sizeof(struct tmComResInterfaceDescr) = %d bytes\n",
860 &dev->intfdesc, (u32)sizeof(tmComResInterfaceDescr_t)); 860 &dev->intfdesc, (u32)sizeof(struct tmComResInterfaceDescr));
861 861
862 dprintk(1, " .bLength = 0x%x\n", dev->intfdesc.bLength); 862 dprintk(1, " .bLength = 0x%x\n", dev->intfdesc.bLength);
863 dprintk(1, " .bDescriptorType = 0x%x\n", dev->intfdesc.bDescriptorType); 863 dprintk(1, " .bDescriptorType = 0x%x\n", dev->intfdesc.bDescriptorType);
@@ -877,8 +877,8 @@ static void saa7164_dump_intfdesc(struct saa7164_dev *dev)
877 877
878static void saa7164_dump_busdesc(struct saa7164_dev *dev) 878static void saa7164_dump_busdesc(struct saa7164_dev *dev)
879{ 879{
880 dprintk(1, "@0x%p busdesc sizeof(tmComResBusDescr_t) = %d bytes\n", 880 dprintk(1, "@0x%p busdesc sizeof(struct tmComResBusDescr) = %d bytes\n",
881 &dev->busdesc, (u32)sizeof(tmComResBusDescr_t)); 881 &dev->busdesc, (u32)sizeof(struct tmComResBusDescr));
882 882
883 dprintk(1, " .CommandRing = 0x%016Lx\n", dev->busdesc.CommandRing); 883 dprintk(1, " .CommandRing = 0x%016Lx\n", dev->busdesc.CommandRing);
884 dprintk(1, " .ResponseRing = 0x%016Lx\n", dev->busdesc.ResponseRing); 884 dprintk(1, " .ResponseRing = 0x%016Lx\n", dev->busdesc.ResponseRing);
@@ -895,23 +895,23 @@ static void saa7164_dump_busdesc(struct saa7164_dev *dev)
895 */ 895 */
896static void saa7164_get_descriptors(struct saa7164_dev *dev) 896static void saa7164_get_descriptors(struct saa7164_dev *dev)
897{ 897{
898 memcpy_fromio(&dev->hwdesc, dev->bmmio, sizeof(tmComResHWDescr_t)); 898 memcpy_fromio(&dev->hwdesc, dev->bmmio, sizeof(struct tmComResHWDescr));
899 memcpy_fromio(&dev->intfdesc, dev->bmmio + sizeof(tmComResHWDescr_t), 899 memcpy_fromio(&dev->intfdesc, dev->bmmio + sizeof(struct tmComResHWDescr),
900 sizeof(tmComResInterfaceDescr_t)); 900 sizeof(struct tmComResInterfaceDescr));
901 memcpy_fromio(&dev->busdesc, dev->bmmio + dev->intfdesc.BARLocation, 901 memcpy_fromio(&dev->busdesc, dev->bmmio + dev->intfdesc.BARLocation,
902 sizeof(tmComResBusDescr_t)); 902 sizeof(struct tmComResBusDescr));
903 903
904 if (dev->hwdesc.bLength != sizeof(tmComResHWDescr_t)) { 904 if (dev->hwdesc.bLength != sizeof(struct tmComResHWDescr)) {
905 printk(KERN_ERR "Structure tmComResHWDescr_t is mangled\n"); 905 printk(KERN_ERR "Structure struct tmComResHWDescr is mangled\n");
906 printk(KERN_ERR "Need %x got %d\n", dev->hwdesc.bLength, 906 printk(KERN_ERR "Need %x got %d\n", dev->hwdesc.bLength,
907 (u32)sizeof(tmComResHWDescr_t)); 907 (u32)sizeof(struct tmComResHWDescr));
908 } else 908 } else
909 saa7164_dump_hwdesc(dev); 909 saa7164_dump_hwdesc(dev);
910 910
911 if (dev->intfdesc.bLength != sizeof(tmComResInterfaceDescr_t)) { 911 if (dev->intfdesc.bLength != sizeof(struct tmComResInterfaceDescr)) {
912 printk(KERN_ERR "struct tmComResInterfaceDescr_t is mangled\n"); 912 printk(KERN_ERR "struct struct tmComResInterfaceDescr is mangled\n");
913 printk(KERN_ERR "Need %x got %d\n", dev->intfdesc.bLength, 913 printk(KERN_ERR "Need %x got %d\n", dev->intfdesc.bLength,
914 (u32)sizeof(tmComResInterfaceDescr_t)); 914 (u32)sizeof(struct tmComResInterfaceDescr));
915 } else 915 } else
916 saa7164_dump_intfdesc(dev); 916 saa7164_dump_intfdesc(dev);
917 917
@@ -1101,7 +1101,7 @@ static void saa7164_dev_unregister(struct saa7164_dev *dev)
1101static int saa7164_proc_show(struct seq_file *m, void *v) 1101static int saa7164_proc_show(struct seq_file *m, void *v)
1102{ 1102{
1103 struct saa7164_dev *dev; 1103 struct saa7164_dev *dev;
1104 tmComResBusInfo_t *b; 1104 struct tmComResBusInfo *b;
1105 struct list_head *list; 1105 struct list_head *list;
1106 int i, c; 1106 int i, c;
1107 1107
@@ -1191,7 +1191,7 @@ static int saa7164_proc_create(void)
1191static int saa7164_thread_function(void *data) 1191static int saa7164_thread_function(void *data)
1192{ 1192{
1193 struct saa7164_dev *dev = data; 1193 struct saa7164_dev *dev = data;
1194 tmFwInfoStruct_t fwinfo; 1194 struct tmFwInfoStruct fwinfo;
1195 u64 last_poll_time = 0; 1195 u64 last_poll_time = 0;
1196 1196
1197 dprintk(DBGLVL_THR, "thread started\n"); 1197 dprintk(DBGLVL_THR, "thread started\n");