Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1086737rdg; Fri, 11 Aug 2023 09:15:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZNwmDLAlOsNN1YvRfFtCDMgirQCRy9y8RwToqmN+5HC76BZSwlkTwGVlrxrp7tFLy64rW X-Received: by 2002:a17:903:11c3:b0:1bc:ee6:7f2e with SMTP id q3-20020a17090311c300b001bc0ee67f2emr2233349plh.53.1691770525403; Fri, 11 Aug 2023 09:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691770525; cv=none; d=google.com; s=arc-20160816; b=wY53Toor+apniYTpTFDs1apEl1sjrCyvK1tcmMG7YQ9BUqDfmDG6VDygSO6pXzGlFT Xc7zqsqpcQ8aSaxF4JbC2RF49TDuAMefAjVlt8+4c5MmDchU6NG2bB0ptm0808HZ0c2m SMVnsyHpDLmLX83GzbLmNyH2fYXgcjE+8xApXROulR01wcIJg/Ba8o1MI4cQKof7OlzN 91/jc3B/fpesngOp+eJIi0T3BsJtp/vnGAfXuD75lJTBRAO8f3iLHaj76+VM00bmObP6 X1F6E9kf5wjaQcV80KLoc8filtZYdVi/lfpNGgvF0FT31xo6xzMtqPyKzchlEZar7kYE +3xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=iXpDrr1odBbrqT0TQma78/3J1DOasfKLD2qjELvJYIE=; fh=jiNhQHrwluaTeFlQ8R+QuPbBH9+05K0oGPmhQBvLOhs=; b=VIkfl34V9Ghme2om6/yjjpvS/EUqqg6a6PrDFmCwVFxSqOkFxfiu/8vnBS/fKdgpUF Sp51eM1m4OC85fyoZ0P/P3ht8LfPlU5T44i7pqlJvzqA7CYdvK3ncsBg79MPgRA9oek6 RL51rlIO9GjsGuG9HqmFsbv/RrTUh1e6nbBeqTlJMxJkNHEv6ExclDPWj9FMG2PF7Gdd 4qkQ5MGiAjYTmFCKQbsNAfQSUmfPYMzYK6qx2b53DWC1Wwc2cxQQ55/0uqdIzsp5JkJU YfFZglCiXOsMow1KMPmxwP812q4ESr0frzQOhggWDBgJpZkR9GlFpV9WoQAsKMJS6pEC kLRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hp.com header.s=mimecast20180716 header.b=hQa+2p0Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=hp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iz1-20020a170902ef8100b001b8c689060bsi3453908plb.344.2023.08.11.09.15.11; Fri, 11 Aug 2023 09:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hp.com header.s=mimecast20180716 header.b=hQa+2p0Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=hp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236395AbjHKPmv (ORCPT + 99 others); Fri, 11 Aug 2023 11:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236293AbjHKPmu (ORCPT ); Fri, 11 Aug 2023 11:42:50 -0400 Received: from us-smtp-delivery-162.mimecast.com (us-smtp-delivery-162.mimecast.com [170.10.133.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF901FE9 for ; Fri, 11 Aug 2023 08:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hp.com; s=mimecast20180716; t=1691768523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iXpDrr1odBbrqT0TQma78/3J1DOasfKLD2qjELvJYIE=; b=hQa+2p0YQYA97z5CSTb+mJbnAyEi8pJgV0fPhBD8shB4hpFsg0klObdz48KTD5MfdsGC/0 QFmwKNbvD+Z28e8QEpfuwfcNOyOYX0BVCp4p4UIb4FndCZIqhKi8MQNWtZ/4tnG+vbDQBH OPcsfdiONpBivM5z1T7n+hupA5bg3Gs= Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-328-XctWRSpHPe6PYWJXebInEA-2; Fri, 11 Aug 2023 11:42:01 -0400 X-MC-Unique: XctWRSpHPe6PYWJXebInEA-2 Received: from PH0PR84MB1953.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:160::10) by MW5PR84MB1818.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1c4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.30; Fri, 11 Aug 2023 15:41:59 +0000 Received: from PH0PR84MB1953.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5e6b:1f96:bb19:ec40]) by PH0PR84MB1953.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5e6b:1f96:bb19:ec40%7]) with mapi id 15.20.6652.029; Fri, 11 Aug 2023 15:41:58 +0000 From: "Lopez, Jorge A (Security)" To: =?iso-8859-1?Q?Ilpo_J=E4rvinen?= , Jiapeng Chong CC: "hdegoede@redhat.com" , "markgross@kernel.org" , "platform-driver-x86@vger.kernel.org" , LKML , Abaci Robot Subject: RE: [PATCH] platform/x86: hp-bioscfg: Remove useless else Thread-Topic: [PATCH] platform/x86: hp-bioscfg: Remove useless else Thread-Index: AQHZzB4Jrsa7FfVgg0iiCdS6YCkah6/kvJ2AgAB+O6A= Date: Fri, 11 Aug 2023 15:41:58 +0000 Message-ID: References: <20230811062957.82728-1-jiapeng.chong@linux.alibaba.com> <2ec499b-c37e-0a9-c163-2a1591b56029@linux.intel.com> In-Reply-To: <2ec499b-c37e-0a9-c163-2a1591b56029@linux.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-bromium-msgid: 702b9232-4195-409a-8bee-c4fff11c20de x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR84MB1953:EE_|MW5PR84MB1818:EE_ x-ms-office365-filtering-correlation-id: 4ba4714a-c82c-425c-e1a1-08db9a817f73 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0 x-microsoft-antispam-message-info: Mi/IW/1VNN9JSmGzm5u2E/PhzgFI9K64Vn+VxTmQtJjkCgdkypovQjx12lByNQ5oFdBFfqbH5OnEoqu/phPyACNC9I4yNiE5dX2ruwwlo6rgQDTQlTZyzEwRs9s/mGN3ynf5Z2EfzNArAEq8qVOc1Vp/M+hOgXkhBqbWx9S2p+slOKuSfJMHOtnKVZP90DyWRQBFlx66xRR4VrmCTXrGv472VDAiWGmQvKR9yO05mAmLDA/DToUXqT86dYyzJkLuPoSKczdYnIXqQmv9OpcPQVMvv7zNpDEAmYy/6TlV4dEaCKvTg3zTmIznjg1YeO8KYwbiptqKt/lZvvG8FzSfsd3pCi3r1PwTN2Ich7wD6oOWxE4z4s+Z+SPlH7cgaztYTYDlc4xo3T2XgyfaMnVr78781BsYe7MZ0kfAMeYMLRSaLtJgeLZaf8f+65nM14nE7O9nERdHLMCWcWAnxrNMim9TyHoF+LoYwkDUkRfQGybxttK9OBCFFP4bx7STfQsyZrUKaXSaJjguvkY8yRCFqO8VHS65MUX5l8b8xx+A1Jun8WF0JcJ+kPotURcxqAt0+kY6af6uTtWcJkq1IK+Vkb+eyvtMjH0lcFq2PzmYOqwHyiukG9EBhZJL+zkztkS7 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR84MB1953.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(366004)(346002)(39860400002)(376002)(1800799006)(186006)(451199021)(9686003)(110136005)(71200400001)(54906003)(52536014)(4326008)(66446008)(66476007)(66556008)(76116006)(64756008)(66946007)(316002)(478600001)(7696005)(8936002)(8676002)(26005)(53546011)(5660300002)(6506007)(41300700001)(86362001)(38070700005)(82960400001)(55016003)(33656002)(38100700002)(122000001)(66574015)(83380400001)(2906002);DIR:OUT;SFP:1102 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?P5mz/66pOV13bduvXyrluJBFrHobLkAVRPVvnnC3uCHwQjxMjM4vADgpJx?= =?iso-8859-1?Q?ihiBFFCbLWQs0LOYXEqVZu9Iuv1YR/KL0aeMuY5I0xYxr3jjnCyEGusNyU?= =?iso-8859-1?Q?ICY5kkYm/SkycLfmElGE2VvgFggBszSf8fMnHNESjLFMuaNIKlvPbzgQLK?= =?iso-8859-1?Q?x3t/bFCYAg8kQmwYocMcxxXDZUhnZff0MSac22g3mEobd48D+koz4gZ3GL?= =?iso-8859-1?Q?NCAoenyosxfzXmkIDiYHWURVKI6BnqEaRes/6YirRQYNwtn4RRO9ZgGzch?= =?iso-8859-1?Q?wac26HiSRMwiZFdyopSaX/C/eEUQde1nI4YtN6221JqiYo2S6lUP3xNjAF?= =?iso-8859-1?Q?mPXlN/H3gq1U6PLEgYvsUwPRBG2SuWE333goa0lsBWfVZod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FNXRAkXSMgqwaGKPUBDvAcv58HPhhFxKEpIXjdPQqmZJGqSDOIs?= =?iso-8859-1?Q?PU4hDwbJLIB/S4+0SM+pAqPl5Vw+ZZXljBWhe7KSGKF2IDGQQjrv2g0lu/?= =?iso-8859-1?Q?wJOe1qqU23ch0Mj9xMH+C/T5k+WmEoCrfdQNl35/MZXKFcwfi5ReKMSWjx?= =?iso-8859-1?Q?lS7sP4R/KFU91zgkGBhQKW2Glj8JVJqQQwYtf6Yc0YKpP7MxlYz/F6c6jA?= =?iso-8859-1?Q?cXlCbmEJP+9Sdaj+sLPjXfTL3iJNmBNR/VopMaQ/hGmkiKkMZCA1G9ZOGa?= =?iso-8859-1?Q?fk4iSdHFnT9LfpXs7e24R417WWHS+nxWo4W2r64bmzlXAP/hu3Xqwuw5B9?= =?iso-8859-1?Q?XkMr+5cT6t6iv6pr/dixc+x4uLRL3o/eTc?= MIME-Version: 1.0 X-OriginatorOrg: hp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR84MB1953.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 4ba4714a-c82c-425c-e1a1-08db9a817f73 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2023 15:41:58.2815 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ca7981a2-785a-463d-b82a-3db87dfc3ce6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zY1gfi2r7cPGMuJH7DIDDF6HpZAmTZOoH2iPLIealM9CXSmp3TyD5opFHWoAjkYQNWh6FmQCM86+o9hnQQvSbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR84MB1818 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: hp.com Content-Language: en-US Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The redundant code is a remnant code from test phase. I concur with your changes which were approved in a separate email. Regards, Jorge Lopez HP Inc "Once you stop learning, you start dying" Albert Einstein > -----Original Message----- > From: Ilpo J=E4rvinen > Sent: Friday, August 11, 2023 3:04 AM > To: Jiapeng Chong > Cc: Lopez, Jorge A (Security) ; > hdegoede@redhat.com; markgross@kernel.org; platform-driver- > x86@vger.kernel.org; LKML ; Abaci Robot > > Subject: Re: [PATCH] platform/x86: hp-bioscfg: Remove useless else >=20 > CAUTION: External Email >=20 > On Fri, 11 Aug 2023, Jiapeng Chong wrote: >=20 > > 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 =3D=3D else). > > > > Reported-by: Abaci Robot > > 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 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 =3D > > > > 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 =3D 0; > > kfree(bioscfg_drv.password_data); >=20 > While this is a valid observation, I wonder why you didn't change the cre= ate > side too? >=20 > I hope it's not because you never took a look to understand the > SETUP_PASSWD related code, it'd be pretty impossible to not notice it. > This could have just as well have been a bug with inconsitent pairing aga= inst > create side, which is why reports from automated tools must not be > implemented blindly but the related code must be understood first. >=20 > -- > i.