From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Li kunyu <kunyu@nfschina.com>
Cc: dan.j.williams@intel.com, gregkh@linuxfoundation.org,
Jonathan.Cameron@huawei.com, ira.weiny@intel.com,
bhelgaas@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kernel: resource: Remove unnecessary ‘0’ values from err
Date: Fri, 14 Jul 2023 11:07:27 +0300 [thread overview]
Message-ID: <ZLECP7KmESS1pkha@smile.fi.intel.com> (raw)
In-Reply-To: <20230715182428.3348-1-kunyu@nfschina.com>
On Sun, Jul 16, 2023 at 02:24:28AM +0800, Li kunyu wrote:
> 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.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 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
>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-07-14 8:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 18:24 [PATCH v2] kernel: resource: Remove unnecessary ‘0’ values from err Li kunyu
2023-07-14 2:32 ` Randy Dunlap
2023-07-14 8:07 ` Andy Shevchenko [this message]
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=ZLECP7KmESS1pkha@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=kunyu@nfschina.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