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] [day] [month] [year] [list]
Message-ID: <ZK7NUpb942858aiI@smile.fi.intel.com>
Date:   Wed, 12 Jul 2023 18:57:06 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Li kunyu <kunyu@...china.com>
Cc:     dan.j.williams@...el.com, Jonathan.Cameron@...wei.com,
        gregkh@...uxfoundation.org, rafael@...nel.org, ira.weiny@...el.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel: resource: Remove unnecessary ‘0’ values from err

On Fri, Jul 14, 2023 at 07:53:39AM +0800, Li kunyu wrote:
> err is assigned first, so it does not need to initialize the assignment.

While this is fine, I would go further to make it more explicit, i.e.

> -	int err=0;
> +	int err;
>  	struct resource new = *old;
>  	struct resource *conflict;

-	if ((err = __find_resource(root, old, &new, newsize, constraint)))
+	err = __find_resource(root, old, &new, newsize, constraint);
+	if (err)

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ