From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 207A9C433E0 for ; Thu, 11 Feb 2021 06:22:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE7E264E77 for ; Thu, 11 Feb 2021 06:22:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE7E264E77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3DD036B007D; Thu, 11 Feb 2021 01:22:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 396F46B007E; Thu, 11 Feb 2021 01:22:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2542D6B0080; Thu, 11 Feb 2021 01:22:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 090F46B007D for ; Thu, 11 Feb 2021 01:22:15 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C7FE71EE6 for ; Thu, 11 Feb 2021 06:22:14 +0000 (UTC) X-FDA: 77804992188.29.laugh40_5d0b1ac27616 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id B015918086CA6 for ; Thu, 11 Feb 2021 06:22:14 +0000 (UTC) X-HE-Tag: laugh40_5d0b1ac27616 X-Filterd-Recvd-Size: 3861 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Feb 2021 06:22:14 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5BD6F139F; Wed, 10 Feb 2021 22:22:13 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B75BC3F73B; Wed, 10 Feb 2021 22:22:08 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org, will@kernel.org Cc: Anshuman Khandual , Robin Murphy , Marek Szyprowski , Christoph Hellwig , David Hildenbrand , Mark Rutland , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] dma-contiguous: Type cast MAX_ORDER as unsigned int Date: Thu, 11 Feb 2021 11:52:11 +0530 Message-Id: <1613024531-19040-4-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> References: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Type cast MAX_ORDER as unsigned int to fix the following build warning. In file included from ./include/linux/kernel.h:14, from ./include/asm-generic/bug.h:20, from ./arch/arm64/include/asm/bug.h:26, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./arch/arm64/include/asm/memory.h:166, from ./arch/arm64/include/asm/page.h:42, from kernel/dma/contiguous.c:46: kernel/dma/contiguous.c: In function =E2=80=98rmem_cma_setup=E2=80=99: ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 =3D=3D (typeof(y) *)1))) ^~ ./include/linux/minmax.h:32:4: note: in expansion of macro =E2=80=98__typ= echeck=E2=80=99 (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ./include/linux/minmax.h:42:24: note: in expansion of macro =E2=80=98__sa= fe_cmp=E2=80=99 __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ ./include/linux/minmax.h:58:19: note: in expansion of macro =E2=80=98__careful_cmp=E2=80=99 #define max(x, y) __careful_cmp(x, y, >) ^~~~~~~~~~~~~ kernel/dma/contiguous.c:402:35: note: in expansion of macro =E2=80=98max=E2= =80=99 phys_addr_t align =3D PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- kernel/dma/contiguous.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 3d63d91cba5c..1c2782349d71 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -399,7 +399,7 @@ static const struct reserved_mem_ops rmem_cma_ops =3D= { =20 static int __init rmem_cma_setup(struct reserved_mem *rmem) { - phys_addr_t align =3D PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); + phys_addr_t align =3D PAGE_SIZE << max((unsigned int)MAX_ORDER - 1, pag= eblock_order); phys_addr_t mask =3D align - 1; unsigned long node =3D rmem->fdt_node; bool default_cma =3D of_get_flat_dt_prop(node, "linux,cma-default", NUL= L); --=20 2.20.1