media: atomisp: initialize settings to 0
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 24 May 2023 12:11:43 +0000 (13:11 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:10:47 +0000 (15:10 +0100)
Fix a compiler warning:

drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:1525:13: warning: 'settings' may be used uninitialized [-Wmaybe-uninitialized]

The 'settings' variable is actually always initialized, but the
compiler isn't quite able to figure that out. Just initialize it
to 0 to avoid this warning.

Link: https://lore.kernel.org/r/20230524121150.435736-2-hverkuil-cisco@xs4all.nl
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c

index 6512e3c17af0864d7a80694cae92d5b03121e4ef..10b7871017d596c952837ef34554c270466a6a77 100644 (file)
@@ -1524,7 +1524,7 @@ static int v4l2_acpi_handle_gpio_res(struct acpi_resource *ares, void *_data)
        const char *name;
        bool active_low;
        unsigned int i;
-       u32 settings;
+       u32 settings = 0;
        u8 pin;
 
        if (!acpi_gpio_get_io_resource(ares, &agpio))