diff mbox series

[1/8] staging: media: atomisp: initialize settings to 0

Message ID 20230524121150.435736-2-hverkuil-cisco@xs4all.nl
State Accepted
Commit 66c1dfad00120d15abb1bca4e97b1dcf82002019
Headers show
Series [1/8] staging: media: atomisp: initialize settings to 0 | expand

Commit Message

Hans Verkuil May 24, 2023, 12:11 p.m. UTC
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.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede May 24, 2023, 4:04 p.m. UTC | #1
Hi Hans,

On 5/24/23 14:11, Hans Verkuil wrote:
> 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.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thank you for these patches. I have merged this one and 8/8
into:

https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp

I'm currently doing a lot of work on the atomisp code,
so merging them through my atomisp branch is best to
avoid conflicts (I already had to resolve a conflict).

So please refrain from merging 1/8 + 8/8 to some
other linux-media tree/branch.

Regards,

Hans





> ---
>  drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> index c718a74ea70a..48ba0d0bcfe5 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
> @@ -1522,7 +1522,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))
Hans Verkuil May 25, 2023, 7:18 a.m. UTC | #2
On 24/05/2023 18:04, Hans de Goede wrote:
> Hi Hans,
> 
> On 5/24/23 14:11, Hans Verkuil wrote:
>> 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.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: Hans de Goede <hdegoede@redhat.com>
> 
> Thank you for these patches. I have merged this one and 8/8
> into:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
> 
> I'm currently doing a lot of work on the atomisp code,
> so merging them through my atomisp branch is best to
> avoid conflicts (I already had to resolve a conflict).
> 
> So please refrain from merging 1/8 + 8/8 to some
> other linux-media tree/branch.

I've delegated patches 1 and 8 to you in patchwork.

Regards,

	Hans

> 
> Regards,
> 
> Hans
> 
> 
> 
> 
> 
>> ---
>>  drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
>> index c718a74ea70a..48ba0d0bcfe5 100644
>> --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
>> +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
>> @@ -1522,7 +1522,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))
>
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index c718a74ea70a..48ba0d0bcfe5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -1522,7 +1522,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))