Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp340316pxu; Tue, 6 Oct 2020 07:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqwUiZsul/YC4adbmn2Zkoz4fTZ1QZwljCgem5FPdG2TIA1tHePjjaMH6wAVE5Pw+tSIwD X-Received: by 2002:a17:906:2ac5:: with SMTP id m5mr5618481eje.210.1601995214556; Tue, 06 Oct 2020 07:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601995214; cv=none; d=google.com; s=arc-20160816; b=xgaj6lvlRA5k97s/ta6UrkUwzTPRCW1MP+s4J7fMeSSLW2I9rGJ0G0aaB9o13skSFZ 33U2YaxgQn8W6kRBxNY5ujwackAQTYFCo1SO9F47jR1Hd3UzHyO/so7fEq133nGfjGPF uc44yERi9IMk8NJ2hriaJq9CM4QWcADqcllYDR1YXZVcviQCr4WpR6vGWp5T6bBORHNb 7e7CHPmOS7NnVKSlsfuoLEHH+px4v70CmkR2bWo1hX644c9gI/O/MTGW5x0UpaeRVdZQ YYvPluDhkbH2NAUyo5wvTz4AgYYnbIBdoAhdDliChA83/Mm7OTuCYxxm6ws4jLj1kY2P EI0Q== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=nn+hRr6kjxpIoEHAzwqKhw5tuo88PcS1sBnY8H0AFoc=; b=g6MKJ9+sM1Lcup3rSkXijX5w9E/8BTuDT2MmwuFBR3UfdrngXRe9QKEk7Icdrg2iNy TiSzow48OdSN6j+h0f/cyaOP4Mv215G81IQsSgD0YnM4PQMfnYQhIP09LQQRfoSUGyBs R+7zCBK0vw5rfiXwtTYXkJJuBhTWy//ImtWjAlIdU2VFH0p7Cd4GgScW0OBvwW0P1A3s C5FNfxoJUH5yG18D472rcwitsEH8A65bm82YYsAVy8eSghLGqnu709tG8zyrXn6Z4abX 3KQCYR1Nq3X4WVq1q4zaiiAGpdZaONMqwrV+YIbGbTGbA1ODbQ3K45eQoPSHRb7ot5Wq ZTAg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si2211123ejy.233.2020.10.06.07.39.51; Tue, 06 Oct 2020 07:40:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgJFOgk (ORCPT + 99 others); Tue, 6 Oct 2020 10:36:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:53696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgJFOgk (ORCPT ); Tue, 6 Oct 2020 10:36:40 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F401204FD; Tue, 6 Oct 2020 14:36:39 +0000 (UTC) Date: Tue, 6 Oct 2020 10:36:38 -0400 From: Steven Rostedt To: Wei Yang Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] ftrace: define seq_file only for FMODE_READ Message-ID: <20201006103638.153e39d3@gandalf.local.home> In-Reply-To: <20200831031104.23322-2-richard.weiyang@linux.alibaba.com> References: <20200831031104.23322-1-richard.weiyang@linux.alibaba.com> <20200831031104.23322-2-richard.weiyang@linux.alibaba.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 Aug 2020 11:10:59 +0800 Wei Yang wrote: > 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. I didn't pull in this patch because I find the original more expressive, and there's really no benefit in changing it. -- Steve > > 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