[Xen-devel] [PATCH v3] block: refactor duplicated macros

2020-03-10 Thread Matteo Croce
to PAGE_SECTORS_MASK. Signed-off-by: Matteo Croce --- v3: As Guoqing Jiang suggested, replace "PAGE_SHIFT - 9" with "PAGE_SECTORS_SHIFT" v2: As Dan Williams suggested: #define PAGE_SECTORS_MASK(~(PAGE_SECTORS - 1)) block/blk-lib.c | 2 +- block/blk

Re: [Xen-devel] [PATCH v2] block: refactor duplicated macros

2020-03-10 Thread Matteo Croce
On Wed, Mar 11, 2020 at 12:10 AM Guoqing Jiang wrote: > > > > On 3/10/20 11:35 PM, Matteo Croce wrote: > > +++ b/drivers/md/raid1.c > > @@ -2129,7 +2129,7 @@ static void process_checks(struct r1bio *r1_bio) > > int vcnt; > > > > /* Fix va

[Xen-devel] [PATCH v2] block: refactor duplicated macros

2020-03-10 Thread Matteo Croce
The macros PAGE_SECTORS, PAGE_SECTORS_SHIFT and SECTOR_MASK are defined several times in different flavours across the whole tree. Define them just once in a common header. Signed-off-by: Matteo Croce --- v2: As Dan Williams suggested: #define PAGE_SECTORS_MASK(~(PAGE_SECTORS - 1

Re: [Xen-devel] [PATCH] block: refactor duplicated macros

2020-03-04 Thread Matteo Croce
On Wed, Mar 4, 2020 at 9:57 PM Dan Williams wrote: > > On Sun, Feb 23, 2020 at 9:04 AM Matteo Croce wrote: > > > > The macros PAGE_SECTORS, PAGE_SECTORS_SHIFT and SECTOR_MASK are defined > > several times in different flavours across the whole tree. > > Define the

[Xen-devel] [PATCH] block: refactor duplicated macros

2020-02-23 Thread Matteo Croce
The macros PAGE_SECTORS, PAGE_SECTORS_SHIFT and SECTOR_MASK are defined several times in different flavours across the whole tree. Define them just once in a common header. Signed-off-by: Matteo Croce --- block/blk-lib.c | 2 +- drivers/block/brd.c | 3