From nobody Sun Feb 8 06:22:04 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D710BC001DD for ; Fri, 14 Jul 2023 01:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234364AbjGNBxi (ORCPT ); Thu, 13 Jul 2023 21:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234317AbjGNBxg (ORCPT ); Thu, 13 Jul 2023 21:53:36 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0E65E2D60 for ; Thu, 13 Jul 2023 18:53:30 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 151E86062C7C7; Fri, 14 Jul 2023 09:53:09 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: dan.j.williams@intel.com, gregkh@linuxfoundation.org, Jonathan.Cameron@huawei.com, ira.weiny@intel.com, bhelgaas@google.com, andriy.shevchenko@linux.intel.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH v2] =?UTF-8?q?kernel:=20resource:=20Remove=20unnecessary=20?= =?UTF-8?q?=E2=80=980=E2=80=99=20values=20from=20err?= Date: Sun, 16 Jul 2023 02:24:28 +0800 Message-Id: <20230715182428.3348-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" err is assigned first, so it does not need to initialize the assignment. Modify __find_resource execution syntax to make it more in line with commonly used styles. Signed-off-by: Li kunyu Reviewed-by: Andy Shevchenko Reviewed-by: Randy Dunlap --- v2: Modify __find_resource Execution Syntax. kernel/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index b1763b2fd7ef..ee79e8f4f422 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -656,13 +656,14 @@ static int reallocate_resource(struct resource *root,= struct resource *old, resource_size_t newsize, struct resource_constraint *constraint) { - int err=3D0; + int err; struct resource new =3D *old; struct resource *conflict; =20 write_lock(&resource_lock); =20 - if ((err =3D __find_resource(root, old, &new, newsize, constraint))) + err =3D __find_resource(root, old, &new, newsize, constraint); + if (err) goto out; =20 if (resource_contains(&new, old)) { --=20 2.18.2