Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6889463rdb; Tue, 2 Jan 2024 18:18:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiGzx0yiygGre55yMTuea9Cf04tBMOPi6AqZ8hJrNzXHHAAJ1iqZxVWbWkvsBJHU+ypz9H X-Received: by 2002:a17:906:a1cc:b0:a26:b1a5:a665 with SMTP id bx12-20020a170906a1cc00b00a26b1a5a665mr6349839ejb.35.1704248302477; Tue, 02 Jan 2024 18:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704248302; cv=none; d=google.com; s=arc-20160816; b=uKP0WpwtVRfWHK3rBuKHg0jePOiZT3mXlRIdwERrcCuxvsNB7Atjcqaz2LvX0cLf5I u08izuivxv+zYiTZi579JaVo647lyARprH38croWv30/cFjuSrFmdiHBEOdKcWVadP2p +25nJUw1xvhk2mgaAOqCC+dyqhyS5bL8s6jxV2HXnabuZFh//yalhzhMgiepk4NuGtFD +YMonuOpT5V2IRt8qs867ZqpFRZ0lV3CpMkTOaoXoTmFImH1DC7ic5yupduOwC54kqQ1 AsltR12Wv4eVXq0DGGZHmzArc0OG54FAAhXHcE38gKIsC8GyRLgsQ1ODv6u1IrrZ50A4 dQNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=TtH3u//DT90kyNF09UFXh0a57AjvjzfnHCWV1j6xVeI=; fh=ozuGKKn4S3kb5aFL7k7XT8vEgaZdRqBTlc9h/off0eQ=; b=uTNLFuYn37gFmSTTZ8ORRKcOB4WBrvQ8iiLfQi+JkpzXxwq7sWNEL/7ldjc2igiD3q dWwrltH5RRA4STHyNz5d7S/jo75bLYR4k44Fd8OwDG9kiJo90YBkAVwIe7uWYTSsrsJ5 QscEdfyjiMezGPrDHSvai8AreKK/yQM9BluwLlpeV2BqNishsmCdBh1Ockfsd4M/YQmZ 6RWy6mnkCRsbP3XMKJAJc8D885S3aK942DpZYDF5vm7BV0ARKO9kK+ShHXsXVr9wbLJc baqOqsdozkfnSC3UAmvt/xtvaoWoqxNa3tAimdXxUTy7zDjsEo98YFv730Ca4V9uZ/T5 pUhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15063-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mz13-20020a1709071b8d00b00a28912bc548si164109ejc.596.2024.01.02.18.18.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15063-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15063-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1D7011F21DEF for ; Wed, 3 Jan 2024 02:18:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43B7917E8; Wed, 3 Jan 2024 02:18:10 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60E4C17980; Wed, 3 Jan 2024 02:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Vzs30th_1704248268; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0Vzs30th_1704248268) by smtp.aliyun-inc.com; Wed, 03 Jan 2024 10:17:57 +0800 From: Jiapeng Chong To: jorge.lopez2@hp.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] platform/x86: hp-bioscfg: Remove useless else Date: Wed, 3 Jan 2024 10:17:46 +0800 Message-Id: <20240103021746.5337-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7817 Signed-off-by: Jiapeng Chong --- .../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); -- 2.20.1.7.g153144c