Skip to content
  • Masahiro Yamada's avatar
    c32cc30c
    nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header · c32cc30c
    Masahiro Yamada authored
    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:
    
      include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot':
      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) |  \
                       ^
      include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
       NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
       ^~~~~~~~~~~~~~~~~~~~
      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) |  \
                                   ^
      include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
       NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
       ^~~~~~~~~~~~~~~~~~~~
      include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean':
      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);
                         ^~~~~~~~~~~
    
    Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com
    
    
    Fixes: e63e88bc ("nilfs2: move ioctl interface and disk layout to uapi separately")
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Greg KH <gregkh@linuxfoundation.org>
    Cc: Joe Perches <joe@perches.com>
    Cc: <stable@vger.kernel.org>	[4.9+]
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c32cc30c
    nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header
    Masahiro Yamada authored
    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:
    
      include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot':
      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) |  \
                       ^
      include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
       NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
       ^~~~~~~~~~~~~~~~~~~~
      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) |  \
                                   ^
      include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
       NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
       ^~~~~~~~~~~~~~~~~~~~
      include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean':
      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);
                         ^~~~~~~~~~~
    
    Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com
    
    
    Fixes: e63e88bc ("nilfs2: move ioctl interface and disk layout to uapi separately")
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Greg KH <gregkh@linuxfoundation.org>
    Cc: Joe Perches <joe@perches.com>
    Cc: <stable@vger.kernel.org>	[4.9+]
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Loading