mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] platform/x86: yogabook: Clean up code style
@ 2026-01-01 14:16 Benjamin Philip
  2026-01-01 15:17 ` Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Benjamin Philip @ 2026-01-01 14:16 UTC (permalink / raw)
  To: platform-driver-x86, linux-kernel
  Cc: Benjamin Philip, Mark Pearson, Derek J. Clark, Hans de Goede,
	Ilpo Järvinen

This commit cleans up the following checks flagged by checkpatch in
yogabook.c:

- CHECK: Prefer kernel type 'u8' over 'uint8_t'
- CHECK: Comparison to NULL could be written "!data"
- CHECK: line length of ... exceeds 100 columns

Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
---
Changes in v2:
  - Drop cleanup for "CHECK: Unnecessary parentheses around '...'" 

 drivers/platform/x86/lenovo/yogabook.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/lenovo/yogabook.c b/drivers/platform/x86/lenovo/yogabook.c
index 31b298dc5046..69887de36c9b 100644
--- a/drivers/platform/x86/lenovo/yogabook.c
+++ b/drivers/platform/x86/lenovo/yogabook.c
@@ -57,7 +57,7 @@ struct yogabook_data {
 	struct work_struct work;
 	struct led_classdev kbd_bl_led;
 	unsigned long flags;
-	uint8_t brightness;
+	u8 brightness;
 };
 
 static void yogabook_work(struct work_struct *work)
@@ -338,16 +338,18 @@ static int yogabook_wmi_probe(struct wmi_device *wdev, const void *context)
 	int r;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
-	if (data == NULL)
+	if (!data)
 		return -ENOMEM;
 
 	data->kbd_adev = acpi_dev_get_first_match_dev("GDIX1001", NULL, -1);
 	if (!data->kbd_adev)
-		return dev_err_probe(dev, -ENODEV, "Cannot find the touchpad device in ACPI tables\n");
+		return dev_err_probe(dev, -ENODEV,
+				     "Cannot find the touchpad device in ACPI tables\n");
 
 	data->dig_adev = acpi_dev_get_first_match_dev("WCOM0019", NULL, -1);
 	if (!data->dig_adev) {
-		r = dev_err_probe(dev, -ENODEV, "Cannot find the digitizer device in ACPI tables\n");
+		r = dev_err_probe(dev, -ENODEV,
+				  "Cannot find the digitizer device in ACPI tables\n");
 		goto error_put_devs;
 	}
 
@@ -453,7 +455,7 @@ static int yogabook_pdev_probe(struct platform_device *pdev)
 	int r;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
-	if (data == NULL)
+	if (!data)
 		return -ENOMEM;
 
 	data->kbd_dev = bus_find_device_by_name(&i2c_bus_type, NULL, "i2c-goodix_ts");
-- 
2.52.0


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

* Re: [PATCH v2] platform/x86: yogabook: Clean up code style
  2026-01-01 14:16 [PATCH v2] platform/x86: yogabook: Clean up code style Benjamin Philip
@ 2026-01-01 15:17 ` Hans de Goede
  2026-01-05  2:14 ` Mark Pearson
  2026-01-06 13:46 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2026-01-01 15:17 UTC (permalink / raw)
  To: Benjamin Philip, platform-driver-x86, linux-kernel
  Cc: Mark Pearson, Derek J. Clark, Ilpo Järvinen

Hi,

On 1-Jan-26 15:16, Benjamin Philip wrote:
> This commit cleans up the following checks flagged by checkpatch in
> yogabook.c:
> 
> - CHECK: Prefer kernel type 'u8' over 'uint8_t'
> - CHECK: Comparison to NULL could be written "!data"
> - CHECK: line length of ... exceeds 100 columns
> 
> Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
> ---
> Changes in v2:
>   - Drop cleanup for "CHECK: Unnecessary parentheses around '...'" 

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>

Regards,

Hans



> 
>  drivers/platform/x86/lenovo/yogabook.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/platform/x86/lenovo/yogabook.c b/drivers/platform/x86/lenovo/yogabook.c
> index 31b298dc5046..69887de36c9b 100644
> --- a/drivers/platform/x86/lenovo/yogabook.c
> +++ b/drivers/platform/x86/lenovo/yogabook.c
> @@ -57,7 +57,7 @@ struct yogabook_data {
>  	struct work_struct work;
>  	struct led_classdev kbd_bl_led;
>  	unsigned long flags;
> -	uint8_t brightness;
> +	u8 brightness;
>  };
>  
>  static void yogabook_work(struct work_struct *work)
> @@ -338,16 +338,18 @@ static int yogabook_wmi_probe(struct wmi_device *wdev, const void *context)
>  	int r;
>  
>  	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> -	if (data == NULL)
> +	if (!data)
>  		return -ENOMEM;
>  
>  	data->kbd_adev = acpi_dev_get_first_match_dev("GDIX1001", NULL, -1);
>  	if (!data->kbd_adev)
> -		return dev_err_probe(dev, -ENODEV, "Cannot find the touchpad device in ACPI tables\n");
> +		return dev_err_probe(dev, -ENODEV,
> +				     "Cannot find the touchpad device in ACPI tables\n");
>  
>  	data->dig_adev = acpi_dev_get_first_match_dev("WCOM0019", NULL, -1);
>  	if (!data->dig_adev) {
> -		r = dev_err_probe(dev, -ENODEV, "Cannot find the digitizer device in ACPI tables\n");
> +		r = dev_err_probe(dev, -ENODEV,
> +				  "Cannot find the digitizer device in ACPI tables\n");
>  		goto error_put_devs;
>  	}
>  
> @@ -453,7 +455,7 @@ static int yogabook_pdev_probe(struct platform_device *pdev)
>  	int r;
>  
>  	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> -	if (data == NULL)
> +	if (!data)
>  		return -ENOMEM;
>  
>  	data->kbd_dev = bus_find_device_by_name(&i2c_bus_type, NULL, "i2c-goodix_ts");


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

* Re: [PATCH v2] platform/x86: yogabook: Clean up code style
  2026-01-01 14:16 [PATCH v2] platform/x86: yogabook: Clean up code style Benjamin Philip
  2026-01-01 15:17 ` Hans de Goede
@ 2026-01-05  2:14 ` Mark Pearson
  2026-01-06 13:46 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Pearson @ 2026-01-05  2:14 UTC (permalink / raw)
  To: Benjamin Philip, platform-driver-x86, linux-kernel
  Cc: Derek J . Clark, Hans de Goede, Ilpo Järvinen



On Thu, Jan 1, 2026, at 9:16 AM, Benjamin Philip wrote:
> This commit cleans up the following checks flagged by checkpatch in
> yogabook.c:
>
> - CHECK: Prefer kernel type 'u8' over 'uint8_t'
> - CHECK: Comparison to NULL could be written "!data"
> - CHECK: line length of ... exceeds 100 columns
>
> Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
> ---
> Changes in v2:
>   - Drop cleanup for "CHECK: Unnecessary parentheses around '...'" 
>
>  drivers/platform/x86/lenovo/yogabook.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/lenovo/yogabook.c 
> b/drivers/platform/x86/lenovo/yogabook.c
> index 31b298dc5046..69887de36c9b 100644
> --- a/drivers/platform/x86/lenovo/yogabook.c
> +++ b/drivers/platform/x86/lenovo/yogabook.c
> @@ -57,7 +57,7 @@ struct yogabook_data {
>  	struct work_struct work;
>  	struct led_classdev kbd_bl_led;
>  	unsigned long flags;
> -	uint8_t brightness;
> +	u8 brightness;
>  };
> 
>  static void yogabook_work(struct work_struct *work)
> @@ -338,16 +338,18 @@ static int yogabook_wmi_probe(struct wmi_device 
> *wdev, const void *context)
>  	int r;
> 
>  	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> -	if (data == NULL)
> +	if (!data)
>  		return -ENOMEM;
> 
>  	data->kbd_adev = acpi_dev_get_first_match_dev("GDIX1001", NULL, -1);
>  	if (!data->kbd_adev)
> -		return dev_err_probe(dev, -ENODEV, "Cannot find the touchpad device 
> in ACPI tables\n");
> +		return dev_err_probe(dev, -ENODEV,
> +				     "Cannot find the touchpad device in ACPI tables\n");
> 
>  	data->dig_adev = acpi_dev_get_first_match_dev("WCOM0019", NULL, -1);
>  	if (!data->dig_adev) {
> -		r = dev_err_probe(dev, -ENODEV, "Cannot find the digitizer device in 
> ACPI tables\n");
> +		r = dev_err_probe(dev, -ENODEV,
> +				  "Cannot find the digitizer device in ACPI tables\n");
>  		goto error_put_devs;
>  	}
> 
> @@ -453,7 +455,7 @@ static int yogabook_pdev_probe(struct platform_device *pdev)
>  	int r;
> 
>  	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> -	if (data == NULL)
> +	if (!data)
>  		return -ENOMEM;
> 
>  	data->kbd_dev = bus_find_device_by_name(&i2c_bus_type, NULL, "i2c-goodix_ts");
> -- 
> 2.52.0

Looks good to me. Thanks!
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Mark

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

* Re: [PATCH v2] platform/x86: yogabook: Clean up code style
  2026-01-01 14:16 [PATCH v2] platform/x86: yogabook: Clean up code style Benjamin Philip
  2026-01-01 15:17 ` Hans de Goede
  2026-01-05  2:14 ` Mark Pearson
@ 2026-01-06 13:46 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2026-01-06 13:46 UTC (permalink / raw)
  To: platform-driver-x86, linux-kernel, Benjamin Philip
  Cc: Mark Pearson, Derek J. Clark, Hans de Goede

On Thu, 01 Jan 2026 19:46:57 +0530, Benjamin Philip wrote:

> This commit cleans up the following checks flagged by checkpatch in
> yogabook.c:
> 
> - CHECK: Prefer kernel type 'u8' over 'uint8_t'
> - CHECK: Comparison to NULL could be written "!data"
> - CHECK: line length of ... exceeds 100 columns
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: yogabook: Clean up code style
      commit: 751e2ebf29a74c0e46144cbb35e5be478bcd7668

--
 i.


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

end of thread, other threads:[~2026-01-06 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-01 14:16 [PATCH v2] platform/x86: yogabook: Clean up code style Benjamin Philip
2026-01-01 15:17 ` Hans de Goede
2026-01-05  2:14 ` Mark Pearson
2026-01-06 13:46 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®