All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions
@ 2019-08-20 15:34 Wolfram Sang
  2019-08-22 19:41 ` Enric Balletbo i Serra
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2019-08-20 15:34 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Benson Leung, Enric Balletbo i Serra, linux-kernel

No need to check the argument of i2c_unregister_device() and
property_entries_free() because the functions do check it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Build tested only, buildbot is happy, too.

Please apply to your tree.

 drivers/platform/chrome/chromeos_laptop.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
index 7abbb6167766..8723bcf10c93 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop)
 		i2c_dev = &cros_laptop->i2c_peripherals[i];
 		info = &i2c_dev->board_info;
 
-		if (i2c_dev->client)
-			i2c_unregister_device(i2c_dev->client);
-
-		if (info->properties)
-			property_entries_free(info->properties);
+		i2c_unregister_device(i2c_dev->client);
+		property_entries_free(info->properties);
 	}
 
 	for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) {
 		acpi_dev = &cros_laptop->acpi_peripherals[i];
 
-		if (acpi_dev->properties)
-			property_entries_free(acpi_dev->properties);
+		property_entries_free(acpi_dev->properties);
 	}
 
 	kfree(cros_laptop->i2c_peripherals);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions
  2019-08-20 15:34 [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions Wolfram Sang
@ 2019-08-22 19:41 ` Enric Balletbo i Serra
  0 siblings, 0 replies; 2+ messages in thread
From: Enric Balletbo i Serra @ 2019-08-22 19:41 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c; +Cc: Benson Leung, linux-kernel

Hi,

On 20/8/19 17:34, Wolfram Sang wrote:
> No need to check the argument of i2c_unregister_device() and
> property_entries_free() because the functions do check it.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks, applied for chrome-platform-5.4

Thanks,
 Enric

> ---
> Build tested only, buildbot is happy, too.
> 
> Please apply to your tree.
> 
>  drivers/platform/chrome/chromeos_laptop.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
> index 7abbb6167766..8723bcf10c93 100644
> --- a/drivers/platform/chrome/chromeos_laptop.c
> +++ b/drivers/platform/chrome/chromeos_laptop.c
> @@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop)
>  		i2c_dev = &cros_laptop->i2c_peripherals[i];
>  		info = &i2c_dev->board_info;
>  
> -		if (i2c_dev->client)
> -			i2c_unregister_device(i2c_dev->client);
> -
> -		if (info->properties)
> -			property_entries_free(info->properties);
> +		i2c_unregister_device(i2c_dev->client);
> +		property_entries_free(info->properties);
>  	}
>  
>  	for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) {
>  		acpi_dev = &cros_laptop->acpi_peripherals[i];
>  
> -		if (acpi_dev->properties)
> -			property_entries_free(acpi_dev->properties);
> +		property_entries_free(acpi_dev->properties);
>  	}
>  
>  	kfree(cros_laptop->i2c_peripherals);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-22 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 15:34 [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions Wolfram Sang
2019-08-22 19:41 ` Enric Balletbo i Serra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.