linux/drivers/media
Nathan Chancellor 1aba7930c6 media: rzg2l-cru: Remove unnecessary shadowing of ret in rzg2l_csi2_s_stream()
Clang warns:

  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:445:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                  if (ret)
                      ^~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:475:9: note: uninitialized use occurs here
          return ret;
                ^~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:445:3: note: remove the 'if' if its condition is always false
                  if (ret)
                  ^~~~~~~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:441:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                  if (ret)
                      ^~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:475:9: note: uninitialized use occurs here
          return ret;
                ^~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:441:3: note: remove the 'if' if its condition is always false
                  if (ret)
                  ^~~~~~~~
  drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c:431:9: note: initialize the variable 'ret' to silence this warning
          int ret;
                ^
                  = 0
  2 errors generated.

ret is unnecessarily shadowed, meaning the assignments to ret within the
first 'if (enable)' block are only applied to the inner scope, not the
outer one as intended. Remove the shadowing to fix the warnings and make
everything work correctly.

Link: https://github.com/ClangBuiltLinux/linux/issues/1764

Fixes: 51e8415e39 ("media: platform: Add Renesas RZ/G2L MIPI CSI-2 receiver driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-12-06 07:13:51 +00:00
..
cec media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
common media: vb2/au0828: move the v4l_vb2q_enable_media_source to the au0828 driver 2022-11-25 07:41:40 +00:00
dvb-core media: dvb-core: Fix ignored return value in dvb_register_frontend() 2022-11-25 10:18:03 +00:00
dvb-frontends media: media/dvb-frontends: fix repeated words in comments 2022-11-25 10:06:25 +00:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: ov5693: Add support for a privacy-led GPIO 2022-12-06 07:10:07 +00:00
mc media: mc: convert pipeline funcs to take media_pad 2022-09-24 09:22:30 +02:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: saa7164: fix missing pci_disable_device() 2022-12-06 07:13:04 +00:00
platform media: rzg2l-cru: Remove unnecessary shadowing of ret in rzg2l_csi2_s_stream() 2022-12-06 07:13:51 +00:00
radio Tag branch 2022-11-25 07:55:21 +00:00
rc media: imon: fix a race condition in send_packet() 2022-11-25 08:00:45 +00:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers Tag branch 2022-11-25 07:55:21 +00:00
tuners Tag branch 2022-11-25 07:55:21 +00:00
usb media: dvb-usb: m920x: make read-only arrays static const 2022-12-02 15:36:44 +01:00
v4l2-core media: add nv12_8l128 and nv12_10be_8l128 video format. 2022-11-25 11:01:29 +00:00
Kconfig media: remove reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER 2022-09-08 18:19:29 +02:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00