From patchwork Tue Nov 28 16:52:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13471451 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 89C17C4167B for ; Tue, 28 Nov 2023 16:53:31 +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:Cc:To:Message-Id:MIME-Version:Subject: Date: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=TGncM9u8I1DvZQLPwaO72C/iNh1nNeEnJSdIZCbUtSI=; b=UxTgdc78jRNJHa guLhuZ3v2j3Nba+CuOxyzvROq73pyr3gShYIAsVKHmpBBPTD4s1utVnzpTw0sHW1VtHbETBdIOf0F UW0AaeAciwt7z1NoUJyGYoDjcpMLbSZshnTGC/wN/TLsBPCS1REgHbczNHq3NnoD3bu1/FLORo4nT fLQzO0xCqS/9/NBeE99A2XqVo/zMgiWr0tgBBLYVJRiG3NRXXgSgXAtbSMTYTVXjyB1Dh30YV+I5y NVhnTdNH+DU3/Zqg896shXuwo0ErH0VnoLozYlQiY2zYALM+Sb8mGhFIODZQBs2D0lbDe3p87W7np mUL3jbvOU+eQQtkWycjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r81Ke-005rVs-1P; Tue, 28 Nov 2023 16:53:08 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r81Kb-005rVJ-1i for linux-arm-kernel@lists.infradead.org; Tue, 28 Nov 2023 16:53:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 81358617C6; Tue, 28 Nov 2023 16:53:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6DD3C433C8; Tue, 28 Nov 2023 16:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701190384; bh=3qurBRQ+YYPOV/RKYMrmvhtcPz7PtaDGGqvhTMc0mA0=; h=From:Date:Subject:To:Cc:From; b=ATXuq9a1kuRQI+tUyQf1iziGaB7B4aDpmGQS2N9tEcFvJZj5aiTOTwX2OT9xpIxcg fzciCjeJroMPD6cqwjYwHngs2wF6WR2nYGPmsQUVxuDR61Q+FPoGREmCQMRsGDxMcj hXfNc1TlS5dNs+lSrdVPHLS52uqdJlNQ6LRcZQwUGg5ZIb7YzJWfRrWJiEs6Imx4ko t19+nUjhDgDb5Ez9AamWTI5wI2yDPz/URNJJS87llNisCUp7nCP/+F4TtEP1qTb6CX 7WwSqwqarbfVhS+Ou/AlWYiVwNuYCx9IKHek/gcKMiQ6Fd5Cegf2Gt1i+2pp9Hgzed p1Xwfc9uah7bQ== From: Nathan Chancellor Date: Tue, 28 Nov 2023 09:52:48 -0700 Subject: [PATCH] arm64: vdso32: Define BUILD_VDSO32_64 to correct prototypes MIME-Version: 1.0 Message-Id: <20231128-arm64-vdso32-missing-prototypes-error-v1-1-0fdd403cea07@kernel.org> X-B4-Tracking: v=1; b=H4sIAN8aZmUC/x3NwQrCMAyA4VcZORtoUxXxVcRDWbOZw5qSjDEZe 3eLx+/y/wc4m7DDczjAeBMXrR3xMsD4yXVmlNINFCjFSA/MttyvuBXXRLiIu9QZm+mq67exI5u pIYeSQo4j32iC3mrGk+z/z+t9nj/APoitdwAAAA== To: arnd@arndb.de, catalin.marinas@arm.com, will@kernel.org Cc: vincenzo.frascino@arm.com, nathan@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Naresh Kamboju , Mark Brown X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2927; i=nathan@kernel.org; h=from:subject:message-id; bh=3qurBRQ+YYPOV/RKYMrmvhtcPz7PtaDGGqvhTMc0mA0=; b=owGbwMvMwCUmm602sfCA1DTG02pJDKlpUu83Tt2XejStwHnRKj+HDXckRB6y+QjrnHN1Cnz1o +xB1ZOajlIWBjEuBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCRpUoM/9PuCLDdfrTRir03 h+ecI8up+4FPdN0zNc/wPXmRkXpi30dGhqt7a9ZFd+oEiYuc4zTYd7oke9oiwZhjJx9Oknl/TDR 0HzsA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231128_085305_677845_63413F3D X-CRM114-Status: GOOD ( 10.62 ) 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 After commit 42874e4eb35b ("arch: vdso: consolidate gettime prototypes"), there are a couple of errors when building the 32-bit compat vDSO for arm64: arch/arm64/kernel/vdso32/vgettimeofday.c:10:5: error: conflicting types for '__vdso_clock_gettime'; have 'int(clockid_t, struct old_timespec32 *)' {aka 'int(int, struct old_timespec32 *)'} 10 | int __vdso_clock_gettime(clockid_t clock, | ^~~~~~~~~~~~~~~~~~~~ In file included from arch/arm64/kernel/vdso32/vgettimeofday.c:8: include/vdso/gettime.h:16:5: note: previous declaration of '__vdso_clock_gettime' with type 'int(clockid_t, struct __kernel_timespec *)' {aka 'int(int, struct __kernel_timespec *)'} 16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts); | ^~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/vdso32/vgettimeofday.c:28:5: error: conflicting types for '__vdso_clock_getres'; have 'int(clockid_t, struct old_timespec32 *)' {aka 'int(int, struct old_timespec32 *)'} 28 | int __vdso_clock_getres(clockid_t clock_id, | ^~~~~~~~~~~~~~~~~~~ include/vdso/gettime.h:15:5: note: previous declaration of '__vdso_clock_getres' with type 'int(clockid_t, struct __kernel_timespec *)' {aka 'int(int, struct __kernel_timespec *)'} 15 | int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res); | ^~~~~~~~~~~~~~~~~~~ The type of the second parameter in __vdso_clock_getres() and __vdso_clock_gettime() changes based on whether compiling for 32-bit vs. 64-bit, which is controlled by CONFIG_64BIT or the preprocessor macro BUILD_VDSO32_64, which denotes a 32-bit vDSO is being built for a 64-bit architecture. Since this situation is the latter case, define BUILD_VDSO32_64 before the inclusion of include/vdso/gettime.h to clear up the warning Fixes: 42874e4eb35b ("arch: vdso: consolidate gettime prototypes") Reported-by: Naresh Kamboju Closes: https://lore.kernel.org/CA+G9fYtV6X=c3JVTTAX89_=wc+uqLpzggnsbGSx-98m_5yd5yw@mail.gmail.com/ Reported-by: Mark Brown Closes: https://lore.kernel.org/ZWCRWArzbTYUjvon@finisterre.sirena.org.uk/ Signed-off-by: Nathan Chancellor --- arch/arm64/kernel/vdso32/vgettimeofday.c | 1 + 1 file changed, 1 insertion(+) --- base-commit: ca8e45c8048a2c9503c74751d25414601f730580 change-id: 20231128-arm64-vdso32-missing-prototypes-error-e0d30a1ce52f Best regards, diff --git a/arch/arm64/kernel/vdso32/vgettimeofday.c b/arch/arm64/kernel/vdso32/vgettimeofday.c index e23c7f4ef26b..29b4d8f61e39 100644 --- a/arch/arm64/kernel/vdso32/vgettimeofday.c +++ b/arch/arm64/kernel/vdso32/vgettimeofday.c @@ -5,6 +5,7 @@ * Copyright (C) 2018 ARM Limited * */ +#define BUILD_VDSO32_64 #include int __vdso_clock_gettime(clockid_t clock,