Re: [PATCH] block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>
From: Johannes Thumshirn <hidden>
Date: 2018-02-13 08:43:12
On Mon, 2018-02-12 at 11:05 -0800, Bart Van Assche wrote:
quoted hunk ↗ jump to hunk
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ac4740cf74be..cf17626604c2 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h@@ -1026,14 +1026,25 @@ static inline int blk_rq_cur_bytes(conststruct request *rq) extern unsigned int blk_rq_err_bytes(const struct request *rq); +/* + * Variables of type sector_t represent an offset or size that is a multiple of + * 2**9 bytes. Hence these two constants. + */ +#ifndef SECTOR_SHIFT +enum { SECTOR_SHIFT = 9 }; +#endif +#ifndef SECTOR_SIZE +enum { SECTOR_SIZE = 512 }; +#endif
Can you please make a #define out of these enums? I know gdb can cope better with enums than defines but IIRC adding -ggdb3 to the CFLAGS solves this issue. Apart from that: Reviewed-by: Johannes Thumshirn <redacted> -- Johannes Thumshirn Storage jthu mshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850