Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp739599pxb; Tue, 14 Sep 2021 07:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybGRe1wWkqiMEDPyvNCHJrJJeXa3Q5MKulGLTnEUr0cwM4oGU4hYlKqz58e5jSgCndcr03 X-Received: by 2002:ac2:41c2:: with SMTP id d2mr12935024lfi.395.1631630758040; Tue, 14 Sep 2021 07:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631630758; cv=none; d=google.com; s=arc-20160816; b=AZ3bP9wGxOqHO9JIi9aGF1f+aQM0WM+8h4QVeNtE27N786fRt5R6mD9YKmys7wm7aA wfwA/JKSwwqUoFQsi8BK62OrFlh+o0TV+IaAW6v57h7736+WwEN1j8jps0/oM91+s+GH wsvX357OLwlFj+GOEugKZwapUTzZPtBFPEUgmcBax42ldmnY3LhU+e/4oE5kHDj12+6e xzsF+z/ID/E2vP+axPJ58iOYOOq4ImXHyjnlf4+2znNKgnDlvkMU2edMiabGCroIPJXB NHHyZWLzIJBRocFJXxzSq+53yQlUxyica4FI4PQhq97NnE98q0dCYIPRlWPCG5W0HU/X EYPg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pttf6hPxy+e9Mgry+nXhZceID2EPvA9kLH3aEIOrsoM=; b=WvHBJUQqe3q9PY7I8d0MPalCVOUKqtbIOQpcdemZQz8Rak8Kzm3HbRLNjsO4G6YPAc VEUGP3druX7cybrJCxIXedCWTGUTWDxqwdvDSecmXvXRFERkKMXP36xvG2AUNItP26YT IJfNYf2lXz1rQUd1Lt/BKJcHEDb1Wbj+lBhROgmJgIvXO6UTClyPzHL7s+qHFF7ReIuJ G1xUY7JIvaKKenBG/eVxwbqqYS4RQcF+HqV/v5J6oTEwsccTYp04QM9Sg5l6yqU0kSrF Yvj1PKKGDVyqDaZwAUy0Dzk7+GtvDmm2XJcbGvuekcqllyESARWEGtaFMwfOjPuQYqBq dT5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QYrtxnC2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si14584012ljg.51.2021.09.14.07.45.28; Tue, 14 Sep 2021 07:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QYrtxnC2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234156AbhINOly (ORCPT + 99 others); Tue, 14 Sep 2021 10:41:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234927AbhINOlH (ORCPT ); Tue, 14 Sep 2021 10:41:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B98760698; Tue, 14 Sep 2021 14:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631630390; bh=pS3y9et2p/dkxzeM2EJ7grzyp84IGtDqnN8Te94o73g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QYrtxnC20Z1mfmqeKqSo1Mn0bb8n+QNBwUs3gIwa8zE3TZa0pSNBxYKbQXw8p6jDQ T5bRhqdqXlkRUg8of6b7T1mFrNPLs8FK8Wlo/B3nU0Jno1WDwfdW3WO+PBuvNAomis vIqdaysjdhSIWzLjE9VMfQz9ILxg/WzjPIdgEKprOBlg3D//Lsos9kOAj6/Lp/NyqL KtukThkqtrVDKb2QcOIokQO5SR8h6nTyx0ZhNdSJYjkdGTYfay7xbbia0ej1mXynwE bC8xuTPBu7LUr9FcRMeNwWrBa77EllwvvW1ObaXvkTITv9oYGvpy7i7tHL8CmMdCjW jO5A4mEoGsGBw== From: Masami Hiramatsu To: Steven Rostedt , Josh Poimboeuf , Ingo Molnar Cc: X86 ML , Masami Hiramatsu , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, Thomas Gleixner , Borislav Petkov , Peter Zijlstra , kernel-team@fb.com, yhs@fb.com, linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko , Paul McKenney Subject: [PATCH -tip v11 08/27] kprobes: Use IS_ENABLED() instead of kprobes_built_in() Date: Tue, 14 Sep 2021 23:39:46 +0900 Message-Id: <163163038581.489837.2805250706507372658.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163163030719.489837.2236069935502195491.stgit@devnote2> References: <163163030719.489837.2236069935502195491.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use IS_ENABLED(CONFIG_KPROBES) instead of kprobes_built_in(). This inline function is introduced only for avoiding #ifdef. But since now we have IS_ENABLED(), it is no longer needed. Signed-off-by: Masami Hiramatsu --- include/linux/kprobes.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 756d3d23ce37..9c28fbb18e74 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -180,14 +180,6 @@ struct kprobe_blacklist_entry { DECLARE_PER_CPU(struct kprobe *, current_kprobe); DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); -/* - * For #ifdef avoidance: - */ -static inline int kprobes_built_in(void) -{ - return 1; -} - extern void kprobe_busy_begin(void); extern void kprobe_busy_end(void); @@ -417,10 +409,6 @@ int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value, char *type, char *sym); #else /* !CONFIG_KPROBES: */ -static inline int kprobes_built_in(void) -{ - return 0; -} static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) { return 0; @@ -514,7 +502,7 @@ static inline bool is_kprobe_optinsn_slot(unsigned long addr) static nokprobe_inline bool kprobe_page_fault(struct pt_regs *regs, unsigned int trap) { - if (!kprobes_built_in()) + if (!IS_ENABLED(CONFIG_KPROBES)) return false; if (user_mode(regs)) return false;