Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux