1. 23 3月, 2018 10 次提交
    • M
      media: cx88: fix two warnings · aea629c1
      Mauro Carvalho Chehab 提交于
      drivers/media/pci/cx88/cx88-alsa.c:295 cx88_alsa_dma_init() warn: argument 3 to %08lx specifier is cast from pointer
      drivers/media/pci/cx88/cx88-alsa.c:669 snd_cx88_wm8775_volume_put() warn: potential negative subtraction from max '65535 - (32768 * left) / right'
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      aea629c1
    • M
      media: solo6x10: simplify the logic at solo_p2m_dma_desc() · 0df305eb
      Mauro Carvalho Chehab 提交于
      The logic with gets a p2m_id is more complex than needed,
      causing false positives with static analyzers:
      
      	drivers/media/pci/solo6x10/solo6x10-p2m.c:81 solo_p2m_dma_desc() error: buffer overflow 'solo_dev->p2m_dev' 4 <= s32max
      
      Make it simpler and use unsigned int.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      0df305eb
    • M
      media: bttv-input: better handle errors at I2C transfer · d3c449e1
      Mauro Carvalho Chehab 提交于
      The error handling logic at get_key_pv951() is a little bit
      akward, with produces this false positive warning:
      
      	drivers/media/pci/bt8xx/bttv-input.c:344 get_key_pv951() error: uninitialized symbol 'b'.
      
      Do a cleanup. As a side effect, it also improves its coding
      style.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      d3c449e1
    • M
      media: tvaudio: improve error handling · b0121ca0
      Mauro Carvalho Chehab 提交于
      The error handling logic at tvaudio is broken on several ways,
      as it doesn't really check right when an error occurs.
      
      Change it to return the proper error code from read/write
      routines and fix the errors on reads.
      
      Shuts up the following warnings:
      	drivers/media/i2c/tvaudio.c:222 chip_read() error: uninitialized symbol 'buffer'.
      	drivers/media/i2c/tvaudio.c:223 chip_read() error: uninitialized symbol 'buffer'.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      b0121ca0
    • M
      media: sp887x: fix a warning · 89d6e45c
      Mauro Carvalho Chehab 提交于
      drivers/media/dvb-frontends/sp887x.c:179 sp887x_initial_setup() error: memcpy() '&buf[2]' too small (30 vs 16384)
      
      This is actually a false alarm, but reverting the check order
      makes not only for humans to review the code, but also cleans
      the warning.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      89d6e45c
    • M
      media: v4l2-ioctl: fix some "too small" warnings · 912d2f82
      Mauro Carvalho Chehab 提交于
      While the code there is right, it produces three false positives:
      	drivers/media/v4l2-core/v4l2-ioctl.c:2868 video_usercopy() error: copy_from_user() 'parg' too small (128 vs 16383)
      	drivers/media/v4l2-core/v4l2-ioctl.c:2868 video_usercopy() error: copy_from_user() 'parg' too small (128 vs 16383)
      	drivers/media/v4l2-core/v4l2-ioctl.c:2876 video_usercopy() error: memset() 'parg' too small (128 vs 16383)
      
      Store the ioctl size on a cache var, in order to suppress those.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      912d2f82
    • M
      media: v4l2-tpg-core: avoid buffer overflows · 1a086879
      Mauro Carvalho Chehab 提交于
      Fix the following warnings:
      	drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1146 gen_twopix() error: buffer overflow 'buf[1]' 8 <= 8
      	drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1152 gen_twopix() error: buffer overflow 'buf[1]' 8 <= 8
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      1a086879
    • M
      media: ov5670: get rid of a series of __be warnings · baa6f19b
      Mauro Carvalho Chehab 提交于
      There are some troubles on this driver with respect to the usage
      of __be16 and __b32 macros:
      
      	drivers/media/i2c/ov5670.c:1857:27: warning: incorrect type in initializer (different base types)
      	drivers/media/i2c/ov5670.c:1857:27:    expected unsigned short [unsigned] [usertype] reg_addr_be
      	drivers/media/i2c/ov5670.c:1857:27:    got restricted __be16 [usertype] <noident>
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
      	drivers/media/i2c/ov5670.c:1901:13: warning: incorrect type in assignment (different base types)
      	drivers/media/i2c/ov5670.c:1901:13:    expected unsigned int [unsigned] [usertype] val
      	drivers/media/i2c/ov5670.c:1901:13:    got restricted __be32 [usertype] <noident>
      
      Fix them.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      baa6f19b
    • M
      media: rca: declare formats var as static · 43d1ed08
      Mauro Carvalho Chehab 提交于
      As warned:
      	drivers/media/platform/rockchip/rga/rga.c:210:16: warning: symbol 'formats' was not declared. Should it be static?
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      43d1ed08
    • M
      media: vpss: fix annotations for vpss_regs_base2 · 8395597f
      Mauro Carvalho Chehab 提交于
      Fix those warnings:
      
      	drivers/media/platform/davinci/vpss.c:510:25: warning: incorrect type in argument 1 (different address spaces)
      	drivers/media/platform/davinci/vpss.c:510:25:    expected void volatile [noderef] <asn:2>*addr
      	drivers/media/platform/davinci/vpss.c:510:25:    got unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
      	drivers/media/platform/davinci/vpss.c:520:34: warning: incorrect type in assignment (different address spaces)
      	drivers/media/platform/davinci/vpss.c:520:34:    expected unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
      	drivers/media/platform/davinci/vpss.c:520:34:    got void [noderef] <asn:2>*
      	drivers/media/platform/davinci/vpss.c:522:54: warning: incorrect type in argument 2 (different address spaces)
      	drivers/media/platform/davinci/vpss.c:522:54:    expected void volatile [noderef] <asn:2>*addr
      	drivers/media/platform/davinci/vpss.c:522:54:    got unsigned int [usertype] *static [toplevel] [assigned] vpss_regs_base2
      
      Weird enough, vpss_regs_base0 and vpss_regs_base1 were
      properly annotated.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      8395597f
  2. 22 3月, 2018 30 次提交