linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: erofs: remove __EROFS_BIT
@ 2018-12-11 17:57 Gao Xiang
  2018-12-12 11:22 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Gao Xiang @ 2018-12-11 17:57 UTC (permalink / raw)


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.

Suggested-by: Joe Perches <joe at perches.com>
Signed-off-by: Gao Xiang <hsiangkao at aol.com>
---
 drivers/staging/erofs/erofs_fs.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h
index d4bffa2852b3..fa52898df006 100644
--- a/drivers/staging/erofs/erofs_fs.h
+++ b/drivers/staging/erofs/erofs_fs.h
@@ -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        1
 
 struct erofs_inode_v1 {
 /*  0 */__le16 i_advise;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] staging: erofs: remove __EROFS_BIT
  2018-12-11 17:57 [PATCH] staging: erofs: remove __EROFS_BIT Gao Xiang
@ 2018-12-12 11:22 ` Chao Yu
  2018-12-12 11:47   ` Gao Xiang
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2018-12-12 11:22 UTC (permalink / raw)


On 2018-12-12 1:57, Gao Xiang wrote:
> 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.
> 
> 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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] staging: erofs: remove __EROFS_BIT
  2018-12-12 11:22 ` Chao Yu
@ 2018-12-12 11:47   ` Gao Xiang
  0 siblings, 0 replies; 3+ messages in thread
From: Gao Xiang @ 2018-12-12 11:47 UTC (permalink / raw)


Hi Chao,

On 2018/12/12 19:22, Chao Yu wrote:
> On 2018-12-12 1:57, Gao Xiang wrote:
>> 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.
>>
>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-12 11:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 17:57 [PATCH] staging: erofs: remove __EROFS_BIT Gao Xiang
2018-12-12 11:22 ` Chao Yu
2018-12-12 11:47   ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).