All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: avoid PAGE_SIZE redefinition
       [not found] <20200325082930.2025-1-hsiangkao.ref@aol.com>
@ 2020-03-25  8:29 ` Gao Xiang via Linux-erofs
  2020-03-26 16:19   ` Li GuiFu via Linux-erofs
  2020-03-27  7:42   ` Chao Yu
  0 siblings, 2 replies; 3+ messages in thread
From: Gao Xiang via Linux-erofs @ 2020-03-25  8:29 UTC (permalink / raw)
  To: linux-erofs, Li Guifu, Li GuiFu

Buildroot autobuild reported a PAGE_SIZE redefinition with some
configrations on i586 toolchain [1] (I didn't notice such report
from erofs-utils travis CI or distribution builds before.)

In file included from config.c:11:
../include/erofs/internal.h:27: error: "PAGE_SIZE" redefined [-Werror]
 #define PAGE_SIZE  (1U << PAGE_SHIFT)

In file included from ../include/erofs/defs.h:17,
                 from ../include/erofs/config.h:12,
                 from ../include/erofs/print.h:12,
                 from config.c:10:
.../sysroot/usr/include/limits.h:89: note: this is the location of the previous definition
 #define PAGE_SIZE PAGESIZE

cc1: all warnings being treated as errors

Fix it now.

[1] http://autobuild.buildroot.net/results/340b98caa45bafd43f109002be9da59ba7f6d971
Signed-off-by: Gao Xiang <hsiangkao@aol.com>
---
 include/erofs/internal.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index e7d5a64..41da189 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -23,8 +23,18 @@ typedef unsigned short umode_t;
 #define PATH_MAX        4096    /* # chars in a path name including nul */
 #endif
 
+#ifndef PAGE_SHIFT
 #define PAGE_SHIFT		(12)
+#endif
+
+#ifndef PAGE_SIZE
 #define PAGE_SIZE		(1U << PAGE_SHIFT)
+#endif
+
+/* no obvious reason to support explicit PAGE_SIZE != 4096 for now */
+#if PAGE_SIZE != 4096
+#error incompatible PAGE_SIZE is already defined
+#endif
 
 #define LOG_BLOCK_SIZE          (12)
 #define EROFS_BLKSIZ            (1U << LOG_BLOCK_SIZE)
-- 
2.20.1


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

* Re: [PATCH] erofs-utils: avoid PAGE_SIZE redefinition
  2020-03-25  8:29 ` [PATCH] erofs-utils: avoid PAGE_SIZE redefinition Gao Xiang via Linux-erofs
@ 2020-03-26 16:19   ` Li GuiFu via Linux-erofs
  2020-03-27  7:42   ` Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Li GuiFu via Linux-erofs @ 2020-03-26 16:19 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs, Li Guifu



On 2020/3/25 16:29, Gao Xiang wrote:
> Buildroot autobuild reported a PAGE_SIZE redefinition with some
> configrations on i586 toolchain [1] (I didn't notice such report
> from erofs-utils travis CI or distribution builds before.)
> 
> In file included from config.c:11:
> ../include/erofs/internal.h:27: error: "PAGE_SIZE" redefined [-Werror]
>  #define PAGE_SIZE  (1U << PAGE_SHIFT)
> 
> In file included from ../include/erofs/defs.h:17,
>                  from ../include/erofs/config.h:12,
>                  from ../include/erofs/print.h:12,
>                  from config.c:10:
> .../sysroot/usr/include/limits.h:89: note: this is the location of the previous definition
>  #define PAGE_SIZE PAGESIZE
> 
> cc1: all warnings being treated as errors
> 
> Fix it now.
> 
> [1] http://autobuild.buildroot.net/results/340b98caa45bafd43f109002be9da59ba7f6d971
> Signed-off-by: Gao Xiang <hsiangkao@aol.com>

It looks good
Reviewed-by: Li Guifu <bluce.lee@aliyun.com>
Thanks

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

* Re: [PATCH] erofs-utils: avoid PAGE_SIZE redefinition
  2020-03-25  8:29 ` [PATCH] erofs-utils: avoid PAGE_SIZE redefinition Gao Xiang via Linux-erofs
  2020-03-26 16:19   ` Li GuiFu via Linux-erofs
@ 2020-03-27  7:42   ` Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2020-03-27  7:42 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs, Li Guifu, Li GuiFu

On 2020/3/25 16:29, Gao Xiang via Linux-erofs wrote:
> Buildroot autobuild reported a PAGE_SIZE redefinition with some
> configrations on i586 toolchain [1] (I didn't notice such report
> from erofs-utils travis CI or distribution builds before.)
> 
> In file included from config.c:11:
> ../include/erofs/internal.h:27: error: "PAGE_SIZE" redefined [-Werror]
>  #define PAGE_SIZE  (1U << PAGE_SHIFT)
> 
> In file included from ../include/erofs/defs.h:17,
>                  from ../include/erofs/config.h:12,
>                  from ../include/erofs/print.h:12,
>                  from config.c:10:
> .../sysroot/usr/include/limits.h:89: note: this is the location of the previous definition
>  #define PAGE_SIZE PAGESIZE
> 
> cc1: all warnings being treated as errors
> 
> Fix it now.
> 
> [1] http://autobuild.buildroot.net/results/340b98caa45bafd43f109002be9da59ba7f6d971
> Signed-off-by: Gao Xiang <hsiangkao@aol.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

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

end of thread, other threads:[~2020-03-27  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200325082930.2025-1-hsiangkao.ref@aol.com>
2020-03-25  8:29 ` [PATCH] erofs-utils: avoid PAGE_SIZE redefinition Gao Xiang via Linux-erofs
2020-03-26 16:19   ` Li GuiFu via Linux-erofs
2020-03-27  7:42   ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.