From 7c1618227e6932fcd92597507ee63c01da73e623 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sat, 31 Jul 2010 15:55:22 -0300 Subject: [PATCH] [media] saa7164: code cleanup Removed some previous debugging code, whitespace cleanup and spurious comments. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7164/saa7164-buffer.c | 1 - drivers/media/video/saa7164/saa7164-core.c | 39 +-------------------------- drivers/media/video/saa7164/saa7164-encoder.c | 8 ------ drivers/media/video/saa7164/saa7164.h | 8 ------ 4 files changed, 1 insertion(+), 55 deletions(-) diff --git a/drivers/media/video/saa7164/saa7164-buffer.c b/drivers/media/video/saa7164/saa7164-buffer.c index c7bd81e..5f45ea7 100644 --- a/drivers/media/video/saa7164/saa7164-buffer.c +++ b/drivers/media/video/saa7164/saa7164-buffer.c @@ -241,7 +241,6 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port) dprintk(DBGLVL_BUF, "%s(port=%d)\n", __func__, port->nr); - port->counter = 0; saa7164_writel(port->bufcounter, 0); saa7164_writel(port->pitch, params->pitch); saa7164_writel(port->bufsize, params->pitch * params->numberoflines); diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c index eb9c345..b54b032 100644 --- a/drivers/media/video/saa7164/saa7164-core.c +++ b/drivers/media/video/saa7164/saa7164-core.c @@ -363,10 +363,6 @@ static void saa7164_work_enchandler(struct work_struct *w) printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); break; } - - /* Process a buffer */ - if (port->nr == SAA7164_PORT_ENC1) - printk(KERN_ERR "Port enc1 processing buffer %d\n", rp); saa7164_work_enchandler_helper(port, rp); port->last_svc_rp = rp; cnt++; @@ -375,15 +371,13 @@ static void saa7164_work_enchandler(struct work_struct *w) break; } - if (port->nr == SAA7164_PORT_ENC1) - printk(KERN_ERR "Enc1 processed %d buffers for port %p\n", cnt, port); - if (print_histogram == port->nr) { saa7164_histogram_print(port, &port->irq_interval); saa7164_histogram_print(port, &port->svc_interval); saa7164_histogram_print(port, &port->irq_svc_interval); saa7164_histogram_print(port, &port->read_interval); saa7164_histogram_print(port, &port->poll_interval); + /* TODO: fix this to preserve any previous state */ print_histogram = 64 + port->nr; } } @@ -766,7 +760,6 @@ static int get_resources(struct saa7164_dev *dev) static int saa7164_port_init(struct saa7164_dev *dev, int portnr) { struct saa7164_port *port = 0; - int i; if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) BUG(); @@ -805,18 +798,6 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr) saa7164_histogram_reset(&port->poll_interval, "encoder poll() intervals"); - if (port->type == SAA7164_MPEG_ENCODER) { - for (i = 0; i < 8; i ++) { - port->shadow_buf[i] = kzalloc(256 * 128, GFP_KERNEL); - if (port->shadow_buf[i] == 0) - printk(KERN_ERR "%s() shadow_buf ENOMEM\n", __func__); - else { - memset(port->shadow_buf[i], 0xff, 256 * 128); - port->shadow_crc[i] = crc32(0, port->shadow_buf[i], 256 * 128); - } - } - } - return 0; } @@ -1094,8 +1075,6 @@ static void saa7164_shutdown(struct saa7164_dev *dev) static void __devexit saa7164_finidev(struct pci_dev *pci_dev) { struct saa7164_dev *dev = pci_get_drvdata(pci_dev); - struct saa7164_port *port; - int i; saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ], &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval); @@ -1110,22 +1089,6 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev) saa7164_shutdown(dev); - port = &dev->ports[ SAA7164_PORT_ENC1 ]; - if (port->type == SAA7164_MPEG_ENCODER) { - for (i = 0; i < 8; i ++) { - kfree(port->shadow_buf[i]); - port->shadow_buf[i] = 0; - } - } - port = &dev->ports[ SAA7164_PORT_ENC2 ]; - if (port->type == SAA7164_MPEG_ENCODER) { - for (i = 0; i < 8; i ++) { - kfree(port->shadow_buf[i]); - port->shadow_buf[i] = 0; - } - } - - if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]); diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c index b904c61..08b62e4 100644 --- a/drivers/media/video/saa7164/saa7164-encoder.c +++ b/drivers/media/video/saa7164/saa7164-encoder.c @@ -1008,7 +1008,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) struct saa7164_user_buffer *buf = 0; struct saa7164_dev *dev = port->dev; u32 crc; - u32 *d; mutex_lock(&port->dmaqueue_lock); if (!list_empty(&port->list_buf_used.list)) { @@ -1021,13 +1020,6 @@ struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) buf, buf->crc, crc); } - d = (u32 *)buf->data; - - if ((*d & 0xffffff) > (port->read_counter + 0x2000)) - printk(KERN_ERR "%s() *d 0x%x port %p\n", __func__, *d, port); - - port->read_counter = *d; - } mutex_unlock(&port->dmaqueue_lock); diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h index 9c76e65..71e3853 100644 --- a/drivers/media/video/saa7164/saa7164.h +++ b/drivers/media/video/saa7164/saa7164.h @@ -378,8 +378,6 @@ struct saa7164_port { struct saa7164_encoder_params encoder_params; struct video_device *v4l_device; atomic_t v4l_reader_count; -// spinlock_t slock; -// struct mutex fops_lock; struct saa7164_buffer list_buf_used; struct saa7164_buffer list_buf_free; @@ -391,12 +389,6 @@ struct saa7164_port { u32 a_cc_errors; u8 last_v_cc; u8 last_a_cc; - - u8 *shadow_buf[8]; - u32 shadow_crc[8]; - - u32 counter; - u32 read_counter; }; struct saa7164_dev { -- 2.7.4