From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: jorge.lopez2@hp.com, Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] platform/x86: hp-bioscfg: Remove useless else
Date: Wed, 3 Jan 2024 13:53:48 +0200 (EET) [thread overview]
Message-ID: <9f34109e-fc90-d2d1-5bd7-87aa51fdc39f@linux.intel.com> (raw)
In-Reply-To: <20240103021746.5337-1-jiapeng.chong@linux.alibaba.com>
On Wed, 3 Jan 2024, Jiapeng Chong wrote:
> 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:544:3-5: WARNING: possible condition with no effect (if == else).
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7817
> 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 f7efe217a4bb..18c60a847842 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> @@ -540,14 +540,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);
When doing something based on a robot finding, please take a look at
the related code and _think_(!) instead of just hitting send button. If
you'd have done that, you'd have submitted a patch that cleans up the
other (create) cases too, not just the one which your robot flagged.
I think this is the second time I've said this about the very same code
construct to somebody which, disappointingly, turns out to be you:
https://lore.kernel.org/platform-driver-x86/2ec499b-c37e-0a9-c163-2a1591b56029@linux.intel.com/
Again I get an incomplete patch into my inbox because the previous review
did not lead into an updated v2 patch. Please do not submit this patch
again unless you addressed my review feedback.
--
i.
next prev parent reply other threads:[~2024-01-03 11:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 2:17 Jiapeng Chong
2024-01-03 11:53 ` Ilpo Järvinen [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-11 6:29 Jiapeng Chong
2023-08-11 8:04 ` Ilpo Järvinen
2023-08-11 15:41 ` Lopez, Jorge A (Security)
2023-08-11 15:42 ` Lopez, Jorge A (Security)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f34109e-fc90-d2d1-5bd7-87aa51fdc39f@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=abaci@linux.alibaba.com \
--cc=hdegoede@redhat.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=jorge.lopez2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®