linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: lib: rename `fallthrough` to `erofs_fallthrough`
@ 2025-08-27  6:09 Noboru Asai
  2025-08-27  6:13 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Noboru Asai @ 2025-08-27  6:09 UTC (permalink / raw)
  To: linux-erofs; +Cc: xiang, Noboru Asai

In order to fix compile errors with libxxhash,
since `fallthrough` is used in xxhash.h.

Signed-off-by: Noboru Asai <asai@sijam.com>
---
 include/erofs/defs.h | 4 ++--
 lib/namei.c          | 2 +-
 lib/rebuild.c        | 2 +-
 lib/zmap.c           | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/erofs/defs.h b/include/erofs/defs.h
index 0f3e754..b705149 100644
--- a/include/erofs/defs.h
+++ b/include/erofs/defs.h
@@ -370,9 +370,9 @@ unsigned long __roundup_pow_of_two(unsigned long n)
 #define __erofs_unlikely(x)    __builtin_expect(!!(x), 0)
 
 #if __has_attribute(__fallthrough__)
-# define fallthrough	__attribute__((__fallthrough__))
+# define erofs_fallthrough	__attribute__((__fallthrough__))
 #else
-# define fallthrough	do {} while (0)  /* fallthrough */
+# define erofs_fallthrough	do {} while (0)  /* fallthrough */
 #endif
 
 #ifdef __cplusplus
diff --git a/lib/namei.c b/lib/namei.c
index e0a6085..beede1e 100644
--- a/lib/namei.c
+++ b/lib/namei.c
@@ -133,7 +133,7 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi)
 	switch (vi->i_mode & S_IFMT) {
 	case S_IFDIR:
 		vi->dot_omitted = (ifmt >> EROFS_I_DOT_OMITTED_BIT) & 1;
-		fallthrough;
+		erofs_fallthrough;
 	case S_IFREG:
 	case S_IFLNK:
 		vi->u.i_blkaddr = le32_to_cpu(copied.i_u.startblk_lo) |
diff --git a/lib/rebuild.c b/lib/rebuild.c
index 95a8b3f..26c572e 100644
--- a/lib/rebuild.c
+++ b/lib/rebuild.c
@@ -231,7 +231,7 @@ static int erofs_rebuild_update_inode(struct erofs_sb_info *dst_sb,
 	case S_IFCHR:
 		if (erofs_inode_is_whiteout(inode))
 			inode->i_parent->whiteouts = true;
-		fallthrough;
+		erofs_fallthrough;
 	case S_IFBLK:
 	case S_IFIFO:
 	case S_IFSOCK:
diff --git a/lib/zmap.c b/lib/zmap.c
index 916b0d2..7ab78c1 100644
--- a/lib/zmap.c
+++ b/lib/zmap.c
@@ -460,7 +460,7 @@ static int z_erofs_map_blocks_fo(struct erofs_inode *vi,
 		end = (m.lcn << lclusterbits) | m.clusterofs;
 		map->m_flags |= EROFS_MAP_FULL_MAPPED;
 		m.delta[0] = 1;
-		fallthrough;
+		erofs_fallthrough;
 	case Z_EROFS_LCLUSTER_TYPE_NONHEAD:
 		/* get the corresponding first chunk */
 		err = z_erofs_extent_lookback(&m, m.delta[0]);
-- 
2.51.0



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

* Re: [PATCH] erofs-utils: lib: rename `fallthrough` to `erofs_fallthrough`
  2025-08-27  6:09 [PATCH] erofs-utils: lib: rename `fallthrough` to `erofs_fallthrough` Noboru Asai
@ 2025-08-27  6:13 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2025-08-27  6:13 UTC (permalink / raw)
  To: Noboru Asai, linux-erofs; +Cc: xiang

Hi Noboru,

On 2025/8/27 14:09, Noboru Asai wrote:
> In order to fix compile errors with libxxhash,
> since `fallthrough` is used in xxhash.h.
> 
> Signed-off-by: Noboru Asai <asai@sijam.com>
> ---
>   include/erofs/defs.h | 4 ++--
>   lib/namei.c          | 2 +-
>   lib/rebuild.c        | 2 +-
>   lib/zmap.c           | 2 +-
>   4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/erofs/defs.h b/include/erofs/defs.h
> index 0f3e754..b705149 100644
> --- a/include/erofs/defs.h
> +++ b/include/erofs/defs.h
> @@ -370,9 +370,9 @@ unsigned long __roundup_pow_of_two(unsigned long n)
>   #define __erofs_unlikely(x)    __builtin_expect(!!(x), 0)
>   
>   #if __has_attribute(__fallthrough__)
> -# define fallthrough	__attribute__((__fallthrough__))
> +# define erofs_fallthrough	__attribute__((__fallthrough__))
>   #else
> -# define fallthrough	do {} while (0)  /* fallthrough */
> +# define erofs_fallthrough	do {} while (0)  /* fallthrough */

Thanks for the patch!

How about using __erofs_fallthrough; for internal macros?

Thanks,
Gao Xiang



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

end of thread, other threads:[~2025-08-27  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27  6:09 [PATCH] erofs-utils: lib: rename `fallthrough` to `erofs_fallthrough` Noboru Asai
2025-08-27  6:13 ` 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).