Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp900423pxp; Wed, 16 Mar 2022 20:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRIVMVfDCSI8uLO2Ko0pm/12iG489EzNFiXmSKVbSaVI3j8UNnUyjsB0FDbZHM+YCzN/9e X-Received: by 2002:a17:902:d511:b0:151:fa36:f1a1 with SMTP id b17-20020a170902d51100b00151fa36f1a1mr2984903plg.17.1647488330597; Wed, 16 Mar 2022 20:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488330; cv=none; d=google.com; s=arc-20160816; b=oMAcNiivGsp9fPdYdaMCwQ8r6s5efgnPEw5RQffegkRjxpufRFkYcKdKH1kc8uUIAD RnB3otOOw7gPl8BjdxqY1rQtUft2raKIQQxoBNNPhvPE6aH88je9G19udzDdfM1Ywk90 Une+e3FCyyvS1kHULJC8JxEq+7IxfF7iSNRNPvfSj11bdutlqRnC8cFILfTmgrwPz/0i FeSDPIBxivw1e86yCkx7ZjrD61H9YfMtQn908L8AgX/eGCDilRYWTSXoJFbxknTZGkxR CwLfbHs2pmUek7Ix+evZyGAmdZr9c8bY3ksOZX8xCPRIOqdGvglh5m/7cVP/lPM2pCLJ YRHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UUN2dHQ7fVzvOEWhK8kEOOydXeeFpn4aAaNBHmKlIfY=; b=JcAOpSZoObqDij/DxyqO5Z0JyERDxKnSSbLL09JQqUvCuQvuaM8xLkwoo1472Bbyyi 11gD9ggofcRkBJK/VoCIelythyIhHF+T0vI3uPOQAZLAxts4yhwll18XXipR4mFVQbXo k/b1WQsP3lNlWV66gTw3FeYlYS0thzSQmJoRDHG+Ttjz3wr8jHfa8vWK+WT8hH9IWdcC 3PqYzvlj4mD4fmF/BLjQ2WE5aDKeGizndjKt2/L6lss1tF1h9vJoV9b0LvCixAsM9scB dtoTqH6Fahx5tSj+XtZQxM1OuRMjoCSjuev9AOQ0tbHCgrzcIFwvbIsmb0/beDI54Xrs UrRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t8k6kmUR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i70-20020a636d49000000b003816043eee2si937649pgc.215.2022.03.16.20.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:38:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t8k6kmUR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F3CA58823; Wed, 16 Mar 2022 20:32:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357751AbiCPSjz (ORCPT + 99 others); Wed, 16 Mar 2022 14:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240813AbiCPSjy (ORCPT ); Wed, 16 Mar 2022 14:39:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B843F55204 for ; Wed, 16 Mar 2022 11:38:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 556D0618CA for ; Wed, 16 Mar 2022 18:38:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 808AFC340E9; Wed, 16 Mar 2022 18:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647455918; bh=4I2dqIsVLhZjm8CnyFJ7pDn7LPMROJTBLGpZPLGAP1Y=; h=From:To:Cc:Subject:Date:From; b=t8k6kmURw5+vEqAankWi7xR5393jq2B2dTT6kRbbvlzSuA3N9Wzxe5sR5t4IiJ7hS MF8jtysqZtFol5FQSA2ItMQbSuOeOSno8XJJVq69g8QwwroQo3meoToEM5Y2A4XbKp lZGjVUX7Yxom72fOEIHmsin0Q8O0GCvdcVfkQxSwJ+0BNIe7xlP2JIuxYfcqyVEnyJ BJCugmhH6pIBKU72w0XIjzRzQccQYx5cJQsQyZ2i9H4/trUXekogPPq4abFL3CE8wO F0PzVZGGXhXL8hjV6FGBiOi13fAmbcrmy1Dm/TmIZJC02opyIs/PF4RCO6hrJVp2SK AFs9eozuUQDjQ== From: Arnd Bergmann To: Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , James Morse Cc: Arnd Bergmann , "Russell King (Oracle)" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] arm64: fix clang warning about TRAMP_VALIAS Date: Wed, 16 Mar 2022 19:38:18 +0100 Message-Id: <20220316183833.1563139-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The newly introduced TRAMP_VALIAS definition causes a build warning with clang-14: arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] return (char *)TRAMP_VALIAS + SZ_2K * slot; Change the addition to something clang does not complain about. Fixes: bd09128d16fa ("arm64: Add percpu vectors for EL1") Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/vectors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) I see this warning on 5.17-rc8, but did not test it on linux-next, which may already have a fix. diff --git a/arch/arm64/include/asm/vectors.h b/arch/arm64/include/asm/vectors.h index f64613a96d53..bc9a2145f419 100644 --- a/arch/arm64/include/asm/vectors.h +++ b/arch/arm64/include/asm/vectors.h @@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors { DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector); #ifndef CONFIG_UNMAP_KERNEL_AT_EL0 -#define TRAMP_VALIAS 0 +#define TRAMP_VALIAS 0ul #endif static inline const char * arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot) { if (arm64_kernel_unmapped_at_el0()) - return (char *)TRAMP_VALIAS + SZ_2K * slot; + return (char *)(TRAMP_VALIAS + SZ_2K * slot); WARN_ON_ONCE(slot == EL1_VECTOR_KPTI); -- 2.29.2