From patchwork Fri Jul 12 03:52:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 168858 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp307575ilk; Thu, 11 Jul 2019 20:52:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbFUbmo75APFJklrFzTf0IYfKUU/8sxerZLycM2gM/EcSA/27c0qATu3tquNw62I4yrG9m X-Received: by 2002:a17:902:7c90:: with SMTP id y16mr8884387pll.238.1562903540937; Thu, 11 Jul 2019 20:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562903540; cv=none; d=google.com; s=arc-20160816; b=Q1avJed2RVjTM6r9n9Dl0oyx/RlnHMEUJ4ygZJMBKutvpnC2ho4wrs7NU3A8oPK1mT 0pkqeG/uXFg6Y0zREQ/+mj2zWgWk9cY/V8Le+bOu8jYOdphzp/YwmOt0wGxMNL2thJ0k 55bwlFIX1ug2a7KKXzPqRrCTFUIqsi2gg0qluTj4TTHj266b5iOkC/yQfdzgkcfgkitY kH01e2I2IbNQGfh0KdDERFj8Fu8xDXgPF/hMO4Z2q38nm2pNCBoETjo462Z/U0zVAOrw NvSiIfG9t/PUBgHj6sO3KrueUYYvqwZ1DeCSSBIMV6pGQyZwVFgvN4EFMPi0K6ALVnG6 Q4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:subject:to:from :date:dkim-signature; bh=SSw2cIsv8PSGptsVFmtdsGGNVvvqV5xeeyMDa14TXbg=; b=REnIGAKOJxFYve/nJaDPqt2fKld5aACvVzlyJD7DKXtcuupoH5LRVgFy9t141qoCuv Ss3o5en3Knz4Q/aT57H/anj4+60vsQ6chRBF9qkpy7jfvyVgP73XrBS4eylFtBEyDNNq FrOIgvFKEFGEp2/gRa0ePThxhoo0+B1t0sfkw81befyqF8wZhEfkJLKmJMuanaZqg9t2 AaYqVAkeyeAe1vSVtNhw1LOU5NYbb711X2WiZMedlU+kKaI9vRSiwIYCUsFfs3qEIvYk V2huOaplGrXYvEdBzE9yjlORElU78qZrKC+Tb8a+2qVhoKdKVvvRrWDJTdVEqaZXI56V klAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iYeXvWth; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si1426639pgl.96.2019.07.11.20.52.20; Thu, 11 Jul 2019 20:52:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iYeXvWth; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728721AbfGLDwU (ORCPT + 13 others); Thu, 11 Jul 2019 23:52:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729573AbfGLDwU (ORCPT ); Thu, 11 Jul 2019 23:52:20 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93C1420644; Fri, 12 Jul 2019 03:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562903538; bh=YW/esPnZ0DkguTrw9H/7Zx0FJ7QOBFjsPrFHpsXuwNU=; h=Date:From:To:Subject:From; b=iYeXvWthAb6Xa4pthpmeqxKOxbhWs44yLry5QXrl8LdRCsrDkn62n9JxviTz9Plc4 VSigCt4JWNgMbXAkNfVmIVU9qxqf5JvtVD7DlvK7DT8n6KEq+O4PDti42SjBYOjGgS ++NHHv/Eg3mRRzqw+7Lkx384oo87WGO8lajtkWA8= Date: Thu, 11 Jul 2019 20:52:18 -0700 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, arnd@arndb.de, gregkh@linuxfoundation.org, joe@perches.com, konishi.ryusuke@gmail.com, mm-commits@vger.kernel.org, stable@vger.kernel.org, torvalds@linux-foundation.org, yamada.masahiro@socionext.com Subject: [patch 005/147] nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header Message-ID: <20190712035218.MhHIAn0Nu%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada Subject: nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header 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); ^~~~~~~~~~~ Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com Fixes: e63e88bc53ba ("nilfs2: move ioctl interface and disk layout to uapi separately") Signed-off-by: Masahiro Yamada Acked-by: Ryusuke Konishi Cc: Arnd Bergmann Cc: Greg KH Cc: Joe Perches Cc: [4.9+] Signed-off-by: Andrew Morton --- include/uapi/linux/nilfs2_ondisk.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) --- a/include/uapi/linux/nilfs2_ondisk.h~nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header +++ a/include/uapi/linux/nilfs2_ondisk.h @@ -29,7 +29,7 @@ #include #include - +#include #define NILFS_INODE_BMAP_SIZE 7 @@ -533,19 +533,19 @@ enum { static inline void \ nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ - (1UL << NILFS_CHECKPOINT_##flag)); \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) | \ + (1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline void \ nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) & \ ~(1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline int \ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \ { \ - return !!(le32_to_cpu(cp->cp_flags) & \ + return !!(__le32_to_cpu(cp->cp_flags) & \ (1UL << NILFS_CHECKPOINT_##flag)); \ } @@ -595,20 +595,20 @@ enum { static inline void \ nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \ { \ - su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \ + su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) | \ (1UL << NILFS_SEGMENT_USAGE_##flag));\ } \ static inline void \ nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \ { \ su->su_flags = \ - cpu_to_le32(le32_to_cpu(su->su_flags) & \ + __cpu_to_le32(__le32_to_cpu(su->su_flags) & \ ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \ } \ static inline int \ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \ { \ - return !!(le32_to_cpu(su->su_flags) & \ + return !!(__le32_to_cpu(su->su_flags) & \ (1UL << NILFS_SEGMENT_USAGE_##flag)); \ } @@ -619,15 +619,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error) static inline void nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su) { - su->su_lastmod = cpu_to_le64(0); - su->su_nblocks = cpu_to_le32(0); - su->su_flags = cpu_to_le32(0); + su->su_lastmod = __cpu_to_le64(0); + su->su_nblocks = __cpu_to_le32(0); + su->su_flags = __cpu_to_le32(0); } static inline int nilfs_segment_usage_clean(const struct nilfs_segment_usage *su) { - return !le32_to_cpu(su->su_flags); + return !__le32_to_cpu(su->su_flags); } /**