Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1643204pxk; Fri, 18 Sep 2020 19:52:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNr/+JM37pJOWIr7D+Vm9/sh7SXN2N6Vc0Z+Flw0JeOBXXhRAJGW4LYrQk81Q2OLN24cuH X-Received: by 2002:a17:906:170e:: with SMTP id c14mr27513847eje.275.1600483958821; Fri, 18 Sep 2020 19:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600483958; cv=none; d=google.com; s=arc-20160816; b=QUEDVD8Aa6Mg3Cfz3eXy3A1tvULHgLwkahDPAU1Qqhu7PAK7wrZ4gpzPxuNfv2OE5i oWH80ygyWzvlYEfGpBPb0QtAQ60jVm8fLgMAB65P1NEdrAq4vqjjA2xJK3pXkmj8mf6q h+5fWdk38lzvPMjQvc5TyYeAeC3Ou8mwrYfR46hXmR8DZcCJ4ZHLrRXhePd59XTNV+PZ mP8CuIeBJzFCRCYLnOF2szamJkbnRb0dvEjoZYLgpDvDbDfw/Zk+aCT2Pj56/6n5YKAu YbBdimXZK0Wyai9eL7AB/p8ThzbUAgNq6G6u5DqpuAeEwManEvi4pEDkPhjJWJZppU07 IY4A== 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 :message-id:date:subject:cc:to:from; bh=CSzYL5H64XRmtEScJEiTIlXlEO3UXx31z2mTuh/scs8=; b=mG3UF/uVCCzMg+ZZ0UO7Ah9uS8s6gPcvZc4A4DJymzhfT0/FOkSP29JspbttE6UHSV 9Af8iggv+nfJD7rXUAwUzo7MrhUQEadLL4jBdEn0Nsg7QYlok08yilrPceuzMOQIrmOT 4wEQ/6ah7opf1MIRNNZhclEWcH5R5qrE7EkYo9V1m3t7CIWbGEoqRZwX654cZQ/Y2R8d vnPIfqFfoQSbqQESGCHtNt/EEMolREcS/KkbfUgxZKyqb0IaxdOLwJvX9GWV/oHPUMuU HFKEWxFcSkiCCjLDmy0cMulxFvwrAk6g74hCya7GKwSD5NcpgvYY9TAKkweJBbRAIUIZ zUVQ== 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 x23si3500892ejc.63.2020.09.18.19.52.15; Fri, 18 Sep 2020 19:52:38 -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 S1726222AbgISCvQ (ORCPT + 99 others); Fri, 18 Sep 2020 22:51:16 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13713 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726009AbgISCvP (ORCPT ); Fri, 18 Sep 2020 22:51:15 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9D410BE311C841A1EFB9; Sat, 19 Sep 2020 10:51:13 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 10:51:06 +0800 From: Qinglang Miao To: Russell King CC: , , Qinglang Miao Subject: [PATCH -next v2] arm: dump: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:51:37 +0800 Message-ID: <20200919025137.16858-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. arch/arm/mm/ptdump_debugfs.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/arm/mm/ptdump_debugfs.c b/arch/arm/mm/ptdump_debugfs.c index 598b63661..6a62bceab 100644 --- a/arch/arm/mm/ptdump_debugfs.c +++ b/arch/arm/mm/ptdump_debugfs.c @@ -12,17 +12,7 @@ static int ptdump_show(struct seq_file *m, void *v) return 0; } -static int ptdump_open(struct inode *inode, struct file *file) -{ - return single_open(file, ptdump_show, inode->i_private); -} - -static const struct file_operations ptdump_fops = { - .open = ptdump_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(ptdump); void ptdump_debugfs_register(struct ptdump_info *info, const char *name) { -- 2.23.0