From patchwork Tue Sep 26 01:45:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 144677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1610997vqu; Mon, 25 Sep 2023 18:49:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoh4sWgi+RubVJ7KsK+6TbpvUnWR2r3RcEhISQDkRDEydQjX7vkHewUztpb+ya+nzSPznP X-Received: by 2002:a05:6808:1988:b0:3ae:12f6:ac51 with SMTP id bj8-20020a056808198800b003ae12f6ac51mr12423229oib.41.1695692987768; Mon, 25 Sep 2023 18:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695692987; cv=none; d=google.com; s=arc-20160816; b=MxKMAmRk1wKEcTHKiWqpke9h1/IaaeYSTml1gFu/xHS3j6llJ6jpoC7zQM54DCYVCR tCJyA+KP3UFdrt38Vh8ak85cDSAjg9rqd+g1QuAkyhRBagKUlPJDM5Yha6f5nFfzJFD2 yuZ2MkpX4Iq8+EBQFgZa7A4TaahzTUgh/PsbylkdYB1Ss7w5YNVVfwZtUloCUEE+C3Nz ZKvhn6lQpmut5DrKTmVhRJqWguVtpbG0tkcn1F7rZMIQ6yenM9SIfEcCBvhU7ylI/mI2 6gETyD/jEWtQ5gVR/XxVpW0WgrFhbVK7jCMfxwHqJsRMiLp0KY7Yw2xCpmOYti+nSfDZ AWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=P5OUjOxmrxrFBFD1tZfU8tYzpQ9xFgQooKVAG5EWyYw=; fh=p2Bz44yYYYcEqQOl1fqcA5yKhVfTUgZSdt94fWHQe+k=; b=gNHd5d43atDlwXwz+5P3A+HiWAz6Q50SVsezS7ZjXD8jzfa+7mSAJs0jvr3t5x6hkt fTBYGb+aBXph6IVYBGSzwfNA3fMFJYvYsNYu6R2EQK0X8+rwPvYHvRtYLVi0E/cNMsyp x6W9RwHFH91T15i18H1d8QB73Sd+6rQyhZLRufc/F+4S5B9JCOskq4WgBsXVeCbgzx7O pMBqbrZETI2ZmLdqYug9PFLBCKRxZdOgLy1ivK6x4ecFnfoveykVX3BXGWDt/Jdm4yw0 53m1XX/fPvy1eLXzxQ0xBab+2DUapBDu6Vsvqs1GysAr/FxKactThgaUTssFnAYvwg2Z 88Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y72-20020a638a4b000000b00563f8e3fca8si11032688pgd.49.2023.09.25.18.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A9D38802F31A; Mon, 25 Sep 2023 18:46:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbjIZBqS (ORCPT + 27 others); Mon, 25 Sep 2023 21:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjIZBqR (ORCPT ); Mon, 25 Sep 2023 21:46:17 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 9FCC1101 for ; Mon, 25 Sep 2023 18:46:10 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 1139D604F04C6; Tue, 26 Sep 2023 09:45:55 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: gregkh@linuxfoundation.org, dan.j.williams@intel.com, pasha.tatashin@soleen.com, andriy.shevchenko@linux.intel.com, Jonathan.Cameron@huawei.com, ira.weiny@intel.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] kernel/resource: Remove unnecessary initial values of variables Date: Tue, 26 Sep 2023 09:45:48 +0800 Message-Id: <20230926014548.31523-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 18:46:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778062970027498455 X-GMAIL-MSGID: 1778062970027498455 err, new_res and dr is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li kunyu --- kernel/resource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index b1763b2fd7ef..bbd7c113307a 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -656,7 +656,7 @@ static int reallocate_resource(struct resource *root, struct resource *old, resource_size_t newsize, struct resource_constraint *constraint) { - int err=0; + int err; struct resource new = *old; struct resource *conflict; @@ -1310,7 +1310,7 @@ EXPORT_SYMBOL(__release_region); void release_mem_region_adjustable(resource_size_t start, resource_size_t size) { struct resource *parent = &iomem_resource; - struct resource *new_res = NULL; + struct resource *new_res; bool alloc_nofail = false; struct resource **p; struct resource *res; @@ -1556,7 +1556,7 @@ struct resource * __devm_request_region(struct device *dev, struct resource *parent, resource_size_t start, resource_size_t n, const char *name) { - struct region_devres *dr = NULL; + struct region_devres *dr; struct resource *res; dr = devres_alloc(devm_region_release, sizeof(struct region_devres),