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: Zijun Hu <hidden>
Date: 2025-02-26 11:45:50
Also in: linux-arch, linux-crypto, linux-gpio, linux-iommu, linux-mm, linux-pm, linux-rdma, linux-wireless, lkml

On 2025/2/25 23:16, David Howells wrote:
Zijun Hu [off-list ref] wrote:
quoted
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. (^^)
That may be true... for now.  But if that is changed in the future, then you
will get an error indicating something you need to go and look at... so in
that regard, it's *better* to do this ;-)
i understand your point.

if the callee tlb_remove_page_size() is in the same module with the
caller tlb_remove_page. it is meaningless to watch the callee's return type.

otherwise, provided the callee is a API which is provided by other
module author. once the author changes the API's return type, he/she
must take effort to cleanup this weird and lots of usages, that is not
nice for API provider.

this is a common issue. i will list my reasons why this usage is not
good in cover letter of this series
David
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help