lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMEXYWfjDe4+H=19PVNNYkEFs0S2ApAnRCPdiZ36khAHNKDtuA@mail.gmail.com>
Date: Tue, 23 Dec 2025 15:45:23 +0000
From: Benjamin Philip <benjamin.philip495@...il.com>
To: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Benjamin Philip <benjamin.philip495@...il.com>, Mark Pearson <mpearson-lenovo@...ebb.ca>, 
	"Derek J. Clark" <derekjohn.clark@...il.com>, Hans de Goede <hansg@...nel.org>, 
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH] platform/x86: yogabook: Clean up code style

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

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

Signed-off-by: Benjamin Philip <benjamin.philip495@...il.com>
---
 drivers/platform/x86/lenovo/yogabook.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/lenovo/yogabook.c
b/drivers/platform/x86/lenovo/yogabook.c
index 31b298dc5046..ee6c625076df 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)
@@ -160,7 +160,7 @@ static int kbd_brightness_set(struct led_classdev *cdev,
 {
 	struct yogabook_data *data = kbd_led_to_yogabook(cdev);

-	if ((value < 0) || (value > YB_KBD_BL_MAX))
+	if (value < 0 || value > YB_KBD_BL_MAX)
 		return -EINVAL;

 	data->brightness = value;
@@ -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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ