From patchwork Thu Feb 22 12:15:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 129225 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1936552edc; Thu, 22 Feb 2018 04:17:34 -0800 (PST) X-Google-Smtp-Source: AH8x225HnZxsDAEu4oMPBlH0rclWiQDt0Y4EOn6xKR6KMC/AkE9NfXwxyfTOSAhIXUEPwgH4nZnU X-Received: by 10.99.127.65 with SMTP id p1mr1364356pgn.50.1519301854470; Thu, 22 Feb 2018 04:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301854; cv=none; d=google.com; s=arc-20160816; b=CqjO3AEIeyc4Mory3rAR7cHNgSAjqdjhKXhVXNVh15Zpy99ty9yl3tmXxFlZ3affDh k79vtITHdJp0pyPFB4Pa7h2hmS3QXxlpU1ZDPUAPAGhT2xzzhiUDNP7CSXSrKgruMdeU 9NdWuYs2F7CLQiw37rpPztXc4TjmFe9DUAl4CFmzX+4oiF/8VMakDppXJg6cowiN8KiZ 9CdoRQztoOghuB0IvUWhlGSeCM9v6/AVAYyV7dQDBThQwxmOYTFzmA2rorS9jmEJ8ji7 JMbMOcJ06E2kNdbSka8i7uQPxIlX0uekRgtCAHGrjvFDBgYhQ93EEVD4K7LCzauIDyGi iThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=So/FLmF2d+QMzId4SpPpj3pDiJhP32Acaf5uk4xsnB4=; b=JFz9C05Ko0+RNiUgYdc2ctT7lf6Sx+dl82WpcKAC4MBipsPbd7QH7cDdudq7Rk9WMr hBtKzAOGeevLS6HHYkMjbHWj1yYhrzIUpoGx1y6haOUA8zXLs0+I5TNqLQDtlA0MbdQK ZODpkfqE+fgMx58YkAqQvVQxRxImlBHqtXRWwryvTly5MAfuvHBxSFFKe6XnOi+Djz1P xi1rKmn5lwY8aRsqgG/1AjECWPTY12xVk92wwFAjn8rbcG0rsiZ8OyFubHUr2wHsrtp8 wB9HzgfM6lv88020ESd06VQNSJ3xkdhqf7DoK4mPcErQBdGoFj77fyuVUHYAAr3iywth DEFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=joYM7w5q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 l18si2829403pgn.339.2018.02.22.04.17.34; Thu, 22 Feb 2018 04:17:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@nifty.com header.s=dec2015msa header.b=joYM7w5q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932513AbeBVMRb (ORCPT + 28 others); Thu, 22 Feb 2018 07:17:31 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:63181 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753716AbeBVMRa (ORCPT ); Thu, 22 Feb 2018 07:17:30 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w1MCFdUD020774; Thu, 22 Feb 2018 21:15:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w1MCFdUD020774 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519301742; bh=So/FLmF2d+QMzId4SpPpj3pDiJhP32Acaf5uk4xsnB4=; h=From:To:Cc:Subject:Date:From; b=joYM7w5qlGwBy5c5xcNCNNBIDXVz2Tvj4TwjAXAbFRGMlTTLyZkpC/AI617PsTKjy 08TFKdtI8k6ejRpVWxwXtBIWF4X+IhYrU3Pwe+/Y1lLle3mmjnuLmyTGdyB1rJheNc 1wWryBrgbsAAfZDtz18clyrxHQYyYPGqC2OoCN9Wc/GynkPp85zske0enmYt8sHca0 lmxgJDtGU+qbaHcOgIrVasuRFmaALseU/wvF883j2ZRPxT+ugmwHc8dBRQEMrC2ZlX fBsAbA2sWpPr0UIgLdWZHxx75RP/YxD+Muhrijb267VS6e+hJm6uS3GshCJUbylMXL JD3VAvogXCEhA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: David Howells , linux-arm-kernel@lists.infradead.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Will Deacon , linux-m68k@lists.linux-m68k.org, Guan Xuetao , Geert Uytterhoeven , Catalin Marinas , Russell King Subject: [PATCH v3 0/5] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc. Date: Thu, 22 Feb 2018 21:15:10 +0900 Message-Id: <1519301715-31798-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ARM, ARM64, UniCore32 define UL() as a shorthand of _AC(..., UL). More architectures may introduce it in the future. UL() is arch-agnostic, and useful. So let's move it to include/linux/const.h Currently, must be included to use UL(). It pulls in more bloats just for defining some bit macros. I posted V2 one year ago. The previous posts are: https://patchwork.kernel.org/patch/9498273/ https://patchwork.kernel.org/patch/9498275/ https://patchwork.kernel.org/patch/9498269/ https://patchwork.kernel.org/patch/9498271/ At that time, what blocked this series was a comment from David Howells: You need to be very careful doing this. Some userspace stuff depends on the guard macro names on the kernel header files. (https://patchwork.kernel.org/patch/9498275/) Looking at the code closer, I noticed this is not a problem. See the following line. https://github.com/torvalds/linux/blob/v4.16-rc2/scripts/headers_install.sh#L40 scripts/headers_install.sh rips off _UAPI prefix from guard macro names. I ran "make headers_install" and confirmed the result is what I expect. So, we can prefix the include guard of include/uapi/linux/const.h, and add a new include/linux/const.h. Masahiro Yamada (5): linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI m68k: rename UL() to TO_UL() linux/const.h: move UL() macro to include/linux/const.h linux/const.h: refactor _BITUL and _BITULL a bit linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly arch/arm/include/asm/memory.h | 6 ------ arch/arm64/include/asm/memory.h | 6 ------ arch/m68k/mm/init.c | 6 +++--- arch/unicore32/include/asm/memory.h | 6 ------ include/linux/bitops.h | 3 +-- include/linux/const.h | 12 ++++++++++++ include/uapi/linux/const.h | 13 ++++++++----- 7 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 include/linux/const.h -- 2.7.4