mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li kunyu <kunyu@nfschina.com>
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 <kunyu@nfschina.com>
Subject: [PATCH] kernel/resource: Remove unnecessary initial values of variables
Date: Tue, 26 Sep 2023 09:45:48 +0800	[thread overview]
Message-ID: <20230926014548.31523-1-kunyu@nfschina.com> (raw)

err, new_res and dr is assigned first, so it does not need to initialize
 the assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 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),
-- 
2.18.2


             reply	other threads:[~2023-09-26  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26  1:45 Li kunyu [this message]
2023-09-26 19:56 ` Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230926014548.31523-1-kunyu@nfschina.com \
    --to=kunyu@nfschina.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®