All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Fix compilation on big endian systems
@ 2022-04-07 12:51 Pali Rohár
  2022-04-07 12:56 ` Marek Behún
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pali Rohár @ 2022-04-07 12:51 UTC (permalink / raw)
  To: Marek Behun, Qu Wenruo; +Cc: u-boot

Fix following two compile errors on big endian systems:

  CC      fs/btrfs/btrfs.o
In file included from include/linux/byteorder/big_endian.h:107,
                 from ./arch/powerpc/include/asm/byteorder.h:82,
                 from ./arch/powerpc/include/asm/bitops.h:8,
                 from include/linux/bitops.h:152,
                 from include/uuid.h:9,
                 from fs/btrfs/btrfs.c:10:
fs/btrfs/conv-funcs.h: In function ‘btrfs_key_to_disk’:
include/linux/byteorder/generic.h:90:21: error: ‘__cpu_to_le16’ undeclared (first use in this function); did you mean ‘__cpu_to_le16p’?
 #define cpu_to_le16 __cpu_to_le16
                     ^~~~~~~~~~~~~
fs/btrfs/conv-funcs.h:79:10: note: in expansion of macro ‘cpu_to_le16’
   __u16: cpu_to_le16,     \
          ^~~~~~~~~~~

  CC      fs/btrfs/compression.o
In file included from ./arch/powerpc/include/asm/unaligned.h:9,
                 from fs/btrfs/compression.c:16:
include/linux/unaligned/access_ok.h:6:19: error: redefinition of ‘get_unaligned_le16’
 static inline u16 get_unaligned_le16(const void *p)
                   ^~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:16,
                 from fs/btrfs/btrfs.h:12,
                 from fs/btrfs/compression.c:8:
include/linux/unaligned/le_byteshift.h:40:19: note: previous definition of ‘get_unaligned_le16’ was here
 static inline u16 get_unaligned_le16(const void *p)
                   ^~~~~~~~~~~~~~~~~~

Include file asm/unaligned.h contains arch specific macros and functions
for unaligned access as opposite to linux/unaligned le_byteshift.h which
contains macros and functions specific to little endian systems only.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/btrfs/btrfs.h | 2 +-
 fs/btrfs/ctree.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/btrfs.h b/fs/btrfs/btrfs.h
index 7d8b395b2646..a52587e0637a 100644
--- a/fs/btrfs/btrfs.h
+++ b/fs/btrfs/btrfs.h
@@ -9,7 +9,7 @@
 #define __BTRFS_BTRFS_H__
 
 #include <linux/rbtree.h>
-#include "conv-funcs.h"
+#include "ctree.h"
 
 extern struct btrfs_info btrfs_info;
 extern struct btrfs_fs_info *current_fs_info;
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 219c410b189f..55112318a330 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -13,7 +13,7 @@
 #include <compiler.h>
 #include <linux/rbtree.h>
 #include <linux/bug.h>
-#include <linux/unaligned/le_byteshift.h>
+#include <asm/unaligned.h>
 #include <u-boot/crc.h>
 #include "kernel-shared/btrfs_tree.h"
 #include "crypto/hash.h"
-- 
2.20.1


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

* Re: [PATCH] btrfs: Fix compilation on big endian systems
  2022-04-07 12:51 [PATCH] btrfs: Fix compilation on big endian systems Pali Rohár
@ 2022-04-07 12:56 ` Marek Behún
  2022-04-07 22:41 ` Qu Wenruo
  2022-04-20 13:11 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Marek Behún @ 2022-04-07 12:56 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Qu Wenruo, u-boot

On Thu,  7 Apr 2022 14:51:03 +0200
Pali Rohár <pali@kernel.org> wrote:

> Fix following two compile errors on big endian systems:
> 
>   CC      fs/btrfs/btrfs.o
> In file included from include/linux/byteorder/big_endian.h:107,
>                  from ./arch/powerpc/include/asm/byteorder.h:82,
>                  from ./arch/powerpc/include/asm/bitops.h:8,
>                  from include/linux/bitops.h:152,
>                  from include/uuid.h:9,
>                  from fs/btrfs/btrfs.c:10:
> fs/btrfs/conv-funcs.h: In function ‘btrfs_key_to_disk’:
> include/linux/byteorder/generic.h:90:21: error: ‘__cpu_to_le16’ undeclared (first use in this function); did you mean ‘__cpu_to_le16p’?
>  #define cpu_to_le16 __cpu_to_le16
>                      ^~~~~~~~~~~~~
> fs/btrfs/conv-funcs.h:79:10: note: in expansion of macro ‘cpu_to_le16’
>    __u16: cpu_to_le16,     \
>           ^~~~~~~~~~~
> 
>   CC      fs/btrfs/compression.o
> In file included from ./arch/powerpc/include/asm/unaligned.h:9,
>                  from fs/btrfs/compression.c:16:
> include/linux/unaligned/access_ok.h:6:19: error: redefinition of ‘get_unaligned_le16’
>  static inline u16 get_unaligned_le16(const void *p)
>                    ^~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:16,
>                  from fs/btrfs/btrfs.h:12,
>                  from fs/btrfs/compression.c:8:
> include/linux/unaligned/le_byteshift.h:40:19: note: previous definition of ‘get_unaligned_le16’ was here
>  static inline u16 get_unaligned_le16(const void *p)
>                    ^~~~~~~~~~~~~~~~~~
> 
> Include file asm/unaligned.h contains arch specific macros and functions
> for unaligned access as opposite to linux/unaligned le_byteshift.h which
> contains macros and functions specific to little endian systems only.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Marek Behún <marek.behun@nic.cz>

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

* Re: [PATCH] btrfs: Fix compilation on big endian systems
  2022-04-07 12:51 [PATCH] btrfs: Fix compilation on big endian systems Pali Rohár
  2022-04-07 12:56 ` Marek Behún
@ 2022-04-07 22:41 ` Qu Wenruo
  2022-04-20 13:11 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2022-04-07 22:41 UTC (permalink / raw)
  To: Pali Rohár, Marek Behun, Qu Wenruo; +Cc: u-boot



On 2022/4/7 20:51, Pali Rohár wrote:
> Fix following two compile errors on big endian systems:
>
>    CC      fs/btrfs/btrfs.o
> In file included from include/linux/byteorder/big_endian.h:107,
>                   from ./arch/powerpc/include/asm/byteorder.h:82,
>                   from ./arch/powerpc/include/asm/bitops.h:8,
>                   from include/linux/bitops.h:152,
>                   from include/uuid.h:9,
>                   from fs/btrfs/btrfs.c:10:
> fs/btrfs/conv-funcs.h: In function ‘btrfs_key_to_disk’:
> include/linux/byteorder/generic.h:90:21: error: ‘__cpu_to_le16’ undeclared (first use in this function); did you mean ‘__cpu_to_le16p’?
>   #define cpu_to_le16 __cpu_to_le16
>                       ^~~~~~~~~~~~~
> fs/btrfs/conv-funcs.h:79:10: note: in expansion of macro ‘cpu_to_le16’
>     __u16: cpu_to_le16,     \
>            ^~~~~~~~~~~
>
>    CC      fs/btrfs/compression.o
> In file included from ./arch/powerpc/include/asm/unaligned.h:9,
>                   from fs/btrfs/compression.c:16:
> include/linux/unaligned/access_ok.h:6:19: error: redefinition of ‘get_unaligned_le16’
>   static inline u16 get_unaligned_le16(const void *p)
>                     ^~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:16,
>                   from fs/btrfs/btrfs.h:12,
>                   from fs/btrfs/compression.c:8:
> include/linux/unaligned/le_byteshift.h:40:19: note: previous definition of ‘get_unaligned_le16’ was here
>   static inline u16 get_unaligned_le16(const void *p)
>                     ^~~~~~~~~~~~~~~~~~
>
> Include file asm/unaligned.h contains arch specific macros and functions
> for unaligned access as opposite to linux/unaligned le_byteshift.h which
> contains macros and functions specific to little endian systems only.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/btrfs.h | 2 +-
>   fs/btrfs/ctree.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/btrfs.h b/fs/btrfs/btrfs.h
> index 7d8b395b2646..a52587e0637a 100644
> --- a/fs/btrfs/btrfs.h
> +++ b/fs/btrfs/btrfs.h
> @@ -9,7 +9,7 @@
>   #define __BTRFS_BTRFS_H__
>
>   #include <linux/rbtree.h>
> -#include "conv-funcs.h"
> +#include "ctree.h"
>
>   extern struct btrfs_info btrfs_info;
>   extern struct btrfs_fs_info *current_fs_info;
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 219c410b189f..55112318a330 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -13,7 +13,7 @@
>   #include <compiler.h>
>   #include <linux/rbtree.h>
>   #include <linux/bug.h>
> -#include <linux/unaligned/le_byteshift.h>
> +#include <asm/unaligned.h>
>   #include <u-boot/crc.h>
>   #include "kernel-shared/btrfs_tree.h"
>   #include "crypto/hash.h"

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

* Re: [PATCH] btrfs: Fix compilation on big endian systems
  2022-04-07 12:51 [PATCH] btrfs: Fix compilation on big endian systems Pali Rohár
  2022-04-07 12:56 ` Marek Behún
  2022-04-07 22:41 ` Qu Wenruo
@ 2022-04-20 13:11 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-04-20 13:11 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Marek Behun, Qu Wenruo, u-boot

[-- Attachment #1: Type: text/plain, Size: 2041 bytes --]

On Thu, Apr 07, 2022 at 02:51:03PM +0200, Pali Rohár wrote:

> Fix following two compile errors on big endian systems:
> 
>   CC      fs/btrfs/btrfs.o
> In file included from include/linux/byteorder/big_endian.h:107,
>                  from ./arch/powerpc/include/asm/byteorder.h:82,
>                  from ./arch/powerpc/include/asm/bitops.h:8,
>                  from include/linux/bitops.h:152,
>                  from include/uuid.h:9,
>                  from fs/btrfs/btrfs.c:10:
> fs/btrfs/conv-funcs.h: In function ‘btrfs_key_to_disk’:
> include/linux/byteorder/generic.h:90:21: error: ‘__cpu_to_le16’ undeclared (first use in this function); did you mean ‘__cpu_to_le16p’?
>  #define cpu_to_le16 __cpu_to_le16
>                      ^~~~~~~~~~~~~
> fs/btrfs/conv-funcs.h:79:10: note: in expansion of macro ‘cpu_to_le16’
>    __u16: cpu_to_le16,     \
>           ^~~~~~~~~~~
> 
>   CC      fs/btrfs/compression.o
> In file included from ./arch/powerpc/include/asm/unaligned.h:9,
>                  from fs/btrfs/compression.c:16:
> include/linux/unaligned/access_ok.h:6:19: error: redefinition of ‘get_unaligned_le16’
>  static inline u16 get_unaligned_le16(const void *p)
>                    ^~~~~~~~~~~~~~~~~~
> In file included from fs/btrfs/ctree.h:16,
>                  from fs/btrfs/btrfs.h:12,
>                  from fs/btrfs/compression.c:8:
> include/linux/unaligned/le_byteshift.h:40:19: note: previous definition of ‘get_unaligned_le16’ was here
>  static inline u16 get_unaligned_le16(const void *p)
>                    ^~~~~~~~~~~~~~~~~~
> 
> Include file asm/unaligned.h contains arch specific macros and functions
> for unaligned access as opposite to linux/unaligned le_byteshift.h which
> contains macros and functions specific to little endian systems only.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Marek Behún <marek.behun@nic.cz>
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-04-20 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 12:51 [PATCH] btrfs: Fix compilation on big endian systems Pali Rohár
2022-04-07 12:56 ` Marek Behún
2022-04-07 22:41 ` Qu Wenruo
2022-04-20 13:11 ` Tom Rini

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.