1. 21 7月, 2017 1 次提交
    • G
      media: dib8000: constify i2c_algorithm structure · 28e83542
      Gustavo A. R. Silva 提交于
      Check for i2c_algorithm structures that are only stored in
      the algo field of an i2c_adapter structure. This field is
      declared const, so i2c_algorithm structures that have this
      property can be declared as const also.
      
      This issue was identified using Coccinelle and the following
      semantic patch:
      
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct i2c_algorithm i@p = { ... };
      
      @ok@
      identifier r.i;
      struct i2c_adapter e;
      position p;
      @@
      e.algo = &i@p;
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct i2c_algorithm i = { ... };
      Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      28e83542
  2. 18 11月, 2016 1 次提交
  3. 05 2月, 2016 1 次提交
  4. 25 1月, 2016 1 次提交
  5. 10 6月, 2015 1 次提交
    • M
      [media] dvb: Get rid of typedev usage for enums · 0df289a2
      Mauro Carvalho Chehab 提交于
      The DVB API was originally defined using typedefs. This is against
      Kernel CodingStyle, and there's no good usage here. While we can't
      remove its usage on userspace, we can avoid its usage in Kernelspace.
      
      So, let's do it.
      
      This patch was generated by this shell script:
      
      	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done
      
      While here, make CodingStyle fixes on the affected lines.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
      0df289a2
  6. 02 2月, 2015 1 次提交
    • M
      [media] dib8000: upd_demod_gain_period should be u32 · 901c4ad6
      Mauro Carvalho Chehab 提交于
      X-Patchwork-Delegate: m.chehab@samsung.com
      As shown at the code, upd_demod_gain_period is used to write
      to two 16-bit registers:
          dib8000_write_word(state, 1946, upd_demod_gain_period & 0xFFFF);
          dib8000_write_word(state, 1947, reg | (1<<14) | ((upd_demod_gain_period >> 16) & 0xFF));
      
      So, it should be declared as u32.
      
      This fixes the following smatch warning:
      	drivers/media/dvb-frontends/dib8000.c:1282 dib8000_agc_startup() warn: right shifting more than type allows
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      901c4ad6
  7. 07 7月, 2014 12 次提交
  8. 17 6月, 2014 2 次提交
    • M
      [media] dib8000: export just one symbol · d44913c1
      Mauro Carvalho Chehab 提交于
      Exporting multiple symbols don't work as it causes compilation
      breakages, due to the way dvb_attach() works.
      
      The bug happens when:
              CONFIG_DVB_DIB8000=m
      	CONFIG_DVB_USB_DIB0700=y
      
      As a bonus, dib8000 won't be loaded anymore if the device uses
      a different frontend, reducing the memory footprint.
      
      Tested with both Pixelview PV-D231 and MyGica S870.
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      d44913c1
    • M
      [media] dib8000: rename dib8000_attach to dib8000_init · b9bc7d59
      Mauro Carvalho Chehab 提交于
      Well, what we call as "foo_attach" is the method that should
      be called by the dvb_attach() macro.
      
      It should be noticed that the name "dvb_attach" is really a
      bad name and don't express what it does.
      
      dvb_attach() basically does three things, if the frontend is
      compiled as a module:
      - It lookups for the module that it is known to have the
        given symbol name and requests such module;
      - It increments the module usage (anonymously - so lsmod
        doesn't print who loaded the module);
      - after loading the module, it runs the function associated
        with the dynamic symbol.
      
      When compiled as builtin, it just calls the function given to it.
      
      As dvb_attach() increments refcount, it can't be (easily)
      called more than once for the same module, or the kernel
      will deny to remove the module, because refcount will never
      be zeroed.
      
      In other words, the function name given to dvb_attach()
      should be one single symbol that will always be called
      before any other function on that module to be used.
      
      For almost all DVB frontends, there's just one function,
      but, on dib8000, there are several exported symbols.
      
      We need to get rid of all those direct calls, because they
      cause compilation breakages when bridge is builtin and
      frontend is module, we'll need to add a new function that
      will be the first one to be called, whatever initialization
      is needed.
      
      So, let's rename this function, in order to prepare for
      a next patch that will add a new attach() function that
      will be the only one exported by this module.
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b9bc7d59
  9. 14 1月, 2014 2 次提交
  10. 20 12月, 2013 1 次提交
  11. 19 12月, 2013 11 次提交
  12. 10 12月, 2013 1 次提交
  13. 30 11月, 2013 1 次提交
  14. 09 6月, 2013 1 次提交
  15. 26 4月, 2013 2 次提交
    • M
      [media] dib8000: fix a warning · 13122f98
      Mauro Carvalho Chehab 提交于
      drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_wait_lock':
      drivers/media/dvb-frontends/dib8000.c:3972:1: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
      drivers/media/dvb-frontends/dib8000.c:2419:6: note: 'value' was declared here
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      13122f98
    • M
      [media] dib8000: Fix sub-channel range · 746f7ae0
      Mauro Carvalho Chehab 提交于
      isdbt_sb_subchannel is unsigned with 8 bits. So, it will
      never be -1. Instead, any value bigger than 13 is invalid.
      
      As is, the current code generates the following warnings:
      
      drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_set_isdbt_common_channel':
      drivers/media/dvb-frontends/dib8000.c:2358:3: warning: comparison is always true due to limited range of data type [-Wtype-limits]
      drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_tune':
      drivers/media/dvb-frontends/dib8000.c:3107:8: warning: comparison is always false due to limited range of data type [-Wtype-limits]
      drivers/media/dvb-frontends/dib8000.c:3153:9: warning: comparison is always false due to limited range of data type [-Wtype-limits]
      drivers/media/dvb-frontends/dib8000.c:3160:5: warning: comparison is always false
      
      It should also be noticed that ARIB STD-B31, item
      "3.15.6.8 Number of segments" at TMCC table defines the
      value 15 for unused segment, and 14 as reserved.
      
      So, better to change the check to consider any value
      bigger than 13 to mean that sub-channels should be
      disabled, fixing the warning and doing the right thing
      even if an invalid value is filled by userspace.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      746f7ae0
  16. 25 4月, 2013 1 次提交
    • M
      [media] dib8000: store dtv_property_cache in a temp var · c82056d0
      Mauro Carvalho Chehab 提交于
      dtv_property_cache is used on several places on very long lines.
      
      On all places it is used, a long list of struct reference is done.
      
      Instead of doing it, at the routines where it is used more than once,
      replace it by one temporary var. That may help the compiler to
      use a better code. It also makes easier to review the code, as the
      lines becomes closer to 80 columns, making them a way clearer
      to read.
      
      No functional changes.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c82056d0