staging: erofs: remove __EROFS_BIT
PATCH 1/1 staging: erofs: remove __EROFS_BIT
It's better to use pre-calculated values to make on-disk definition more straight-forward and human-readable.
Since there is the only one user, let's remove__EROFS_BIT entirely.
--- drivers/staging/erofs/erofs_fs.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/erofs/erofs_fs.h +3 -5
@@ -38,10 +38,6 @@ struct erofs_super_block {/* 80 */ __u8 reserved2[48 ];/* 128 bytes */ } __packed; -#define __EROFS_BIT (_prefix, _cur, _pre) enum { \ - _prefix ## _cur ## _BIT = _prefix ## _pre ## _BIT + \ - _prefix ## _pre ## _BITS } -/* * erofs inode data mapping: * 0 - inode plain without inline data A:
@@ -58,11 +54,13 @@ enum { EROFS_INODE_LAYOUT_INLINE,EROFS_INODE_LAYOUT_MAX }; + +/* bit definitions of inode i_advise */ #define EROFS_I_VERSION_BITS 1#define EROFS_I_DATA_MAPPING_BITS 3#define EROFS_I_VERSION_BIT 0 -__EROFS_BIT (EROFS_I_ ,DATA_MAPPING ,VERSION ); +#define EROFS_I_DATA_MAPPING_BIT 1struct erofs_inode_v1 {/* 0 */ __le16 i_advise;
Signature · 1 line
2.11.0
PATCH 1/1 staging: erofs: remove __EROFS_BIT
Quoted 8 lines · Gao Xiang
It's better to use pre-calculated values to make on-disk definition more straight-forward and human-readable.
Since there is the only one user, let's remove
__EROFS_BITentirely.Suggested-by Joe Perches <joe at perches.com>Signed-off-by Gao Xiang <hsiangkao at aol.com>
It looks this patch has been merged, anyway
Thanks,
PATCH 1/1 staging: erofs: remove __EROFS_BIT
Hi Chao,
Quoted 7 lines · Chao Yu
Quoted 6 lines · Gao Xiang
It's better to use pre-calculated values to make on-disk definition more straight-forward and human-readable.
Since there is the only one user, let's remove
__EROFS_BITentirely.
Quoted 7 lines
Quoted 2 lines
Suggested-by Joe Perches <joe at perches.com>Signed-off-by Gao Xiang <hsiangkao at aol.com>It looks this patch has been merged, anyway
Reviewed-by Chao Yu <yuchao0 at huawei.com>Thanks,
Thanks for kindly review :)
Yesterday Joe Perches made a suggestion and then I sent a patch to fix that...
Thanks,
Gao Xiang