Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp694401pxk; Sun, 30 Aug 2020 20:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzW834v5P0i4j+2GAABqPilgC6lJDMUrrKYyP+nANBZWzvrtLc9CRQmjVE6NYFbitRxLVs X-Received: by 2002:a17:906:90d5:: with SMTP id v21mr3954011ejw.123.1598843725850; Sun, 30 Aug 2020 20:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598843725; cv=none; d=google.com; s=arc-20160816; b=I11p6kAw/yZ504ndLOK74iJ2GgqP+LmJ5ikyl3geK+HgdHKvkvnngOh0gkczqPEggb wMplr4X2E8PyUOhpMZHNVK0zh/KirtV1kmFGIujjwyStSubKI0Q/FiBXMTH+uo2SZzJ8 y02juV2tlSz3MAuxmKksjsoXr10u6X7fSrfOGWQVCEgNn6aEORv0jL0oVd8NOlsR1geG HycL3Og9NIDNkx/bjfCf5nLiOB2NLoQNjjshT99t1xsEM3yS5xo5EC9O5/aEfDPCNR8m 4/VCsr+Jn5qH/ltoxzb+OEtEUK092dq9M7wiWuPIFx1iayyUuT7inOrmj0AYrHpyY+yr 8w9g== 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=P5VEqizfFezfmhY9/c6mIOJn/7sfDUQnOw6xmBGkJkw=; b=xT7Pz7/vJwAMvAZ5gE3fjYq4L4o//YkGX7MT7E1RbF09ktIDXR/UdNFPIDfxq1J69P o4Mor5pmngD5R/Jmn389WkoDPIS7x+kM1mS3Ew4WA88tqEbrkXDpS62mpzZU6EnWteOy F//nkWtPYUIuWYDz7viZF7YVwlY5uct1uVs1YlPsf/9eRGOH5n9eLlYI5ctGSA8kC/B4 OuG7memEMSWfKD5NtOnWnY9w3/6wT9sbmOjMHiTz+7sYUbwNvUM/JmVzHGuL8ZWYoNvK ZUQBlk4zdKb65ybNrAzhswd73DQMjtn+WGauSsvTepieQJgTVwpi3X0gUZMx9WVWf63J 18ZQ== 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 ot18si4804438ejb.9.2020.08.30.20.15.03; Sun, 30 Aug 2020 20:15:25 -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 S1727111AbgHaDLK (ORCPT + 99 others); Sun, 30 Aug 2020 23:11:10 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:40449 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbgHaDLI (ORCPT ); Sun, 30 Aug 2020 23:11:08 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R251e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07484;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0U7JHBz7_1598843466; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7JHBz7_1598843466) by smtp.aliyun-inc.com(127.0.0.1); Mon, 31 Aug 2020 11:11:06 +0800 From: Wei Yang To: rostedt@goodmis.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 1/6] ftrace: define seq_file only for FMODE_READ Date: Mon, 31 Aug 2020 11:10:59 +0800 Message-Id: <20200831031104.23322-2-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 The purpose of the operation is to get ftrace_iterator, which is embedded in file or seq_file for FMODE_WRITE/FMODE_READ respectively. Since we don't have a seq_file for FMODE_WRITE case, it is meaningless to cast file->private_data to seq_file. Let's move the definition when there is a valid seq_file. Signed-off-by: Wei Yang --- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index edc233122598..12cb535769bc 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5558,7 +5558,6 @@ static void __init set_ftrace_early_filters(void) int ftrace_regex_release(struct inode *inode, struct file *file) { - struct seq_file *m = (struct seq_file *)file->private_data; struct ftrace_iterator *iter; struct ftrace_hash **orig_hash; struct trace_parser *parser; @@ -5566,6 +5565,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file) int ret; if (file->f_mode & FMODE_READ) { + struct seq_file *m = file->private_data; iter = m->private; seq_release(inode, file); } else -- 2.20.1 (Apple Git-117)