Re: [PATCH] ACPI / battery: drop redundant test for failure

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

 



On Tuesday, December 5, 2017 6:46:39 PM CET Bjørn Mork wrote:
> Merging the two adjacent conditionally built blocks makes the code
> a lot more readable.  And as a bonus, we drop a duplicate test when
> CONFIG_ACPI_PROCFS_POWER is undefined.
> 
> Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
> ---
>  drivers/acpi/battery.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 13e7b56e33ae..f2eb6c37ea0a 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -1237,13 +1237,11 @@ static int acpi_battery_add(struct acpi_device *device)
>  
>  #ifdef CONFIG_ACPI_PROCFS_POWER
>  	result = acpi_battery_add_fs(device);
> -#endif
>  	if (result) {
> -#ifdef CONFIG_ACPI_PROCFS_POWER
>  		acpi_battery_remove_fs(device);
> -#endif
>  		goto fail;
>  	}
> +#endif
>  
>  	printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
>  		ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
> 

Applied, thanks!


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux