Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2931445pxk; Mon, 28 Sep 2020 04:13:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7XSXWxDp34zyehVG5urbX5Srx7OmZ9PiukcEpVbJgQOGa5SKaiDoTXBUn/DWhWTYPCztt X-Received: by 2002:a17:907:20d0:: with SMTP id qq16mr1028927ejb.65.1601291613559; Mon, 28 Sep 2020 04:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601291613; cv=none; d=google.com; s=arc-20160816; b=McUvryhZ9D8zx2sbbNDHfY07Tg2GP8h7yksIn9ANfvZp1yGvly1eJ4jreJ6kayiJl/ DdHVPt7D6vpLDijFcosWM8d01A9Qk0iEKPxFpKN0p7a7+X9HpqqVmGVSghURgbQoLtcE wZr49q73CXgE1WS5i7DaDjeE5ZnneBXWZk8VrHTejl3wj+4eOq6MlM1YqiLLuj8s2Axy Kn/1mw2/orNaQsqKjtkOQlgk3kdur1ax07p8SuzYj0WgCTw1eadq3WemGwKJqUhfYfN/ PRdVLlLPNQm/OvWJNpMEK08qzLVinfBUfU9O3jqbW1wP/VN9MHn7r7/ttP7tH1v5F2KK zgEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rzjLjm/8eWDMYNHgOaT6y81/L+K/hv1hU+fLs4AKWrE=; b=Qu71jT//HBCCo8xQcYeGn2g8hCIlcCpC3waC+am++gC3x2Ji5tFircrCzgi/kCRCNw sH1cz6+MLWWSzV/ba37I9FjJSd8SQCIo8C3optqz1jx6WiI4lnVKzcn03HtnR3PGkzGm wK0MA2CDTdXzUL95aWnS5ipeWNHk2UU7y6s5F3wKmCtDllb7DPpnFyKwrW29qNG9nWqd sjm7OG+4WlP1w5h+uuldRHusVz32+vRDaIFEFMgJgI5hpKlCinXDaERh+fut6fZ1Kw95 mx4hS6pbl3fdsqFGdaLqNy5rDdMHAIf1+Im4IaZ4H/D/MOcFOHVxtxU9z6BOCNe14nX0 9n+g== 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 d17si395192edj.42.2020.09.28.04.13.10; Mon, 28 Sep 2020 04:13:33 -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 S1726597AbgI1LKG (ORCPT + 99 others); Mon, 28 Sep 2020 07:10:06 -0400 Received: from foss.arm.com ([217.140.110.172]:49468 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbgI1LKF (ORCPT ); Mon, 28 Sep 2020 07:10:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A24FC31B; Mon, 28 Sep 2020 04:10:04 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8142E3F6CF; Mon, 28 Sep 2020 04:10:03 -0700 (PDT) Date: Mon, 28 Sep 2020 12:09:57 +0100 From: Lorenzo Pieralisi To: Liu Shixin Cc: Thierry Reding , Rob Herring , Bjorn Helgaas , Jonathan Hunter , linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] PCI: tegra: convert to use DEFINE_SEQ_ATTRIBUTE macro Message-ID: <20200928110957.GA13256@e121166-lin.cambridge.arm.com> References: <20200916025025.3992783-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200916025025.3992783-1-liushixin2@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 10:50:25AM +0800, Liu Shixin wrote: > Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Liu Shixin > --- > drivers/pci/controller/pci-tegra.c | 28 +++------------------------- > 1 file changed, 3 insertions(+), 25 deletions(-) Applied to pci/tegra, thanks. Lorenzo > diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c > index c1d34353c29b..556c30a718f0 100644 > --- a/drivers/pci/controller/pci-tegra.c > +++ b/drivers/pci/controller/pci-tegra.c > @@ -2564,36 +2564,14 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v) > return 0; > } > > -static const struct seq_operations tegra_pcie_ports_seq_ops = { > +static const struct seq_operations tegra_pcie_ports_sops = { > .start = tegra_pcie_ports_seq_start, > .next = tegra_pcie_ports_seq_next, > .stop = tegra_pcie_ports_seq_stop, > .show = tegra_pcie_ports_seq_show, > }; > > -static int tegra_pcie_ports_open(struct inode *inode, struct file *file) > -{ > - struct tegra_pcie *pcie = inode->i_private; > - struct seq_file *s; > - int err; > - > - err = seq_open(file, &tegra_pcie_ports_seq_ops); > - if (err) > - return err; > - > - s = file->private_data; > - s->private = pcie; > - > - return 0; > -} > - > -static const struct file_operations tegra_pcie_ports_ops = { > - .owner = THIS_MODULE, > - .open = tegra_pcie_ports_open, > - .read = seq_read, > - .llseek = seq_lseek, > - .release = seq_release, > -}; > +DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports); > > static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie) > { > @@ -2610,7 +2588,7 @@ static int tegra_pcie_debugfs_init(struct tegra_pcie *pcie) > return -ENOMEM; > > file = debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs, > - pcie, &tegra_pcie_ports_ops); > + pcie, &tegra_pcie_ports_fops); > if (!file) > goto remove; > > -- > 2.25.1 >