Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17922486ybl; Thu, 2 Jan 2020 14:52:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzdNm+iTA/ocjKMOTxbQL9yDbnG3Rl00TsZAPLtgkFQCnCnzds2Mfn0lRc/QZYOR1KepWjs X-Received: by 2002:a9d:c02:: with SMTP id 2mr97061842otr.183.1578005577711; Thu, 02 Jan 2020 14:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005577; cv=none; d=google.com; s=arc-20160816; b=yCsrGJIZWNA9dy1mngrAJAu6xcu5tyLFdudG5y3uRf+n6xoYxfPMmvCIWagkuvGSQT nRJEkj2Q8dP63bOVQ1mTTWvZv1tcGWCauKybIlTASamiDv2tZbria8M/Yq0EmxDeKPmy u+2pvXgQinPTsJ8bkkxR+y80bTZI1vgR4Cu7ZjpGYxTEk/r2KlTMXW2XVDPeEOZ2fD7m d59ZhHFoFsr8EtIDqqDvxxP63QfqlHQIj/mdTljRPBYnliXjjdWUrGzaN5pv6Z8Ev7xG r066qfam2bX5hxUQpCX8bSg38quSwxdtqwA0e8ll5pds/EWdn1uIrkVcPLEPow9N0EEL Vbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M19i0G1SmrTYKX8ZKt62M4AIye9spAt0GE/gAY7K3WA=; b=bLZV3KzBGj4w3GWHuHKzlwLZxaVJ1IrocW6u1r/Ath40HnSdUQj1DhKsyTJpCtpBri zesL9aRRnLzrQCLXBqIoFpyCT+G8+JYgfxzv10sCVdbgOdhDzmGFbAdzqBAuMxbncOWA syVpMvD3j4oWjEwc7X3uv40Ff5MVEci9mDicy8GEKZiKeJtgt+flt6r7HpbPTEHE6/b2 /4imG1nGJzO2Sugyqgbuj9tnOsjolL6Usla744S3DVpTmuJFe4fowedvP4srYCnATfm2 tWGsTW97+6ZcloJ0kRG6z5QdgcsSE5mUmW4MzWU/mUP4pSTqsBaqp4AQwdM1gb6bPkPr kRZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jss8o0Cs; 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 s6si28839762otp.126.2020.01.02.14.52.46; Thu, 02 Jan 2020 14:52:57 -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=@kernel.org header.s=default header.b=Jss8o0Cs; 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 S1729034AbgABWZN (ORCPT + 99 others); Thu, 2 Jan 2020 17:25:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:50214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbgABWZL (ORCPT ); Thu, 2 Jan 2020 17:25:11 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A1E7C21835; Thu, 2 Jan 2020 22:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003911; bh=S48A1bbrwIfmVbypVRzcNi+uBBmowvay75XPI3v0jFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jss8o0Cs4vjOBpiNU3C/Z5QB7IcgS8cC1PnlmoTOw3PC7tQ9kfYcbCm0IADiyzfd8 Gzr2fIcI6rarb2SzQD4qsGrWhUCR4zABXdTCAWMCsw0RlCaA1keVyn/lAuH/E/K5Gc MnaZFwlLCiyUdDjuvYH96bgJUohTb52fW6ESnUeA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Rob Herring , Sasha Levin Subject: [PATCH 4.14 50/91] libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h Date: Thu, 2 Jan 2020 23:07:32 +0100 Message-Id: <20200102220436.967770872@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220356.856162165@linuxfoundation.org> References: <20200102220356.856162165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit a8de1304b7df30e3a14f2a8b9709bb4ff31a0385 ] The DTC v1.5.1 added references to (U)INT32_MAX. This is no problem for user-space programs since defines (U)INT32_MAX along with (u)int32_t. For the kernel space, libfdt_env.h needs to be adjusted before we pull in the changes. In the kernel, we usually use s/u32 instead of (u)int32_t for the fixed-width types. Accordingly, we already have S/U32_MAX for their max values. So, we should not add (U)INT32_MAX to any more. Instead, add them to the in-kernel libfdt_env.h to compile the latest libfdt. Signed-off-by: Masahiro Yamada Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- arch/arm/boot/compressed/libfdt_env.h | 4 +++- arch/powerpc/boot/libfdt_env.h | 2 ++ include/linux/libfdt_env.h | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/libfdt_env.h b/arch/arm/boot/compressed/libfdt_env.h index b36c0289a308..6a0f1f524466 100644 --- a/arch/arm/boot/compressed/libfdt_env.h +++ b/arch/arm/boot/compressed/libfdt_env.h @@ -2,11 +2,13 @@ #ifndef _ARM_LIBFDT_ENV_H #define _ARM_LIBFDT_ENV_H +#include #include #include #include -#define INT_MAX ((int)(~0U>>1)) +#define INT32_MAX S32_MAX +#define UINT32_MAX U32_MAX typedef __be16 fdt16_t; typedef __be32 fdt32_t; diff --git a/arch/powerpc/boot/libfdt_env.h b/arch/powerpc/boot/libfdt_env.h index 39155d3b2cef..ac5d3c947e04 100644 --- a/arch/powerpc/boot/libfdt_env.h +++ b/arch/powerpc/boot/libfdt_env.h @@ -6,6 +6,8 @@ #include #define INT_MAX ((int)(~0U>>1)) +#define UINT32_MAX ((u32)~0U) +#define INT32_MAX ((s32)(UINT32_MAX >> 1)) #include "of.h" diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h index 1aa707ab19bb..8b54c591678e 100644 --- a/include/linux/libfdt_env.h +++ b/include/linux/libfdt_env.h @@ -7,6 +7,9 @@ #include +#define INT32_MAX S32_MAX +#define UINT32_MAX U32_MAX + typedef __be16 fdt16_t; typedef __be32 fdt32_t; typedef __be64 fdt64_t; -- 2.20.1