Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp856688rdg; Fri, 11 Aug 2023 01:53:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAQ2KeOGipGJxDhBfXDgyZFMZLyR4Gh9RP1EgCySbk4vr0UrXRq6dSyOo4q4sBN+3MR2TJ X-Received: by 2002:a17:906:8a6c:b0:99c:ed95:5f90 with SMTP id hy12-20020a1709068a6c00b0099ced955f90mr1227619ejc.3.1691744035063; Fri, 11 Aug 2023 01:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691744035; cv=none; d=google.com; s=arc-20160816; b=WZp/+KGbR313OyVNmhTJNfVAc4g6wO0DvflSC6QpYfGdVi/PIaZSZzwysjCE/uFOTh PWGhN27ozAWcT04Y+z7kdueIBN1DoNp15uvxqhORuaJvYbzELr6jVe4tHcLCXWpeQNF2 wO/Qi0ghdaAf7tdndAlvxqEMzdtU/MeGsdlQBr0Ao66rEgyN9aNOrE4qxkoz05/dBHgy 7SmA0LgWeBbU/bJWfZP954AVkZm5i9g+qEQz/TUthv1FJRnY+2Rv7MtHS3KxQJugwPhO H/kvZQ2T4wCcb4tNCThsgPBKM3s5tegL3yqWDY2c9ZSjvlnjThOiu4hTptpnj90aUG10 CoQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=3o6cT2rKqXUqUYXnrvh2S3IOVSONdedkPj/KW2coEks=; fh=2jFjsW+C6wI9121h1703m1ozKa61PFzXuExBFvq3tFE=; b=ACtjmvnpNMGzwOMQ7NJpsDHJftB5+ciYUWT1VHDC/hAja7WJlIEAMfasVtv0pmWRfv xsAIXHMnoYE8jX65+BPWv1GYkQjhaGv/Nw8RLaMujgUUMsKUP76RELrnyTSIgdIKswoy JCDHtZKFDRk/PbGyQu1Jk9sBTuKIGExPS/xM87QKXPluy9qY/90vYu+g2BaxjXcY+P3j 4q4pnXkqImnR8IlcTT0Bag/ioQO0XDAC/gMmp7D3pGgYDQJz68dS960NNux0CYnUzf1Z Xpj8jYUTFjSSMx571PF5Jsq1SX/l1vQQbzwx4IgeTCf/bx8VzYvCTHOJL8UUa+IvfPxy ulPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TBa9Sdh2; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj12-20020a170906b04c00b0099352e47e87si3077692ejb.29.2023.08.11.01.53.30; Fri, 11 Aug 2023 01:53:55 -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=@intel.com header.s=Intel header.b=TBa9Sdh2; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234339AbjHKIEX (ORCPT + 99 others); Fri, 11 Aug 2023 04:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjHKIEW (ORCPT ); Fri, 11 Aug 2023 04:04:22 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB2C410FB; Fri, 11 Aug 2023 01:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691741061; x=1723277061; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=OI4Vyx79SFJFjotLEqTDnh6sgtstdHl0KwIylo48sJg=; b=TBa9Sdh2FKT/OGiseAjPHZsLATsgQ9YBw1Y0WkjjcImGGu+aNVoEATH5 UBSVT6BypUF71Z093v+L2RSdoC0W8QeHzcDLHmsBNBh5XD6fJ/o+gzNfz AREayJvja9ipcYZTVdcu6iK+ijfsxhUpVPkKpqNawYRLexYuBX6gWieSr bKHj94gZDtqEMYN04sszU/vDgte3trtngnj9R5pY0vTxcvEk+BC7OTs+F qXY/8ClBH2rvVOtE3hexu1OiMINAS6w6oMFz4pLbMEG5NMSdYhg5vfa+x hPeRQYYhrH9f5mWGfIWPG6ae/31nrtKiD9rBfizC/F8e8kzHGfbSeBQbY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="371634171" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="371634171" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 01:04:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="979157565" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="979157565" Received: from aberko-mobl1.ger.corp.intel.com ([10.252.51.87]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 01:04:19 -0700 Date: Fri, 11 Aug 2023 11:04:17 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jiapeng Chong cc: jorge.lopez2@hp.com, 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 In-Reply-To: <20230811062957.82728-1-jiapeng.chong@linux.alibaba.com> Message-ID: <2ec499b-c37e-0a9-c163-2a1591b56029@linux.intel.com> References: <20230811062957.82728-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 On Fri, 11 Aug 2023, 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:545:3-5: WARNING: possible condition with no effect (if == 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 = > 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); While this is a valid observation, I wonder why you didn't change the create side too? 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 against create side, which is why reports from automated tools must not be implemented blindly but the related code must be understood first. -- i.