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 Sat, Feb 22, 2025 at 07:00:28PM +0800, Zijun Hu wrote:
> On 2025/2/22 04:01, Peter Zijlstra wrote:
> >>   */
> >>  static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
> >>  {
> >> -	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >> +	tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >>  }
> > So I don't mind removing it, but note that that return enforces
> > tlb_remove_page_size() has void return type.
> >
> 
> tlb_remove_page_size() is void function already. (^^)

Yes, but if you were to change that, the above return would complain.

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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux