lkml.org 
[lkml]   [2023]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] platform/x86: hp-bioscfg: Remove useless else
Date
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>


Regards,

Jorge Lopez
HP Inc

"Once you stop learning, you start dying"
Albert Einstein

> -----Original Message-----
> From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Sent: Friday, August 11, 2023 1:30 AM
> To: Lopez, Jorge A (Security) <jorge.lopez2@hp.com>
> Cc: hdegoede@redhat.com; markgross@kernel.org; platform-driver-
> x86@vger.kernel.org; linux-kernel@vger.kernel.org; Jiapeng Chong
> <jiapeng.chong@linux.alibaba.com>; Abaci Robot
> <abaci@linux.alibaba.com>
> Subject: [PATCH] platform/x86: hp-bioscfg: Remove useless else
>
> CAUTION: External Email
>
> The assignment of the else and if branches is the same, so the else here is
> redundant, so we remove it.
>
> ./drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c:545:3-5:
> WARNING: possible condition with no effect (if == else).
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> .../platform/x86/hp/hp-bioscfg/passwdobj-attributes.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> index 03d0188804ba..771e554182dc 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> @@ -541,14 +541,8 @@ void hp_exit_password_attributes(void)
> struct kobject *attr_name_kobj =
> bioscfg_drv.password_data[instance_id].attr_name_kobj;
>
> - if (attr_name_kobj) {
> - if (!strcmp(attr_name_kobj->name, SETUP_PASSWD))
> - sysfs_remove_group(attr_name_kobj,
> - &password_attr_group);
> - else
> - sysfs_remove_group(attr_name_kobj,
> - &password_attr_group);
> - }
> + if (attr_name_kobj)
> + sysfs_remove_group(attr_name_kobj,
> + &password_attr_group);
> }
> bioscfg_drv.password_instances_count = 0;
> kfree(bioscfg_drv.password_data);
> --
> 2.20.1.7.g153144c

\
 
 \ /
  Last update: 2023-08-11 17:46    [W:0.061 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site