Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7072836rdb; Wed, 3 Jan 2024 03:54:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/oO6tBnMr0oVbalbmpF7CIjO831JceZ35hUx6Mm6eUwKvEGSR8NEr9Joz6eYHwH0vOgUS X-Received: by 2002:a17:906:c0d2:b0:a23:f50:60f7 with SMTP id bn18-20020a170906c0d200b00a230f5060f7mr8734202ejb.102.1704282847929; Wed, 03 Jan 2024 03:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704282847; cv=none; d=google.com; s=arc-20160816; b=X/M8XzO3Ut2jQkWX+lmJA/DuZmyvy59f8XYNoKAze5RA8lA9QrAkMZj1sLGZx+FgQs TNGTIaMnYNBKo2oZlaURSwGAOFslUTb6T8nd6Z1tk3T2Mvxxbi5C0/KFW2ysmblDC9wY ojaMDw8sJ5ptVLXi075oDIq3oIkfwBqOPxjUmeFbBbDGuyAzg8VeY8l0Q6km5jLydx+W aQLeoe3wKv6P/QNjvbaCZKoIa6JH/8jVsXc0l+Blhggw6L8wubhXybCILBjmCWbZK0CY Ici0s3fm7l6xbepLxZhZe9WnR6IynBrNTn2MtpCn8706B9pi6UVPRIabxLpLWoevAPDs 88Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=/Tg6mebgx6QywNHr67GpWqLwrWYjsTjYg7qRHcZaMz8=; fh=CH3tF2QTLKTgScipqaXmd8Qp7XjvKRrBvbTyVYKxGdA=; b=Reypx+bLhQV54rha4uJ3vvlRT303IYb6QTVdcM+ijV+b4T0rWr84HD/W1ntbznZ8kG tUNoePtKwpm8orGAc9q6nB8+UH07c0x7Lnijjkdi8aQxjQ/5z4GnnA86DhtwJHQtmmXy tP6bZBDyxsoLbhrp5ER1fvDd8fMKjTW6pU2/yOkl975FhKyDhC3yIn9u3IWUYzlLcB6p mQP7T3UFympuoPVKNDi4m7R+9FVOFelGKw7nHGiygdhlPhPGIclzfCIR+EdliK6SKcDz 14v8L9tSeQ1CFZtQBKl+ZIvyT5UdVJ6oGF3JigylMH2ie+cqgcny3e+9qLzw/K33T+9w klNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OApK6385; spf=pass (google.com: domain of linux-kernel+bounces-15466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id zh7-20020a170906880700b00a2755c4b7eesi5188588ejb.170.2024.01.03.03.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 03:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15466-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; dkim=pass header.i=@intel.com header.s=Intel header.b=OApK6385; spf=pass (google.com: domain of linux-kernel+bounces-15466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ABFC11F232B7 for ; Wed, 3 Jan 2024 11:54:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A7AD18E3F; Wed, 3 Jan 2024 11:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OApK6385" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (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 69C1318E29; Wed, 3 Jan 2024 11:53:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704282834; x=1735818834; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=n/vnjjrsEvZOXJJT326FKEYl+/HDigv3czkS2CfPJT0=; b=OApK6385WL3gL4WQt6wEH5Y+qNfN1xgXacsFquXhM4nu0AVveDmZWm+X 2/uzDmNTstDgAhR2rgfIZYlD36n88Q+GQ+sPqim+fqvqEQrh5NweLI9lY IRvpFWTRzZ0jj+/1ULpiTZBV2HePYJeM4F5sRFCpELZNbKsCz9nu+d70g CcAmBLxIWt9MoBceOGtLYw0KOFH3zhc4VhstbCQH/yeq4didHt2ILgTdQ pgf1BfmysEL9nDJoOa0euP6kEvw+MeOTqBdGq7SGIxfRZjdQCNogQ1uXm /OLwJWq4byxTN3djeEWhh1zM/I/Y9xGXLChA3N9N1qT6N0C1ZCturMEkQ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10941"; a="376486991" X-IronPort-AV: E=Sophos;i="6.04,327,1695711600"; d="scan'208";a="376486991" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 03:53:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10941"; a="953210478" X-IronPort-AV: E=Sophos;i="6.04,327,1695711600"; d="scan'208";a="953210478" Received: from bergbenj-mobl1.ger.corp.intel.com ([10.251.211.32]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 03:53:51 -0800 Date: Wed, 3 Jan 2024 13:53:48 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jiapeng Chong cc: jorge.lopez2@hp.com, Hans de Goede , platform-driver-x86@vger.kernel.org, LKML , Abaci Robot Subject: Re: [PATCH] platform/x86: hp-bioscfg: Remove useless else In-Reply-To: <20240103021746.5337-1-jiapeng.chong@linux.alibaba.com> Message-ID: <9f34109e-fc90-d2d1-5bd7-87aa51fdc39f@linux.intel.com> References: <20240103021746.5337-1-jiapeng.chong@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 > 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); 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.