diff mbox series

[next] media: i2c: st-vgxy61: remove redundant initialization of pointer mode

Message ID 20240205220508.1851545-1-colin.i.king@gmail.com
State Accepted
Commit ab9279b92d11811317bae12e0b1cc510fe49eaab
Headers show
Series [next] media: i2c: st-vgxy61: remove redundant initialization of pointer mode | expand

Commit Message

Colin Ian King Feb. 5, 2024, 10:05 p.m. UTC
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 <colin.i.king@gmail.com>
---
 drivers/media/i2c/st-vgxy61.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Benjamin Mugnier Feb. 9, 2024, 8:55 a.m. UTC | #1
Hi Colin,

Thank you for your patch.

Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>

On 2/5/24 23:05, Colin Ian King wrote:
> 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 <colin.i.king@gmail.com>
> ---
>  drivers/media/i2c/st-vgxy61.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c
> index 2d64466d7ecf..b9e7c57027b1 100644
> --- a/drivers/media/i2c/st-vgxy61.c
> +++ b/drivers/media/i2c/st-vgxy61.c
> @@ -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++) {
diff mbox series

Patch

diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c
index 2d64466d7ecf..b9e7c57027b1 100644
--- a/drivers/media/i2c/st-vgxy61.c
+++ b/drivers/media/i2c/st-vgxy61.c
@@ -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++) {