Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp694309pxk; Sun, 30 Aug 2020 20:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXK9UlpiFwszS5HjM7LZMHeL0hl4ulVaFWqncbN1+pT9OBLZhK1SUEy5hwiOP6qvzxwm3u X-Received: by 2002:a17:906:846:: with SMTP id f6mr10504947ejd.157.1598843710282; Sun, 30 Aug 2020 20:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598843710; cv=none; d=google.com; s=arc-20160816; b=KSEekuKo4ZwFALWb9MyX/wBlrJjIEF88ALxY3YcJB13mpqGFKm72HK1/uAyzLp3O1t 3ydKBI2g4VsHe75MDU3J0os3cv9Wg9a07K0bxEh7WDY5v9je+d62n22m/Uo0CscziKhr zxxxe1jXMkI2V+jvNmXg2Z12MwHWZIilMvxPO5rTcFgKFqB9ElL+px1SkuBPVHhLCzqm +3mwABVD/aSsjiRgPJ/Yq856sbRurqsrc7B0+2GsBjtL0vJgAEh/cJ1fe0HgwIR1+SUf x+cJmV6A6YhbzIToc2bUYk/3Uuymouen3DxcnMDhvdJhkYqD0yMHAUBqnZPxmTiagfDo ibUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Kps85lbPOOCRzPbgzhQJqsgI7x59WLfaRtS4pH2nPTA=; b=Ys/DzPJp45y7M6t5WonKl+2ySF9GAyaJDDLjc5avSLo4Uq73FaFJs6VJLyEtELqzYR 4CMBXdeFCDAcpTi7gz1nvntmVbkW7Wyh/DMEUx9LoAPA2XORXbdQhgzDRsxsh67fvNur Ty7XLWfYo0udxLccl1CS9xdkPiXZkZieiua5CmO2kUTSnplZWoSPO3jQBYmfv5pgEtsw iVuBDD8i/+yMENR1eAHcoIgLG/MXWFCgdT0qNHnd3antkbinr0fIppA8/rWJYYlkSaIU b8n+cpGTzWwgAYKUIl97qWHM1LUv9phavac5Zn4oGlz8/5yrSr8xzWNr47sQdXAnxZvf fsxw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si4824808ejc.440.2020.08.30.20.14.47; Sun, 30 Aug 2020 20:15:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727883AbgHaDLY (ORCPT + 99 others); Sun, 30 Aug 2020 23:11:24 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:44415 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbgHaDLU (ORCPT ); Sun, 30 Aug 2020 23:11:20 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01419;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0U7IrXzq_1598843467; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7IrXzq_1598843467) by smtp.aliyun-inc.com(127.0.0.1); Mon, 31 Aug 2020 11:11:08 +0800 From: Wei Yang To: rostedt@goodmis.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 3/6] ftrace: simplify the dyn_ftrace->flags macro Date: Mon, 31 Aug 2020 11:11:01 +0800 Message-Id: <20200831031104.23322-4-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200831031104.23322-1-richard.weiyang@linux.alibaba.com> References: <20200831031104.23322-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All the three macro are defined to be used for ftrace_rec_count(). This can be achieved by (flags & FTRACE_REF_MAX) directly. Since no other places would use those macros, remove them for clarity. Also it fixes a typo in the comment. Signed-off-by: Wei Yang --- include/linux/ftrace.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 3e3fe779a8c2..23c4d6526998 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -433,7 +433,7 @@ bool is_ftrace_trampoline(unsigned long addr); * DIRECT - there is a direct function to call * * When a new ftrace_ops is registered and wants a function to save - * pt_regs, the rec->flag REGS is set. When the function has been + * pt_regs, the rec->flags REGS is set. When the function has been * set up to save regs, the REG_EN flag is set. Once a function * starts saving regs it will do so until all ftrace_ops are removed * from tracing that function. @@ -451,12 +451,9 @@ enum { }; #define FTRACE_REF_MAX_SHIFT 23 -#define FTRACE_FL_BITS 9 -#define FTRACE_FL_MASKED_BITS ((1UL << FTRACE_FL_BITS) - 1) -#define FTRACE_FL_MASK (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT) #define FTRACE_REF_MAX ((1UL << FTRACE_REF_MAX_SHIFT) - 1) -#define ftrace_rec_count(rec) ((rec)->flags & ~FTRACE_FL_MASK) +#define ftrace_rec_count(rec) ((rec)->flags & FTRACE_REF_MAX) struct dyn_ftrace { unsigned long ip; /* address of mcount call-site */ -- 2.20.1 (Apple Git-117)