From patchwork Mon Aug 6 11:47:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 143494 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3190773ljj; Mon, 6 Aug 2018 04:49:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddAzDLsDaqUAYk2wVf+i+M5WcOdJZv8lzJjQHEwjW6HFTNJslIDl5QDFkpX3Kaxu/XGFuX X-Received: by 2002:a50:b822:: with SMTP id j31-v6mr17950338ede.76.1533556195635; Mon, 06 Aug 2018 04:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533556195; cv=none; d=google.com; s=arc-20160816; b=YljJXUg3vJmqLSSPm2zbOJ/3tkY2zBL3NHxmSrM/dDaqvOsSnRaFSKamGE1IdQC/F+ gW8Vn7MPh0OpQhbgGu2d5s1Ukt1qLchIANyK5+WtU+H8ZlFR0xpG/3ep1Rozj8uJZcnV 7NKDqGg4DGaHxkqA+HuoAlq0mJ6ruzDLpyhPc9KlEUM6K/g4N1MeuEY9Jyi46fNVL1bH waYcBPPepGYBAIC1HlW5FyapOBFKDzcwYPwqiAbBtnUZbCVmy2J0BlZToC2tBRGGI7za nAPsrc9wj+cRNU4lwsRgoYOrS+Np4aMPHzJgc7txZSPWDVR9qe+Y2nTSdYwX87i33i+N RVpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=vwk0/FLgclB3kZ0CeVQMGpsKVCuGVvAgPL5NQ3bx7XQ=; b=enYKaww5hhu2FhkwmjUy1DiHz+DtLWx9/FROcNgirHnejoJ/tf96UHuxk+FqdrqwLA 0JDNSBMYgZrzrMM7A0tX5SyfBIhDJv48ZwLI66SyPohV3JGgPJkmxHg2qpCQyQrHs0yl gaucxYpPoSmDFXw6H+ePdZyUhjJC5dAcc5KmDS+Wn5hm5is9tYdqtG/7IR8Ql8DUkFsO GOfu3C1HaXnhDv5s15JnO2/fX2S1PJ39LMqIu2PQeiDeLqOaqQ14HQgRE1RpM97wjhME KoI2AYgJ8tEVGrP2r5VobKOyQ9E6PDNsLQofqwbV5W0d781ZmLXV7+KmsXWYOhZbPuPz K1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=vHkm2xed; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n17-v6si5774043edf.195.2018.08.06.04.49.55; Mon, 06 Aug 2018 04:49:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=vHkm2xed; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 31740C21D8A; Mon, 6 Aug 2018 11:49:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4792FC21D8A; Mon, 6 Aug 2018 11:48:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BBD13C21C57; Mon, 6 Aug 2018 11:48:47 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 6CC3FC21C2F for ; Mon, 6 Aug 2018 11:48:45 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w76BllPS032023; Mon, 6 Aug 2018 20:47:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w76BllPS032023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1533556068; bh=6Lh3/iZlXbGd87vfZuFTNcsfukfG0z6w01SI/cUEiL0=; h=From:To:Cc:Subject:Date:From; b=vHkm2xed3cIWQRDZ3kj/NcVT0cl7uFoQ/y6f8yIFYqt6i/M4X9Do1DeGQiHjjhZEb AqB2/sV04eYjW8/2GSu0ZnkH/Mpa29lDJkbJzyDMNPLgk0Y9RR5E3BQcIiL7GabNEw CVIR8hht6NVFPCuKlG9UcOhqfajJNlwyUTvblRKzzDCQdzseGMSma5muYuaIzCCSAN Mg0kCdO6DzV+5RllBr5Ea7MjZAEv81up1FBrm/du8rMQWCxoxX5Y4MJ/WwzHm/nZaO 40midadbzgdUQ1e9YxpJY8EgUyiVOBPi+d/mTQovPztp4R6wOBr9mezVFRHi6KDGZV uF9w59wancWfg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 6 Aug 2018 20:47:38 +0900 Message-Id: <1533556060-26284-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Tom Rini Subject: [U-Boot] [PATCH 1/3] Remove CONFIG_USE_STDINT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" You do not need to use the typedefs provided by compiler. Our compilers are either IPL32 or LP64. Hence, U-Boot can/should always use int-ll64.h typedefs like Linux kernel, whatever the typedefs the compiler internally uses. Signed-off-by: Masahiro Yamada --- README | 5 ----- arch/sandbox/include/asm/types.h | 5 ----- arch/x86/include/asm/types.h | 5 ----- config.mk | 5 ----- include/compiler.h | 5 ----- include/inttypes.h | 10 ---------- include/linux/types.h | 9 +-------- scripts/config_whitelist.txt | 1 - test/stdint/test-includes.sh | 2 -- tools/buildman/func_test.py | 2 +- 10 files changed, 2 insertions(+), 47 deletions(-) diff --git a/README b/README index aee0f73..58594f3 100644 --- a/README +++ b/README @@ -3018,11 +3018,6 @@ Configuration Settings: If defined, don't allow the -f switch to env set override variable access flags. -- CONFIG_USE_STDINT - If stdint.h is available with your toolchain you can define this - option to enable it. You can provide option 'USE_STDINT=1' when - building U-Boot to enable this. - The following definitions that deal with the placement and management of environment data (variable area); in general, we support the following configurations: diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index a10b455..79c85aa 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -41,13 +41,8 @@ typedef unsigned short u16; typedef signed int s32; typedef unsigned int u32; -#if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__) typedef signed long long s64; typedef unsigned long long u64; -#else -typedef __INT64_TYPE__ s64; -typedef __UINT64_TYPE__ u64; -#endif /* * Number of bits in a C 'long' on this architecture. diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index a47e581..7649c2b 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -36,13 +36,8 @@ typedef unsigned short u16; typedef signed int s32; typedef unsigned int u32; -#if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__) typedef signed long long s64; typedef unsigned long long u64; -#else -typedef __INT64_TYPE__ s64; -typedef __UINT64_TYPE__ u64; -#endif #if CONFIG_IS_ENABLED(X86_64) #define BITS_PER_LONG 64 diff --git a/config.mk b/config.mk index 78748cc..b4e4618 100644 --- a/config.mk +++ b/config.mk @@ -62,11 +62,6 @@ ifdef FTRACE PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE endif -# Allow use of stdint.h if available -ifneq ($(USE_STDINT),) -PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT -endif - ######################################################################### RELFLAGS := $(PLATFORM_RELFLAGS) diff --git a/include/compiler.h b/include/compiler.h index 957f4b5..29507f9 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -120,13 +120,8 @@ typedef unsigned int uint; #else /* !USE_HOSTCC */ -#ifdef CONFIG_USE_STDINT -/* Provided by gcc. */ -#include -#else /* Type for `void *' pointers. */ typedef unsigned long int uintptr_t; -#endif #include #include diff --git a/include/inttypes.h b/include/inttypes.h index ea731ec..b86ad04 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -34,19 +34,9 @@ typedef wchar_t __gwchar_t; defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_FORMAT_MACROS -#ifdef CONFIG_USE_STDINT -# if __WORDSIZE == 64 -# define __PRI64_PREFIX "l" -# define __PRIPTR_PREFIX "l" -# else -# define __PRI64_PREFIX "ll" -# define __PRIPTR_PREFIX -# endif -#else /* linux/types.h always uses long long for 64-bit and long for uintptr_t */ # define __PRI64_PREFIX "ll" # define __PRIPTR_PREFIX "l" -#endif /* Macros for printing format specifiers. */ diff --git a/include/linux/types.h b/include/linux/types.h index 7c33e7a..1f3cd63 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -106,8 +106,7 @@ typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \ - (!defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)) +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) typedef __u64 uint64_t; typedef __u64 u_int64_t; typedef __s64 int64_t; @@ -120,12 +119,6 @@ typedef __s64 int64_t; #define aligned_be64 __be64 __aligned(8) #define aligned_le64 __le64 __aligned(8) -#if defined(CONFIG_USE_STDINT) && defined(__INT64_TYPE__) -typedef __UINT64_TYPE__ uint64_t; -typedef __UINT64_TYPE__ u_int64_t; -typedef __INT64_TYPE__ int64_t; -#endif - #ifdef __KERNEL__ typedef phys_addr_t resource_size_t; #endif diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 0d60da3..fe3a772 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -4674,7 +4674,6 @@ CONFIG_USE_INTERRUPT CONFIG_USE_NOR CONFIG_USE_ONENAND_BOARD_INIT CONFIG_USE_SPIFLASH -CONFIG_USE_STDINT CONFIG_UTBIPAR_INIT_TBIPA CONFIG_U_BOOT_HDR_ADDR CONFIG_U_BOOT_HDR_SIZE diff --git a/test/stdint/test-includes.sh b/test/stdint/test-includes.sh index 077bdc7..1db8515 100755 --- a/test/stdint/test-includes.sh +++ b/test/stdint/test-includes.sh @@ -46,10 +46,8 @@ try_test() { $cmd } -# Run a test with and without CONFIG_USE_STDINT try_both() { try_test $@ - try_test $@ -DCONFIG_USE_STDINT } # board arch soc path-to-gcc diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 363db9d..119d02c 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -27,7 +27,7 @@ settings_data = ''' [make-flags] src=/home/sjg/c/src chroot=/home/sjg/c/chroot -vboot=USE_STDINT=1 VBOOT_DEBUG=1 MAKEFLAGS_VBOOT=DEBUG=1 CFLAGS_EXTRA_VBOOT=-DUNROLL_LOOPS VBOOT_SOURCE=${src}/platform/vboot_reference +vboot=VBOOT_DEBUG=1 MAKEFLAGS_VBOOT=DEBUG=1 CFLAGS_EXTRA_VBOOT=-DUNROLL_LOOPS VBOOT_SOURCE=${src}/platform/vboot_reference chromeos_coreboot=VBOOT=${chroot}/build/link/usr ${vboot} chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot} chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot}