From patchwork Tue Dec 13 19:18:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 13072361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16BD4C4332F for ; Tue, 13 Dec 2022 19:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZwMucG82P3GJH9D+uJ+WeSB6r2KDVLFBFaZhxhtpXIY=; b=0gxvUD1IRUkxjc gMA/H3k6BBDeeMc+T8ri+fVm3yTSur77roS6psKqNS0sCpPU3PtZU5IBI82f9k5Qrc6qm51yAYH3p +pEA7wh5CR6t/3miIH0J/RNMKOkDQqsSVJy3ooDzrfxPgzyn3SrR9DvXwxcVl/Cm5pcH1W/tLWzEr sv9kPgPcfNpa335CnG6z4CZZNjpCY0HwDwUmXZc+RLtVzsN9nMU5qHyePOxxbnlUmDwbG6Rzt+HOy Y6UNw78gdL/rKrCrtGLGUWlmafEXrrs4FYNIUXG/SWWX4Zn6QVRhJJHMYplXzFiLYHp4cDODpyFy1 Lkq45zzrHb65wLHy9LuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5AnP-005DFF-AT; Tue, 13 Dec 2022 19:18:31 +0000 Received: from smtpdh20-1.aruba.it ([62.149.155.164]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5AnK-005DDO-SR for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 19:18:29 +0000 Received: from localhost.localdomain ([146.241.66.6]) by Aruba Outgoing Smtp with ESMTPSA id 5An9pnstapLT85An9pWbXH; Tue, 13 Dec 2022 20:18:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1670959101; bh=45b7rjT0/sHSloklDkuIVsgXND/IMJ9OTxAKP6zw8VY=; h=From:To:Subject:Date:MIME-Version; b=AYDt7SXh49oRBw5EfMN/zvZSgqXCjySsPSO8kZyq4LGsxQVhdqzyKGgst26KyIISy /N1iIZ/W22WPTuMV/DJoEqPa1DdtCShuTb4vJo4815KUUAlWyKo8PzEKIaV02iOBxo 7CXpZVyesMdT4Y1ebvD8SVHzH9iKfv+EZuzF89XooieLjEOlkNKqMmCQWo9vQi7fDH wBDhQRs7e/rox6uLInslxIUHA/12TyrzgTJRsX++/uFzU3sIUKLGtvCExwsb61ndHl +hUr+l77FdM0w68Q6ibHtlOdqCr3W1AFA39NO3NrQz3cyolyQxzXAPFrhe8LdNxa+8 uM9enQR+8fhfw== From: Giulio Benetti To: Russell King , Arnd Bergmann Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , Giulio Benetti , "Russell King (Oracle)" , Will Deacon , Kefeng Wang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Naresh Kamboju , stable@vger.kernel.org Subject: [PATCH] ARM: mm: fix warning on phys_addr_t to void pointer assignment Date: Tue, 13 Dec 2022 20:18:13 +0100 Message-Id: <20221213191813.4054267-1-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CMAE-Envelope: MS4xfD1IV/P04Cugw3asqwnUxCFrlRnAaYWaB3aYVXpV2G3EVnhhfFs/Z5jZkCbE4wf2lBfe6O7x1GSkfdLmd3vUJcqaq/3dnchNZgQmRCMahE36rTR/HnQI xG/ng25jHVR0HglDXAq1HEFAB/+sajRd0SKVx0k57RipJpRxMhE4DRLKesCDb7EAQV18LIf5tbQkMg5fcNijcchd7HSkA22B45KDLlQPdBnR5HoiQUm/CQmz LsY4I+1+wSaTLD2OmhoUbGRBVVgpYDIYcxo5X6c6KUPg9q2qgbKpeX5ngwqhkngwcQVaBdIGTpRBE05V2ek8GtQJad8kEkONtQMG+29jZkuIit1YWf/T7Abj nlBJNuZtYgBQ50VjKbriCyELT2aMYu88SnfzkSeMMPhSvITuYRsPLbvKCroxAxhiLiYnPNRqV3MPmU9TEmoht0ECwVigeHdwKgV9j4Dc836561T+7rTB4fQ9 BCb27D9qf/yYji77OxDjk6Jg6QPpNvYeFOd5m5ENFU1oRO2WW4svLHWw0qHcyoW5SpAm0ulYEHUV+ocSRFtyczdIYaartHlwxlUJuriRJLhTk9AO+sgKx/UB uCezY6VtDyzxiQd83kQ9z40RzqlnD1GdVLr6Aw4hBAARHzMbfwqxqjlpWlWIQMrdFvg5FkvCQdbFtzawfXapiGrDH5XbpcVWcCAve9s+wT0kVw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221213_111827_418851_5BBA04DF X-CRM114-Status: GOOD ( 11.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org zero_page is a void* pointer but memblock_alloc() returns phys_addr_t type so this generates a warning while using clang and with -Wint-error enabled that becomes and error. So let's cast the return of memblock_alloc() to (void *). Cc: # 4.14.x + Fixes: 340a982825f7 ("ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation") Signed-off-by: Giulio Benetti Tested-by: Linux Kernel Functional Testing --- arch/arm/mm/nommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index c1494a4dee25..53f2d8774fdb 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c @@ -161,7 +161,7 @@ void __init paging_init(const struct machine_desc *mdesc) mpu_setup(); /* allocate the zero page. */ - zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE); + zero_page = (void *)memblock_alloc(PAGE_SIZE, PAGE_SIZE); if (!zero_page) panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, PAGE_SIZE, PAGE_SIZE);