[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMEXYWdFn05=kx-NYejm4nznbKQahHUJJDesc_W1OKk_X3OOgg@mail.gmail.com>
Date: Tue, 23 Dec 2025 19:23:54 +0000
From: Benjamin Philip <benjamin.philip495@...il.com>
To: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: 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>,
Benjamin Philip <benjamin.philip495@...il.com>
Subject: [PATCH 2/5] platform/x86: think-lmi: Remove unnecessary parens
This commit removes any unnecessary parentheses as flagged by
checkpatch in the following check:
CHECK: Unnecessary parentheses around '...'
Signed-off-by: Benjamin Philip <benjamin.philip495@...il.com>
---
drivers/platform/x86/lenovo/think-lmi.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/platform/x86/lenovo/think-lmi.c
b/drivers/platform/x86/lenovo/think-lmi.c
index 540b472b1bf3..1fac8986d077 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -440,7 +440,7 @@ static ssize_t current_password_store(struct kobject *kobj,
pwdlen = strlen(buf);
/* pwdlen == 0 is allowed to clear the password */
- if (pwdlen && ((pwdlen < setting->minlen) || (pwdlen > setting->maxlen)))
+ if (pwdlen && (pwdlen < setting->minlen || pwdlen > setting->maxlen))
return -EINVAL;
strscpy(setting->password, buf, setting->maxlen);
@@ -476,7 +476,7 @@ static ssize_t new_password_store(struct kobject *kobj,
pwdlen = strlen(new_pwd);
/* pwdlen == 0 is allowed to clear the password */
- if (pwdlen && ((pwdlen < setting->minlen) || (pwdlen > setting->maxlen))) {
+ if (pwdlen && (pwdlen < setting->minlen || pwdlen > setting->maxlen)) {
ret = -EINVAL;
goto out;
}
@@ -859,7 +859,7 @@ static ssize_t certificate_store(struct kobject *kobj,
signature = setting->signature;
} else { /* Cert install */
/* Check if SMC and SVC already installed */
- if ((setting == tlmi_priv.pwd_system) &&
tlmi_priv.pwd_admin->cert_installed) {
+ if (setting == tlmi_priv.pwd_system && tlmi_priv.pwd_admin->cert_installed) {
/* This gets treated as a cert update */
install_mode = TLMI_CERT_UPDATE;
signature = tlmi_priv.pwd_admin->signature;
@@ -881,7 +881,7 @@ static ssize_t certificate_store(struct kobject *kobj,
} else {
/* This is a fresh install */
/* To set admin cert, a password must be enabled */
- if ((setting == tlmi_priv.pwd_admin) &&
+ if (setting == tlmi_priv.pwd_admin &&
(!setting->pwd_enabled || !setting->password[0])) {
kfree(new_cert);
return -EACCES;
@@ -965,13 +965,13 @@ static ssize_t save_signature_store(struct kobject *kobj,
static struct kobj_attribute auth_save_signature = __ATTR_WO(save_signature);
static umode_t auth_attr_is_visible(struct kobject *kobj,
- struct attribute *attr, int n)
+ struct attribute *attr, int n)
{
struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj);
/* We only want to display level and index settings on HDD/NVMe */
if (attr == &auth_index.attr || attr == &auth_level.attr) {
- if ((setting == tlmi_priv.pwd_hdd) || (setting == tlmi_priv.pwd_nvme))
+ if (setting == tlmi_priv.pwd_hdd || setting == tlmi_priv.pwd_nvme)
return attr->mode;
return 0;
}
@@ -985,8 +985,8 @@ static umode_t auth_attr_is_visible(struct kobject *kobj,
if (tlmi_priv.certificate_support) {
if (setting == tlmi_priv.pwd_admin)
return attr->mode;
- if ((tlmi_priv.pwdcfg.core.password_mode >= TLMI_PWDCFG_MODE_MULTICERT) &&
- (setting == tlmi_priv.pwd_system))
+ if (tlmi_priv.pwdcfg.core.password_mode >= TLMI_PWDCFG_MODE_MULTICERT &&
+ setting == tlmi_priv.pwd_system)
return attr->mode;
}
return 0;
@@ -1216,13 +1216,13 @@ static struct kobj_attribute attr_current_val
= __ATTR_RW_MODE(current_value, 06
static struct kobj_attribute attr_type = __ATTR_RO(type);
-static umode_t attr_is_visible(struct kobject *kobj,
- struct attribute *attr, int n)
+static umode_t attr_is_visible(struct kobject *kobj, struct attribute *attr,
+ int n)
{
struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj);
/* We don't want to display possible_values attributes if not available */
- if ((attr == &attr_possible_values.attr) && (!setting->possible_values))
+ if (attr == &attr_possible_values.attr && !setting->possible_values)
return 0;
return attr->mode;
--
2.52.0
Powered by blists - more mailing lists