Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
60b3b4d2 c8d185ce

+14 -20
-2
drivers/media/pci/cx25821/cx25821-cards.c
··· 45 45 }, 46 46 47 47 }; 48 - 49 - const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
+10 -8
drivers/media/pci/cx25821/cx25821-medusa-video.c
··· 438 438 decoder_count = decoder_select + 1; 439 439 } else { 440 440 decoder = 0; 441 - decoder_count = _num_decoders; 441 + decoder_count = dev->_max_num_decoders; 442 442 } 443 443 444 444 switch (width) { ··· 505 505 disp_cnt_reg = DISP_GH_CNT; 506 506 break; 507 507 } 508 - 509 - _display_field_cnt[decoder] = duration; 510 508 511 509 /* update hardware */ 512 510 fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp); ··· 665 667 int ret_val = 0; 666 668 int i = 0; 667 669 668 - _num_decoders = dev->_max_num_decoders; 669 - 670 670 /* disable Auto source selection on all video decoders */ 671 671 value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp); 672 672 value &= 0xFFFFF0FF; ··· 681 685 if (ret_val < 0) 682 686 goto error; 683 687 684 - for (i = 0; i < _num_decoders; i++) 685 - medusa_set_decoderduration(dev, i, _display_field_cnt[i]); 688 + /* 689 + * FIXME: due to a coding bug the duration was always 0. It's 690 + * likely that it really should be something else, but due to the 691 + * lack of documentation I have no idea what it should be. For 692 + * now just fill in 0 as the duration. 693 + */ 694 + for (i = 0; i < dev->_max_num_decoders; i++) 695 + medusa_set_decoderduration(dev, i, 0); 686 696 687 697 /* Select monitor as DENC A input, power up the DAC */ 688 698 value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp); ··· 719 717 /* Turn on all of the data out and control output pins. */ 720 718 value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp); 721 719 value &= 0xFEF0FE00; 722 - if (_num_decoders == MAX_DECODERS) { 720 + if (dev->_max_num_decoders == MAX_DECODERS) { 723 721 /* 724 722 * Note: The octal board does not support control pins(bit16-19) 725 723 * These bits are ignored in the octal board.
-6
drivers/media/pci/cx25821/cx25821-medusa-video.h
··· 40 40 #define CONTRAST_DEFAULT 5000 41 41 #define HUE_DEFAULT 5000 42 42 43 - unsigned short _num_decoders; 44 - unsigned short _num_cameras; 45 - 46 - unsigned int _video_standard; 47 - int _display_field_cnt[MAX_DECODERS]; 48 - 49 43 #endif
+4 -4
drivers/media/pci/cx25821/cx25821-video-upstream.c
··· 159 159 * For the upstream video channel, the risc engine will enable 160 160 * the FIFO. */ 161 161 if (fifo_enable && line == 3) { 162 - *(rp++) = RISC_WRITECR; 163 - *(rp++) = sram_ch->dma_ctl; 164 - *(rp++) = FLD_VID_FIFO_EN; 165 - *(rp++) = 0x00000001; 162 + *(rp++) = cpu_to_le32(RISC_WRITECR); 163 + *(rp++) = cpu_to_le32(sram_ch->dma_ctl); 164 + *(rp++) = cpu_to_le32(FLD_VID_FIFO_EN); 165 + *(rp++) = cpu_to_le32(0x00000001); 166 166 } 167 167 } 168 168