Thread (42 messages) 42 messages, 13 authors, 2025-03-13

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

From: Peter Zijlstra <peterz@infradead.org>
Date: 2025-02-24 13:24:14
Also in: linux-arch, linux-crypto, linux-gpio, linux-iommu, linux-mm, linux-pm, linux-rdma, linux-wireless, lkml

On Sat, Feb 22, 2025 at 07:00:28PM +0800, Zijun Hu wrote:
On 2025/2/22 04:01, Peter Zijlstra wrote:
quoted
quoted
  */
 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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help