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/25 23:16, David Howells wrote:
> Zijun Hu <zijun_hu@xxxxxxxxxx> 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. (^^)
> 
> 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
> 





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux