Re: [PATCH 1/2] platform/x86: thinkpad_acpi: Fix compiler warning about uninitialized err variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 3/9/22 18:05, Hans de Goede wrote:
> err is always set because if we get here then dytc_profile_available
> is always one of DYTC_FUNCMODE_MMC or DYTC_FUNCMODE_PSC, but the
> compiler cannot now that, so initialize err to 0 to avoid a
> compiler warning about err being uninitialized.
> 
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>

I've added these 2 patches to my review-hans (soon to be for-next) branch now.

Regards,

Hans

> ---
>  drivers/platform/x86/thinkpad_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index cb8f52be8253..7016c7fc3440 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -10344,7 +10344,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
>  static void dytc_profile_refresh(void)
>  {
>  	enum platform_profile_option profile;
> -	int output, err;
> +	int output, err = 0;
>  	int perfmode;
>  
>  	mutex_lock(&dytc_mutex);




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux