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: <5201C4AB.4070309@asianux.com>
Date:	Wed, 07 Aug 2013 11:53:15 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	Joe Perches <joe@...ches.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	"Eric W. Biederman" <ebiederm@...ssion.com>, xi.wang@...il.com,
	nicolas.dichtel@...nd.com,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value
 'result'

On 08/07/2013 06:11 AM, Joe Perches wrote:
> On Tue, 2013-08-06 at 14:43 -0700, Andrew Morton wrote:
>> On Tue, 06 Aug 2013 15:29:42 +0800 Chen Gang <gang.chen@...anux.com> wrote:
>>
>>> Improve the usage of return value 'result', so not only can make code
>>> clearer to readers, but also can improve the performance.
>>
>> It used to be pervasive kernel style do to
>>
>> 	ret = -ENOMEM;
>> 	foo = alloc(...);
>> 	if (!foo)
>> 		goto out;
>>
>> whereas nowadays people usually do the more straightforward
>>
>> 	foo = alloc(...);
>> 	if (!foo) {
>> 		ret = -ENOMEM;
>> 		goto out;
>> 	}
>>
>> The thinking was that the old style generated better code, but for the
>> life of me I can't remember why :(
> 
> https://lkml.org/lkml/2008/12/16/383
> 

Thank you for your information.

-- 
Chen Gang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ