On 2020/5/5 20:10, Matthew Wilcox wrote:
> On Tue, May 05, 2020 at 07:55:40PM +0800, Zhen Lei wrote:
>> +#ifndef SECTORS_PER_PAGE_SHIFT
>> +#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
>> +#endif
>> +#ifndef SECTORS_PER_PAGE
>> +#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT)
>> #endif
>
> I find SECTORS_PER_PAGE_SHIFT quite hard to read. I had a quick skim
> of your other patches, and it seems to me that we could replace
> '<< SECTORS_PER_PAGE_SHIFT' with '* SECTORS_PER_PAGE' and it would be
> more readable in every case.
OK, I will delete SECTORS_PER_PAGE_SHIFT, and replace the shift with {*|/}
SECTORS_PER_PAGE if it's
not suitable to be replaced by sectors_to_page()/page_to_sectors().
>
> .
>
- [PATCH 0/4] eliminate SECTOR related magic numbers a... Zhen Lei
- [PATCH 1/4] block: Move SECTORS_PER_PAGE and SE... Zhen Lei
- Re: [PATCH 1/4] block: Move SECTORS_PER_PAG... Matthew Wilcox
- Re: [PATCH 1/4] block: Move SECTORS_PER... Leizhen (ThunderTown)
- [PATCH 2/4] mm/swap: use SECTORS_PER_PAGE_SHIFT... Zhen Lei
- Re: [PATCH 2/4] mm/swap: use SECTORS_PER_PA... Matthew Wilcox
- Re: [PATCH 2/4] mm/swap: use SECTORS_PE... Leizhen (ThunderTown)
- Re: [PATCH 2/4] mm/swap: use SECTOR... Leizhen (ThunderTown)
- Re: [PATCH 2/4] mm/swap: use S... Leizhen (ThunderTown)
- [PATCH 3/4] block: use SECTORS_PER_PAGE_SHIFT a... Zhen Lei
- [PATCH 4/4] mtd: eliminate SECTOR related magic... Zhen Lei
- Re: [PATCH 0/4] eliminate SECTOR related magic ... antlists
- Re: [PATCH 0/4] eliminate SECTOR related ma... Matthew Wilcox

