1. 22 Apr, 2019 10 commits
  2. 30 Mar, 2019 4 commits
  3. 29 Mar, 2019 20 commits
  4. 28 Mar, 2019 1 commit
  5. 25 Mar, 2019 5 commits
    • Mauro Carvalho Chehab's avatar
      media: hfi_parser: don't trick gcc with a wrong expected size · ded71626
      Mauro Carvalho Chehab authored
      Smatch warns about small size on two structs:
      
      	drivers/media/platform/qcom/venus/hfi_parser.c:103 parse_profile_level() error: memcpy() 'proflevel' too small (8 vs 128)
      	drivers/media/platform/qcom/venus/hfi_parser.c: drivers/media/platform/qcom/venus/hfi_parser.c:129 parse_caps() error: memcpy() 'cap' too small (16 vs 512)
      
      The reason is that the hfi_parser actually expects:
          - multiple data entries on hfi_capabilities
          - multiple profile_level on hfi_profile_level_supported
      
      However, the structs trick gcc, making it to believe that
      there's just one value for each.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      ded71626
    • Mauro Carvalho Chehab's avatar
      media: rcar-dma: p_set can't be NULL · bf78f23a
      Mauro Carvalho Chehab authored
      The only way for p_set to be NULL would be if vin_coef_set would be an
      empty array.
      
      On such case, the driver will OOPS, as it would try to de-reference a
      NULL value. So, the check if p_set is not NULL doesn't make any sense.
      
      Solves those two smatch warnings:
      
      	drivers/media/platform/rcar-vin/rcar-dma.c:489 rvin_set_coeff() warn: variable dereferenced before check 'p_set' (see line 484)
      	drivers/media/platform/rcar-vin/rcar-dma.c:494 rvin_set_coeff() error: we previously assumed 'p_set' could be null (see line 489)
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      bf78f23a
    • Mauro Carvalho Chehab's avatar
      media: sti/delta: remove uneeded check · 1021cd56
      Mauro Carvalho Chehab authored
      At the error logic, ipc_buf was already asigned to &ctx->ipc_buf_struct,
      with can't be null, as warned by smatch:
      
      	drivers/media/platform/sti/delta/delta-ipc.c:223 delta_ipc_open() warn: variable dereferenced before check 'ctx->ipc_buf' (see line 183)
      
      So, remove the uneeded check.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      1021cd56
    • Mauro Carvalho Chehab's avatar
      media: pwc-ctl: pChoose can't be NULL · 4f777d01
      Mauro Carvalho Chehab authored
      The way the code works, compression will be a valid value (less or equal to 3)
      on both set_video_mode_foo() calls at the beginning of the while() loop.
      
      So, the value for pChoose can't be NULL.
      
      Solves those smatch warnings:
      
      	drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:252 set_video_mode_Timon() warn: variable dereferenced before check 'pChoose' (see line 248)
      	drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:302 set_video_mode_Kiara() warn: variable dereferenced before check 'pChoose' (see line 298)
      
      and simplifies the code a little bit.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      4f777d01
    • Mauro Carvalho Chehab's avatar
      media: cx2341x: replace badly designed macros · 3d19cde7
      Mauro Carvalho Chehab authored
      There are some macros at cx2341x_update() with seemed to
      be introduced in order to ensure that lines would be less
      than 80 columns.
      
      Well, the thing is that they make the code harder to be analized,
      not only by humans, but also for static code analyzers:
      
      	drivers/media/common/cx2341x.c:1116 cx2341x_update() error: we previously assumed 'old' could be null (see line 1047)
      
      So, remove the "force" var, and replace the NEQ macro to a
      better designed one that makes clearer about what it is doing.
      
      While here, also remove the "temporal" var, as it is just another
      way of doing the same type of check as the new CMP_FIELD() macro
      already does.
      
      Finally, fix coding style at the block code.
       remove such macros.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      3d19cde7