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: <d70d059e-37aa-431d-986c-5666f006d610@icloud.com>
Date: Wed, 26 Feb 2025 19:30:20 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: Zijun Hu <quic_zijuhu@...cinc.com>, Peter Zijlstra
 <peterz@...radead.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Will Deacon <will@...nel.org>, "Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
 Andrew Morton <akpm@...ux-foundation.org>, Nick Piggin <npiggin@...il.com>,
 Arnd Bergmann <arnd@...db.de>, Thomas Gleixner <tglx@...utronix.de>,
 Herbert Xu <herbert@...dor.apana.org.au>,
 "David S. Miller" <davem@...emloft.net>,
 "Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
 Johannes Berg <johannes@...solutions.net>,
 Jamal Hadi Salim <jhs@...atatu.com>, Cong Wang <xiyou.wangcong@...il.com>,
 Jiri Pirko <jiri@...nulli.us>, Jason Gunthorpe <jgg@...pe.ca>,
 Leon Romanovsky <leon@...nel.org>, Linus Walleij <linus.walleij@...aro.org>,
 Bartosz Golaszewski <brgl@...ev.pl>, Lee Jones <lee@...nel.org>,
 Thomas Graf <tgraf@...g.ch>, Christoph Hellwig <hch@....de>,
 Marek Szyprowski <m.szyprowski@...sung.com>,
 Robin Murphy <robin.murphy@....com>,
 Miquel Raynal <miquel.raynal@...tlin.com>,
 Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>,
 linux-arch@...r.kernel.org, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
 netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
 linux-rdma@...r.kernel.org, linux-gpio@...r.kernel.org,
 linux-pm@...r.kernel.org, iommu@...ts.linux.dev,
 linux-mtd@...ts.infradead.org
Subject: Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in
 void API tlb_remove_page()

On 2025/2/26 01:27, Przemek Kitszel wrote:
>>>>> It might not be your preferred coding style, but it is not completely
>>>>> pointless.
>>>>
>>>> based on below C spec such as C17 description. i guess language C does
>>>> not like this usage "return void function in void function";
>>>
>>> This is GNU extension IIRC. Note kernel uses GNU11, not C11
>>
>> any link to share about GNU11's description for this aspect ? (^^)
> this is new for C17 or was there for long time?
> 

Standard C spec has that description for long time.
Standard C11 spec also has that description.

> even if this is an extension, it is very nice for generating locked
> wrappers, so you don't have to handle void case specially
> 
> void foo_bar(...)
> {
>     lockdep_assert_held(&a_lock);
>     /// ...
> }
> 
> // generated
> void foo_bar_lock(...)
> {
>     scoped_guard(mutex, &a_lock)
>         return foo_bar(...);

above is able to be written as below:
      scoped_guard(mutex, &a_lock) {
	foo_bar(...);
	return;
      }
> }
i will list my reasons why this usage "return void function in void
function" is not good in cover letter [00/18] of this series.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ