From patchwork Sun Jul 14 08:27:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen N Rao X-Patchwork-Id: 13732609 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169971D559; Sun, 14 Jul 2024 08:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720945782; cv=none; b=XSdqqGnlAw8tYSmERvl8lJuGy8w8yYoPAzcZRUmYce6ZK0YKeKD//rTb+f9JwVRNm55Va49JONib4SHaYijkIpj1y8bNj70/pIX7OHXQFOq4T9M8MhnoW7Hepdp1eXKu0wRAnFqiisXXw5y14rYPIikUmVfY6HuJ9HLyrG8Cy40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720945782; c=relaxed/simple; bh=hcwZI/Cz4N2FGpqi2ddwK6JV0n+9v2tr6M/Imbpdp7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kJvm8Fu5OsvfcV8souxaNMA7OhPoFPOM2FVB8mXKrqTh7ICPiP6UVHBjiFr6gcUNw/fsH6VIvv0NT1qQeSHxNciOIFzMRaLMcH36F5fouYs7xg2JakkiDiKo2h853CVOfC+rkJLUbpFtZfEoCKLrAKsiHY6ObMJQ2brA39mfa/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P2nELLwT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P2nELLwT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3398C116B1; Sun, 14 Jul 2024 08:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720945781; bh=hcwZI/Cz4N2FGpqi2ddwK6JV0n+9v2tr6M/Imbpdp7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P2nELLwTExThswaNc3gvJbTEHCVHQG8q3TDv+8qWn0dUsPg3NgQTBhueuZqPUYB0R uKsn+It1hk3tYrV3TFNALoZDe9E1h/hCUf4fjike7RaycGcA0dfxOrjqnf64k+ly1z MgIT1m0Tq/Re+eiK9SGoVe4yO0vUp5vmYMhpIBPB68NU8tE5Kt2xsB/REoZSWraFti qTlL0+VJI3s84x508yJ14T5V3yanX43PLvaDTRJmczicKACS/ox2egOCQWFa/XrOBz bzhi3BQfRhlyZv9Khpw/vIVK3a6g2Si3ki95bt5Hfv+GDZUyaPh3rJS9KGTrUmu/TR Oxer6ihxFwK3w== From: Naveen N Rao To: , , , linux-kbuild@vger.kernel.org, Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masahiro Yamada , Hari Bathini , Mahesh Salgaonkar , Vishal Chourasia Subject: [RFC PATCH v4 05/17] powerpc/module_64: Convert #ifdef to IS_ENABLED() Date: Sun, 14 Jul 2024 13:57:41 +0530 Message-ID: <212c6945c642a8805c73e48d63e63ab5edcaa5dd.1720942106.git.naveen@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-State: RFC Minor refactor for converting #ifdef to IS_ENABLED(). Reviewed-by: Nicholas Piggin Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/module_64.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index e9bab599d0c2..1db88409bd95 100644 --- a/arch/powerpc/kernel/module_64.c +++ b/arch/powerpc/kernel/module_64.c @@ -241,14 +241,8 @@ static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, } } -#ifdef CONFIG_DYNAMIC_FTRACE - /* make the trampoline to the ftrace_caller */ - relocs++; -#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS - /* an additional one for ftrace_regs_caller */ - relocs++; -#endif -#endif + /* stubs for ftrace_caller and ftrace_regs_caller */ + relocs += IS_ENABLED(CONFIG_DYNAMIC_FTRACE) + IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_REGS); pr_debug("Looks like a total of %lu stubs, max\n", relocs); return relocs * sizeof(struct ppc64_stub_entry);