aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-10-04 10:01:51 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-10-17 05:16:46 -0400
commit60b3b4d2de93f0bfa59dbd3104f2f40afd630d1c (patch)
tree8c2818fc54e70f87aeee92aeb6d30c5eeadcee37 /drivers/media/pci
parentc8d185ce33ecd560275f76c590fda4cdba824bd9 (diff)
[media] cx25821: fix sparse warnings
drivers/media/pci/cx25821/cx25821-cards.c:49:20: warning: symbol 'cx25821_bcount' was not declared. Should it be static? drivers/media/pci/cx25821/cx25821-video-upstream.c:162:33: warning: incorrect type in assignment (different base types) drivers/media/pci/cx25821/cx25821-video-upstream.c:163:33: warning: incorrect type in assignment (different base types) drivers/media/pci/cx25821/cx25821-video-upstream.c:164:33: warning: incorrect type in assignment (different base types) drivers/media/pci/cx25821/cx25821-video-upstream.c:165:33: warning: incorrect type in assignment (different base types) drivers/media/pci/cx25821/cx25821-medusa-video.h:43:16: warning: symbol '_num_decoders' was not declared. Should it be static? drivers/media/pci/cx25821/cx25821-medusa-video.h:44:16: warning: symbol '_num_cameras' was not declared. Should it be static? drivers/media/pci/cx25821/cx25821-medusa-video.h:46:14: warning: symbol '_video_standard' was not declared. Should it be static? drivers/media/pci/cx25821/cx25821-medusa-video.h:47:5: warning: symbol '_display_field_cnt' was not declared. Should it be static? After analyzing the last four warnings carefully it became clear that these variables were really completely unused. As a result of that the call to medusa_set_decoderduration() is now dubious since the duration is always 0. Without documentation, however, I can't tell what the right value is. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/cx25821/cx25821-cards.c2
-rw-r--r--drivers/media/pci/cx25821/cx25821-medusa-video.c18
-rw-r--r--drivers/media/pci/cx25821/cx25821-medusa-video.h6
-rw-r--r--drivers/media/pci/cx25821/cx25821-video-upstream.c8
4 files changed, 14 insertions, 20 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-cards.c b/drivers/media/pci/cx25821/cx25821-cards.c
index 3b409feb03d8..f2ebc989b303 100644
--- a/drivers/media/pci/cx25821/cx25821-cards.c
+++ b/drivers/media/pci/cx25821/cx25821-cards.c
@@ -45,5 +45,3 @@ struct cx25821_board cx25821_boards[] = {
45 }, 45 },
46 46
47}; 47};
48
49const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.c b/drivers/media/pci/cx25821/cx25821-medusa-video.c
index 22fa04415ccc..43bdfa4dfba1 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.c
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c
@@ -438,7 +438,7 @@ void medusa_set_resolution(struct cx25821_dev *dev, int width,
438 decoder_count = decoder_select + 1; 438 decoder_count = decoder_select + 1;
439 } else { 439 } else {
440 decoder = 0; 440 decoder = 0;
441 decoder_count = _num_decoders; 441 decoder_count = dev->_max_num_decoders;
442 } 442 }
443 443
444 switch (width) { 444 switch (width) {
@@ -506,8 +506,6 @@ static void medusa_set_decoderduration(struct cx25821_dev *dev, int decoder,
506 break; 506 break;
507 } 507 }
508 508
509 _display_field_cnt[decoder] = duration;
510
511 /* update hardware */ 509 /* update hardware */
512 fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp); 510 fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp);
513 511
@@ -667,8 +665,6 @@ int medusa_video_init(struct cx25821_dev *dev)
667 int ret_val = 0; 665 int ret_val = 0;
668 int i = 0; 666 int i = 0;
669 667
670 _num_decoders = dev->_max_num_decoders;
671
672 /* disable Auto source selection on all video decoders */ 668 /* disable Auto source selection on all video decoders */
673 value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp); 669 value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp);
674 value &= 0xFFFFF0FF; 670 value &= 0xFFFFF0FF;
@@ -685,8 +681,14 @@ int medusa_video_init(struct cx25821_dev *dev)
685 if (ret_val < 0) 681 if (ret_val < 0)
686 goto error; 682 goto error;
687 683
688 for (i = 0; i < _num_decoders; i++) 684 /*
689 medusa_set_decoderduration(dev, i, _display_field_cnt[i]); 685 * FIXME: due to a coding bug the duration was always 0. It's
686 * likely that it really should be something else, but due to the
687 * lack of documentation I have no idea what it should be. For
688 * now just fill in 0 as the duration.
689 */
690 for (i = 0; i < dev->_max_num_decoders; i++)
691 medusa_set_decoderduration(dev, i, 0);
690 692
691 /* Select monitor as DENC A input, power up the DAC */ 693 /* Select monitor as DENC A input, power up the DAC */
692 value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp); 694 value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp);
@@ -717,7 +719,7 @@ int medusa_video_init(struct cx25821_dev *dev)
717 /* Turn on all of the data out and control output pins. */ 719 /* Turn on all of the data out and control output pins. */
718 value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp); 720 value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp);
719 value &= 0xFEF0FE00; 721 value &= 0xFEF0FE00;
720 if (_num_decoders == MAX_DECODERS) { 722 if (dev->_max_num_decoders == MAX_DECODERS) {
721 /* 723 /*
722 * Note: The octal board does not support control pins(bit16-19) 724 * Note: The octal board does not support control pins(bit16-19)
723 * These bits are ignored in the octal board. 725 * These bits are ignored in the octal board.
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.h b/drivers/media/pci/cx25821/cx25821-medusa-video.h
index 6175e0961855..8bf602ff27b1 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.h
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.h
@@ -40,10 +40,4 @@
40#define CONTRAST_DEFAULT 5000 40#define CONTRAST_DEFAULT 5000
41#define HUE_DEFAULT 5000 41#define HUE_DEFAULT 5000
42 42
43unsigned short _num_decoders;
44unsigned short _num_cameras;
45
46unsigned int _video_standard;
47int _display_field_cnt[MAX_DECODERS];
48
49#endif 43#endif
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c
index 88ffef410c50..1f43be0b04c8 100644
--- a/drivers/media/pci/cx25821/cx25821-video-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c
@@ -159,10 +159,10 @@ static __le32 *cx25821_risc_field_upstream(struct cx25821_channel *chan, __le32
159 * For the upstream video channel, the risc engine will enable 159 * For the upstream video channel, the risc engine will enable
160 * the FIFO. */ 160 * the FIFO. */
161 if (fifo_enable && line == 3) { 161 if (fifo_enable && line == 3) {
162 *(rp++) = RISC_WRITECR; 162 *(rp++) = cpu_to_le32(RISC_WRITECR);
163 *(rp++) = sram_ch->dma_ctl; 163 *(rp++) = cpu_to_le32(sram_ch->dma_ctl);
164 *(rp++) = FLD_VID_FIFO_EN; 164 *(rp++) = cpu_to_le32(FLD_VID_FIFO_EN);
165 *(rp++) = 0x00000001; 165 *(rp++) = cpu_to_le32(0x00000001);
166 } 166 }
167 } 167 }
168 168