lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b646c8d-4449-40d2-e43a-a3330c77eb29@infradead.org>
Date:   Thu, 13 Jul 2023 19:32:27 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Li kunyu <kunyu@...china.com>, dan.j.williams@...el.com,
        gregkh@...uxfoundation.org, Jonathan.Cameron@...wei.com,
        ira.weiny@...el.com, bhelgaas@...gle.com,
        andriy.shevchenko@...ux.intel.com
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] kernel: resource: Remove unnecessary ‘0’ values from err



On 7/15/23 11:24, 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.
> 
> Signed-off-by: Li kunyu <kunyu@...china.com>

Reviewed-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.

> ---
>  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)) {

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ