Re: [PATCH] nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header

From: Andrew Morton
Date: Sat Jul 06 2019 - 23:37:50 EST


On Wed, 5 Jun 2019 14:30:06 +0900 Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx> wrote:

> cpu_to_le32/le32_to_cpu is defined in include/linux/byteorder/generic.h,
> which is not exported to user-space.
>
> UAPI headers must use the ones prefixed with double-underscore.
>
> Detected by compile-testing exported headers:
>
> ./usr/include/linux/nilfs2_ondisk.h: In function ânilfs_checkpoint_set_snapshotâ:
> ./usr/include/linux/nilfs2_ondisk.h:536:17: error: implicit declaration of function âcpu_to_le32â [-Werror=implicit-function-declaration]
> cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
> ^
> ./usr/include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro âNILFS_CHECKPOINT_FNSâ
> NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
> ^~~~~~~~~~~~~~~~~~~~
> ./usr/include/linux/nilfs2_ondisk.h:536:29: error: implicit declaration of function âle32_to_cpuâ [-Werror=implicit-function-declaration]
> cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
> ^
> ./usr/include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro âNILFS_CHECKPOINT_FNSâ
> NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
> ^~~~~~~~~~~~~~~~~~~~
> ./usr/include/linux/nilfs2_ondisk.h: In function ânilfs_segment_usage_set_cleanâ:
> ./usr/include/linux/nilfs2_ondisk.h:622:19: error: implicit declaration of function âcpu_to_le64â [-Werror=implicit-function-declaration]
> su->su_lastmod = cpu_to_le64(0);
> ^~~~~~~~~~~

Seems fairly serious. I'm thinking this needs a cc:stable?