media: i2c: st-vgxy61: remove redundant initialization of pointer mode
Subsystems (2)
PATCH 1/1 media: i2c: st-vgxy61: remove redundant initialization of pointer mode
The pointer mode is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed.
Cleans up clang scan build warning:drivers/media/i2c/st-vgxy61.c:632:33: warning: Value stored to 'mode' during its initialization is never read [deadcode.DeadStores]
--- drivers/media/i2c/st-vgxy61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/st-vgxy61.c +1 -1
@@ -629,7 +629,7 @@ static int vgxy61_try_fmt_internal(struct v4l2_subdev *sd, const struct vgxy61_mode_info **new_mode) {struct vgxy61_dev *sensor =to_vgxy61_dev (sd); -const struct vgxy61_mode_info *mode = sensor->sensor_modes; +const struct vgxy61_mode_info *mode;unsigned int index;for (index =0 ; index <ARRAY_SIZE (vgxy61_supported_codes); index++) {
Signature · 1 line
2.39.2
Hi Colin,
Thank you for your patch.
Quoted 26 lines · Colin Ian King
The pointer mode is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed.
Cleans up clang scan build warning:
drivers/media/i2c/st-vgxy61.c:632:33: warning: Value stored to 'mode' during its initialization is never read [deadcode.DeadStores]Signed-off-by Colin Ian King <[email protected]>--- drivers/media/i2c/st-vgxy61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/st-vgxy61.c +1
-1@@ -629,7 +629,7 @@ static int vgxy61_try_fmt_internal(struct v4l2_subdev *sd, const struct vgxy61_mode_info **new_mode) {struct vgxy61_dev *sensor =to_vgxy61_dev (sd); -const struct vgxy61_mode_info *mode = sensor->sensor_modes; +const struct vgxy61_mode_info *mode;unsigned int index;for (index =0 ; index <ARRAY_SIZE (vgxy61_supported_codes); index++) {
Signature · 3 lines
Regards, Benjamin