From patchwork Wed Jun 13 01:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donglin Peng X-Patchwork-Id: 10461435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D35CE601A0 for ; Wed, 13 Jun 2018 01:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B241528B2C for ; Wed, 13 Jun 2018 01:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4C3F28B3E; Wed, 13 Jun 2018 01:17:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66F7728B2C for ; Wed, 13 Jun 2018 01:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zPW6LsqhHSblgQJJAGIgv3I5sc/Fao1TdfAfqGdRdhg=; b=TAtBXaj2ERfWmwYnai6QxTsMcS n4UCfJhAMsjW0/UoLk/Ni62+pKL5hYjj3SPGQO4E1L6MsSWXtR93YRtI3MR0Ns0GFb1B6T6kzniW0 SkCyB62L99gQ7n4R2g7OIsptTDLubIaXd+vll5N7i4dpHj+YjQ/oBUDZVNot4QA1FRGw7xTk4WFur +LVdrOdJbSUhoQ8dv3V7fK7GJjZumTs9QFX1f6DxFMrEKTvIFC+2iztGt/xq1yI47Ff16cF5Cqp11 0gzVWW/RPMctNz0Yq8F/jrdIbfVn+DeKUR88jB0OgomPiERMUSsv1D3qAd7xlUI7IlfOmKasu5Vi6 S4YsUf8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSuPK-0003xH-QT; Wed, 13 Jun 2018 01:17:06 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSuOr-0003jg-Vt for linux-arm-kernel@lists.infradead.org; Wed, 13 Jun 2018 01:17:03 +0000 Received: by mail-pf0-x242.google.com with SMTP id b74-v6so457010pfl.5 for ; Tue, 12 Jun 2018 18:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=E0M8Ta60hVqQQqmtEArjGAMG6zOPmqI8ppk2K3dx5kc=; b=ud6VnljQxGEazvTiwXrHMXWsDfQkzD0ZMqw8DekLcD4tAoZTbgEwLoVtZBlvf6KQF0 UDRJKvGAOW8yVVpk3claZa92DFcA8q+3B5WbA5H0DsagXSPiIkMzgkMs8nmUODeRBlue rbaVCyWPPzsTRylKbri9blGtGgwWRJwnqb0qE01R4a1QBISwsD1dPquQJcdN+5DuKSuI jFtfjofnUrq3gY5Ktl8ZiiXcisGDBs6pt1fT8s7sRhGFB1IntDsQXDJ6ZySIsdFsReSa Wo1H+3DBYZQ9+RC7uQ/PDLSujSRQCdegZBjEFLIksTHFMnIgj8ppKDKsEOaC1q56XAeJ 3gCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=E0M8Ta60hVqQQqmtEArjGAMG6zOPmqI8ppk2K3dx5kc=; b=Qrlk1xttDH8Xv4diGMvTeiTIsZglycW0cFSNjtqm93Yuit6Nsv67L2C1FJP2OMnPAz womgmxVMn5mJGZuKqQLTa2ayTVvUo06CGE7Mxv/S+Rr0MkDr7i12JafinYtcN+GrUxUG oh0I+R2MrRtZ7miNbz9nA+Ja3K+uZzbl9qvcZBXtRGjQShPrCWrak/zhkbjgtF/uJHnA uW05nfALAmYEB5Q0GZy3Nl4twGuPi9a3lBKtPgFPHAoUAwxs43gC4+Ifa/84PkL6HxN+ lE9R1x3Vww9oZ3d5G9kKZbslyHzAEjjyP9hjiOwFZvXctutZorh7UFvT8cMqh1JpsZU4 aI8Q== X-Gm-Message-State: APt69E0+Z4+SFUy+oM1tTOZR9bXG79yNGh1YACI4VhklYtNcp9T8yTKn slamuOg6KziH8xuMELn2B4Q= X-Google-Smtp-Source: ADUXVKIEw8rXfeyoyFW3Nx99FQ06MHucBat6zXc4vzB32/7gkATTSMrUZhwP6gcfDChh9sydS1whxw== X-Received: by 2002:a63:27c6:: with SMTP id n189-v6mr2306894pgn.164.1528852586904; Tue, 12 Jun 2018 18:16:26 -0700 (PDT) Received: from localhost ([123.117.176.200]) by smtp.gmail.com with ESMTPSA id g66-v6sm1874973pfk.99.2018.06.12.18.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 18:16:26 -0700 (PDT) From: Peng Donglin To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH 2/2] ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro Date: Wed, 13 Jun 2018 09:11:56 +0800 Message-Id: <7f70740d2e9f21d273e0c6bdef6fca2b511a285e.1528819790.git.dolinux.peng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180612_181638_052607_8B84FE7F X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Donglin MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Peng Donglin --- arch/arm64/mm/ptdump_debugfs.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/arch/arm64/mm/ptdump_debugfs.c b/arch/arm64/mm/ptdump_debugfs.c index 02b18f8..24d786f 100644 --- a/arch/arm64/mm/ptdump_debugfs.c +++ b/arch/arm64/mm/ptdump_debugfs.c @@ -10,18 +10,7 @@ static int ptdump_show(struct seq_file *m, void *v) ptdump_walk_pgd(m, info); 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); int ptdump_debugfs_register(struct ptdump_info *info, const char *name) {