mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li kunyu <kunyu@nfschina.com>
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 <kunyu@nfschina.com>
Subject: [PATCH v2] kernel: resource: Remove unnecessary ‘0’ values from err
Date: Sun, 16 Jul 2023 02:24:28 +0800	[thread overview]
Message-ID: <20230715182428.3348-1-kunyu@nfschina.com> (raw)

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 <kunyu@nfschina.com>
---
 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=0;
+	int err;
 	struct resource new = *old;
 	struct resource *conflict;
 
 	write_lock(&resource_lock);
 
-	if ((err = __find_resource(root, old, &new, newsize, constraint)))
+	err = __find_resource(root, old, &new, newsize, constraint);
+	if (err)
 		goto out;
 
 	if (resource_contains(&new, old)) {
-- 
2.18.2


             reply	other threads:[~2023-07-14  1:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-15 18:24 Li kunyu [this message]
2023-07-14  2:32 ` Randy Dunlap
2023-07-14  8:07 ` Andy Shevchenko

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=20230715182428.3348-1-kunyu@nfschina.com \
    --to=kunyu@nfschina.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®