1. 07 Sep, 2020 12 commits
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of -Wsuggest-attribute=format warnings · 72a9ff3b
      Mauro Carvalho Chehab authored
      There are some warnings reported by gcc:
      	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:164:2: warning: function ‘atomisp_css2_dbg_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
      	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
      	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:170:2: warning: function ‘atomisp_css2_dbg_ftrace_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
      	drivers/staging/media/atomisp//pci/atomisp_compat_css20.c:176:2: warning: function ‘atomisp_css2_err_print’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
      	drivers/staging/media/atomisp/pci/sh_css.c:1685:16: warning: assignment left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
      
      That are due to the usage of printf-like messages without
      enabling the error checking logic.
      
      Add the proper attributes in order to shut up such warnings.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      72a9ff3b
    • Mauro Carvalho Chehab's avatar
      media: atomisp: move a static constant out of a header file · b38f7aae
      Mauro Carvalho Chehab authored
      Gcc reports that input_formatter_alignment is not used:
      
      	In file included from ./drivers/staging/media/atomisp//pci/hive_isp_css_include/input_formatter.h:34,
      	                 from drivers/staging/media/atomisp//pci/runtime/debug/src/ia_css_debug.c:55:
      	./drivers/staging/media/atomisp//pci/hive_isp_css_common/host/input_formatter_local.h:118:27: warning: ‘input_formatter_alignment’ defined but not used [-Wunused-const-variable=]
      
      However, it is, but only inside input_formatter.c.
      
      So, move it out of the header file.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b38f7aae
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of unused vars · 852a53a0
      Mauro Carvalho Chehab authored
      There are several vars declared and set but unused:
      
      	drivers/staging/media/atomisp//pci/sh_css_param_shading.c:239:4: warning: variable ‘padded_width’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:1366:24: warning: variable ‘stream’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:2702:22: warning: variable ‘capture_pipe’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:2831:7: warning: variable ‘continuous’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:3534:15: warning: variable ‘num_output_pins’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:3937:55: warning: variable ‘vf_pp_binary’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:3937:38: warning: variable ‘preview_binary’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:3937:24: warning: variable ‘copy_binary’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:3936:26: warning: variable ‘me’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:5749:24: warning: variable ‘copy_binary’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:6013:7: warning: variable ‘continuous’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:6012:7: warning: variable ‘memory’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:7329:24: warning: variable ‘copy_binary’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:7459:26: warning: variable ‘num_vf_pp_stage’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css.c:10420:22: warning: variable ‘pipe_id’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css_params.c:1099:36: warning: variable ‘row_padding’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/sh_css_mipi.c:410:27: warning: variable ‘mipi_intermediate_info’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/atomisp_cmd.c:2814:31: warning: variable ‘stream_config’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/atomisp_cmd.c:2893:31: warning: variable ‘stream_config’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c:237:31: warning: variable ‘isp_data_ptr’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c:119:28: warning: variable ‘ver_num_isp’ set but not used [-Wunused-but-set-variable]
      	drivers/staging/media/atomisp//pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c:119:15: warning: variable ‘hor_num_isp’ set but not used [-Wunused-but-set-variable]
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      852a53a0
    • Mauro Carvalho Chehab's avatar
      media: atomisp: print a warning if error while setting downscaler · 8fae9dd6
      Mauro Carvalho Chehab authored
      As warned by gcc:
      
          drivers/staging/media/atomisp//pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c:237:31: warning: variable ‘isp_data_ptr’ set but not used [-Wunused-but-set-variable]
      
      ia_css_vf_configure() logic has an error var that detects troubles
      when setting the kernel for downscaling. The driver just ignores
      it, without producing any warning. Add at least a warning message
      on such cases.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      8fae9dd6
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of some cleanup leftovers · a80abc94
      Mauro Carvalho Chehab authored
      The code that used to check for ISP2400/2401 version were
      using the revision number in order to decide wheather
      version should be used. With the new version, the code
      doesn't need to check anymore for ISP version.
      
      Fixes: ca133c39 ("media: atomisp: improve device detection code")
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      a80abc94
    • Mauro Carvalho Chehab's avatar
      media: vivid: fix error path · 49a3d74b
      Mauro Carvalho Chehab authored
      If something fails after calling v4l2_device_register(),
      it should call v4l2_device_put().
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      49a3d74b
    • Mauro Carvalho Chehab's avatar
      media: vivid: move the devnode creation logic to a separate function · 62c6b4c9
      Mauro Carvalho Chehab authored
      In order to reduce even further the size of the big
      vivid_create_instance() function, let's place the part of the
      logic which creates the device nodes into a separate function.
      
          With this and the past patches, those warnings finally
          vanishes:
      
                  drivers/media/test-drivers/vivid/vivid-core.c: drivers/media/test-drivers/vivid/vivid-core.c:1189 vivid_create_instance() parse error: turning off implications after 60 seconds
                  drivers/media/test-drivers/vivid/vivid-core.c: drivers/media/test-drivers/vivid/vivid-core.c:1257 vivid_create_instance() parse error: __split_smt: function too hairy.  Giving up after 303 seconds
      
      The init code also seems more organized after breaking the long
      function into a smaller set.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      62c6b4c9
    • Mauro Carvalho Chehab's avatar
      media: vivid: move the create queues to a separate function · faf21f28
      Mauro Carvalho Chehab authored
      Instead of placing everything inside vivid_create_instance(),
      we can move the part which creates per-type video queues
      into a separate function.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      faf21f28
    • Mauro Carvalho Chehab's avatar
      media: vivid: place dt timings init code on a separate function · d92c8e31
      Mauro Carvalho Chehab authored
      Move those out of the big vivid_create_instance() function.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      d92c8e31
    • Mauro Carvalho Chehab's avatar
      media: vivid: move set_capabilities logic to a separate function · 4306c537
      Mauro Carvalho Chehab authored
      Move such logic from vivid_create_instance(), as otherwise
      smatch takes forever.
      
      The vivid_create_instance() is still a too big for my taste.
      So, further cleanups are still needed.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      4306c537
    • Mauro Carvalho Chehab's avatar
      media: vivid: place the logic which disables ioctl on a separate function · fcaeb019
      Mauro Carvalho Chehab authored
      Move this code out of the long vivid_create_instance() function.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      fcaeb019
    • Mauro Carvalho Chehab's avatar
      media: vivid: move the detection part out of vivid_create_instance · 31b97d35
      Mauro Carvalho Chehab authored
      The vivid_create_instance() function is too harry. Smatch can't
      process it, because it takes too long.
      
      The detection part is an important piece of it. As such, there
      are even comments before and after such block.
      
      So, it makes sense to just move it to a separate function.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      31b97d35
  2. 03 Sep, 2020 28 commits
    • Sean Young's avatar
      media: rc: rename ir_lirc_* functions to lirc_* · 75992a44
      Sean Young authored
      Remove pointless ir_ prefix.
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      75992a44
    • Sean Young's avatar
      media: rc: harmonize infrared durations to microseconds · 528222d8
      Sean Young authored
      rc-core kapi uses nanoseconds for infrared durations for receiving, and
      microseconds for sending. The uapi already uses microseconds for both,
      so this patch does not change the uapi.
      
      Infrared durations do not need nanosecond resolution. IR protocols do not
      have durations shorter than about 100 microseconds. Some IR hardware offers
      250 microseconds resolution, which is sufficient for most protocols.
      Better hardware has 50 microsecond resolution and is enough for every
      protocol I am aware off.
      
      Unify on microseconds everywhere. This simplifies the code since less
      conversion between microseconds and nanoseconds needs to be done.
      
      This affects:
       - rx_resolution member of struct rc_dev
       - timeout member of struct rc_dev
       - duration member in struct ir_raw_event
      
      Cc: "Bruno Prémont" <bonbons@linux-vserver.org>
      Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
      Cc: Maxim Levitsky <maximlevitsky@gmail.com>
      Cc: Patrick Lerda <patrick9876@free.fr>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Sean Wang <sean.wang@mediatek.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Cc: "David Härdeman" <david@hardeman.nu>
      Cc: Benjamin Valentin <benpicco@googlemail.com>
      Cc: Antti Palosaari <crope@iki.fi>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      528222d8
    • Sean Young's avatar
      media: rc: rename lirc char dev region to "lirc" · 32c3db3d
      Sean Young authored
      BaseRemoteCtl is not descriptive.
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      32c3db3d
    • Alex Bee's avatar
      media: dvb_usb_pctv452e: use ISL6423 voltage regulator per default · f35e5231
      Alex Bee authored
      Both TT-connect S2-3600 and Pinnacle PCTV Sat HDTV are using
      Intersil ISL6423 as LNB voltage regulator. This makes
      TT-connect S2-3650 CI the only device which uses STM LNBP22 regulator
      which is currently used for all devices driven by pctv452e driver.
      
      This patch fixes this by creating an exception for TT-connect S2-3650 CI
      to continue to use STM LNBP22 while all others now using correct ISL6423
      driver which makes DiSEqC/EN50494 comands which involve voltage changes
      now working on the other devices (which didn't work before).
      Signed-off-by: default avatarAlex Bee <knaerzche@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      f35e5231
    • Jason Yan's avatar
      media: mxl5xx: remove unused including <linux/version.h> · 07be6f4c
      Jason Yan authored
      Fix the following versioncheck warning:
      
      drivers/media/dvb-frontends/mxl5xx.c:30:1: unused including
      <linux/version.h>
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarJason Yan <yanaijie@huawei.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      07be6f4c
    • Mauro Carvalho Chehab's avatar
      media: atomisp: cleanup isys_irq headers · 14eddb0f
      Mauro Carvalho Chehab authored
      Don't need to declare those functions with extern:
      	drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h:51:35:  warning: function 'isys_irqc_state_dump' with external linkage has definition
      	drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h:68:35:  warning: function 'isys_irqc_reg_store' with external linkage has definition
      	drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq_private.h:85:39:  warning: function 'isys_irqc_reg_load' with external linkage has definition
      	drivers/staging/media/atomisp/pci/css_2401_system/host/isys_irq.c:31:35:  warning: function 'isys_irqc_status_enable' with external linkage has definition
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      14eddb0f
    • Mauro Carvalho Chehab's avatar
      media: atomisp: fix some bad indents · c5ea3e43
      Mauro Carvalho Chehab authored
      As smatch reports, there are several bad indents:
      
          drivers/staging/media/atomisp/pci/hmm/hmm.c:271 hmm_alloc() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/runtime/bufq/src/bufq.c:390 ia_css_bufq_enqueue_psys_event() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2132 ia_css_debug_dump_isys_state() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:246 sh_css_binary_get_sc_requirements() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:565 ia_css_binary_get_shading_info_type_1() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/sh_css.c:5109 sh_css_pipes_stop() warn: inconsistent indenting
          drivers/staging/media/atomisp/pci/sh_css.c:8791 ia_css_pipe_create() warn: inconsistent indenting
      
      Some of them are due to ifdefs. Get rid of them by either getting
      a common code that would work for both ISP2400 and ISP2401 or
      by creating separate functions, one for each ISP version.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c5ea3e43
    • Mauro Carvalho Chehab's avatar
      media: atomisp: remove compile-time tests from input_system_global.h · 5ad658c0
      Mauro Carvalho Chehab authored
      Now that there's no duplication between ISP2400 and ISP2401
      input system functions, we can include both at the system
      global.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      5ad658c0
    • Mauro Carvalho Chehab's avatar
      media: atomisp: reorder functions at pixelgen_private.h · 8a8e36fa
      Mauro Carvalho Chehab authored
      Reorder functions in order to declare before usage.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      8a8e36fa
    • Mauro Carvalho Chehab's avatar
      media: atomisp: de-duplicate names at *_input_system_global.h · 284be891
      Mauro Carvalho Chehab authored
      There are some duplicated names between the ISP2401 and ISP2400
      for the input system, with different meanings.
      
      In order to avoid ubiquity, let's prepend those with the
      name of the ISP.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      284be891
    • Mauro Carvalho Chehab's avatar
      media: atomisp: unify INPUT error return type · 39bc26e4
      Mauro Carvalho Chehab authored
      There is a typedef for INPUT errors. This is different between
      ISP2401 and ISP2400. Place both at the same struct, at the
      global header file.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      39bc26e4
    • Mauro Carvalho Chehab's avatar
      media: atomisp: don't check for ISP version for includes · 9842fa16
      Mauro Carvalho Chehab authored
      As there aren't duplicated names anymore, and the end goal
      is to do runtime checks between ISP2400 and ISP2401,
      remove the part of the Makefile which changes the include
      places based on the compile-time version.
      
      This shouldn't cause any effect, but it will make easier
      for further patches meant to remove conditional compiler
      decisions between ISP versions to be replaced by
      runtime ones.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      9842fa16
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of ibuf_ctrl abstraction · 6543143f
      Mauro Carvalho Chehab authored
      Just move the stuff there to the places where this header is
      included.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      6543143f
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of isys_dma.h and isys_dma_local.h · d71dc239
      Mauro Carvalho Chehab authored
      There aren't much on this abstraction. Just move the defines
      to isys_dma_private.h and isys_dma_public.h, cleaning up
      the includes.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      d71dc239
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of version-dependent globals · 641c2292
      Mauro Carvalho Chehab authored
      Replace all occurrences along the atomisp tree for the conditional
      compilation macros found at system_global.h, replacing them by
      tests wheather ISP2401 is defined or not.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      641c2292
    • Mauro Carvalho Chehab's avatar
      media: atomisp: cleanup ifdefs from ia_css_debug.c · bd674b5a
      Mauro Carvalho Chehab authored
      There are lots of code dependency there. Get rid of most of
      them.
      
      We can't remove everything, as there are some structs that
      are conditionally built if ISP2401. So, keep ifdefs only
      on such cases.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      bd674b5a
    • Mauro Carvalho Chehab's avatar
      media: atomisp: get rid of some unused code · 929e2a61
      Mauro Carvalho Chehab authored
      Now that the defines which are common for both ISP2400 and ISP2401
      are at system_global.h, we can get rid of the code not used by
      those versions.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      929e2a61
    • Mauro Carvalho Chehab's avatar
      media: atomisp: csi_rx.c: add missing includes · 6db1bd61
      Mauro Carvalho Chehab authored
      Due to that, smatch warns with:
      
      	drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:18:11:  warning: symbol 'N_SHORT_PACKET_LUT_ENTRIES' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:24:11:  warning: symbol 'N_LONG_PACKET_LUT_ENTRIES' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:30:11:  warning: symbol 'N_CSI_RX_FE_CTRL_DLANES' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:37:11:  warning: symbol 'N_CSI_RX_BE_SID_WIDTH' was not declared. Should it be static?
      	drivers/staging/media/atomisp/pci/css_2401_system/host/ibuf_ctrl.c:19:11:  warning: symbol 'N_IBUF_CTRL_PROCS' was not declared. Should it be static?
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      6db1bd61
    • Mauro Carvalho Chehab's avatar
      media: atomisp: atomisp_gmin_platform: check before use · 815ac856
      Mauro Carvalho Chehab authored
      solve this smatch warning:
      	drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:842 gmin_v1p8_ctrl() warn: variable dereferenced before check 'gs' (see line 832)
      
      By moving the check to happen before its usage.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      815ac856
    • Mauro Carvalho Chehab's avatar
      media: atomisp: fix casts at atomisp_compat_ioctl32.c · b2999af9
      Mauro Carvalho Chehab authored
      There are several warnings reported by sparse with regards to wrong
      typecasts:
      
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:73:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:73:13:     expected void *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:73:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:247:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:247:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:247:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:248:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:248:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:248:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:249:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:249:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:249:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:250:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:250:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:250:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:282:30:  warning: incorrect type in argument 2 (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:282:30:     expected void const *from
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:282:30:     got struct atomisp_3a_statistics [noderef] __user *kp
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:308:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:308:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:308:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:327:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:327:13:     expected void [noderef] __user *effective_width
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:327:13:     got unsigned int [usertype] *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:348:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:348:13:     expected void [noderef] __user *effective_width
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:348:13:     got unsigned int [usertype] *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:372:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:372:13:     expected unsigned int [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:372:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:433:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:433:13:     expected struct v4l2_framebuffer *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:433:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:462:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:462:13:     expected void [noderef] __user *frame
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:462:13:     got struct v4l2_framebuffer *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:496:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:496:13:     expected unsigned short *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:496:13:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:511:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:511:13:     expected void [noderef] __user *calb_grp_values
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:511:13:     got unsigned short *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:630:21:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:630:21:     expected unsigned short [usertype] *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:630:21:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:715:27:  warning: cast removes address space '__user' of expression
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:715:27:  warning: incorrect type in initializer (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:715:27:     expected struct <noident> [noderef] __user *karg
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:715:27:     got void *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:721:39:  warning: cast removes address space '__user' of expression
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:21:  warning: incorrect type in argument 1 (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:21:     expected void const volatile [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:21:     got unsigned int [usertype] *src
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:43:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:43:     expected void *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:725:43:     got void [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:741:21:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:741:21:     expected struct atomisp_shading_table *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:741:21:     got struct atomisp_shading_table [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:747:21:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:747:21:     expected struct atomisp_morph_table *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:747:21:     got struct atomisp_morph_table [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:753:21:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:753:21:     expected struct atomisp_dis_coefficients *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:753:21:     got struct atomisp_dis_coefficients [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:760:14:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:760:14:     expected struct atomisp_dvs_6axis_config *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:760:14:     got struct atomisp_dvs_6axis_config [noderef] __user *
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:817:13:  warning: incorrect type in assignment (different address spaces)
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:817:13:     expected struct atomisp_sensor_ae_bracketing_lut_entry *__pu_val
          drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c:817:13:     got void [noderef] __user *
      
      Use the same strategies used at v4l2-compat32.c, in order to
      solve them and avoid warnings.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b2999af9
    • Mauro Carvalho Chehab's avatar
      media: saa7134: avoid a shift overflow · 15a36aae
      Mauro Carvalho Chehab authored
      As reported by smatch:
      	drivers/media/pci/saa7134//saa7134-tvaudio.c:686 saa_dsp_writel() warn: should 'reg << 2' be a 64 bit type?
      
      On a 64-bits Kernel, the shift might be bigger than 32 bits.
      
      In real, this should never happen, but let's shut up the warning.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      15a36aae
    • Mauro Carvalho Chehab's avatar
      media: dvb-ttusb-budget: cleanup printk logic · 883c84ac
      Mauro Carvalho Chehab authored
      Instead of calling printk(), use pr_foo() macros.
      
      While here, do some cleanup at the printed messages, as some
      has __func__, while others have the module name (sometimes
      spelled as "ttusb_dvb").
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      883c84ac
    • Mauro Carvalho Chehab's avatar
      media: dvb-ttusb-budget: don't use stack for USB transfers · 36e3cf0c
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:311 ttusb_boot_dsp() error: doing dma on the stack (b)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:321 ttusb_boot_dsp() error: doing dma on the stack (b)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:330 ttusb_boot_dsp() error: doing dma on the stack (b)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:351 ttusb_set_channel() error: doing dma on the stack (b)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:361 ttusb_del_channel() error: doing dma on the stack (b)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:412 ttusb_init_controller() error: doing dma on the stack (b0)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:416 ttusb_init_controller() error: doing dma on the stack (b1)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:422 ttusb_init_controller() error: doing dma on the stack (b2)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:425 ttusb_init_controller() error: doing dma on the stack (b3)
          drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:430 ttusb_init_controller() error: doing dma on the stack (get_version)
      
      This driver still uses the USB stack for DMA transfers,
      which is broken for a long time. I almost dropped this driver,
      as there's a high chance that nobody is using it with upstream
      Kernels, as we didn't receive any bug reports.
      
      As fixing this won't be hard, I ended opting to fix.
      
      While here, I dropped an ugly hack that implemented read via
      a separate function that was just doing a memcpy().
      
      It should be noticed that, during the init phase, there's
      a "b4" register that were never initialized, as its buffer
      were used just to store the results of "b3" initialization.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      36e3cf0c
    • Mauro Carvalho Chehab's avatar
      media: saa7134-alsa.c: number of pages should be unsigned long · c91effc0
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      	drivers/media/pci/saa7134/saa7134-alsa.c:267 saa7134_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type?
      
      the number of patches should be unsigned long.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c91effc0
    • Mauro Carvalho Chehab's avatar
      media: cx88-alsa: number of pages should be unsigned long · b4e0a5f9
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      	drivers/media/pci/cx88/cx88-alsa.c:286 cx88_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type?
      
      the number of patches should be unsigned long.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b4e0a5f9
    • Mauro Carvalho Chehab's avatar
      media: cx23885-alsa: number of pages should be unsigned long · 74637731
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      	drivers/media//pci/cx23885/cx23885-alsa.c:83 cx23885_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type?
      
      the number of patches should be unsigned long.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      74637731
    • Mauro Carvalho Chehab's avatar
      media: cx25821-alsa: number of pages should be unsigned long · 99c2ec04
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      	drivers/media/pci/cx25821/cx25821-alsa.c:146 cx25821_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type?
      
      the number of patches should be unsigned long.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      99c2ec04
    • Mauro Carvalho Chehab's avatar
      media: videobuf-dma-sg: number of pages should be unsigned long · 1faa39e0
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      	drivers/media/v4l2-core/videobuf-dma-sg.c:245 videobuf_dma_init_kernel() warn: should 'nr_pages << 12' be a 64 bit type?
      
      The printk should not be using %d for the number of pages.
      
      After looking better, the real problem here is that the
      number of pages should be long int.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      1faa39e0