From patchwork Mon Nov 5 14:32:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 10668355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6189317D4 for ; Mon, 5 Nov 2018 14:32:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EC08298F9 for ; Mon, 5 Nov 2018 14:32:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41AA5298FE; Mon, 5 Nov 2018 14:32:56 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 EFE1D298F9 for ; Mon, 5 Nov 2018 14:32:55 +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: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:In-Reply-To: References:List-Owner; bh=RZSmYr24CwFgIIOJ/m6xfQ9cG+LBoRHhPBxDVZsk4QI=; b=kf/ FCBbkbDO2Xu9oO1V6iVJogIAEDCDVGTkGswwKCFArsbmzDfs1ZUoSriu9jTQsxfJOUnONsSxxXiuX kElXdUOuriYMUKxXYh9j4dr/grdRpW/w3Q4v8BACpLnK06DkTXfFWI6bpLnXsn7Hw2FUttwL119i9 Yt4U4Q/RFtNijwG7ZNBl5YgbaCzt56fCOJhzmDVcJiYbqb9qh84zrmKM0ZlUyQqO7Orr09s8KxhR0 IGUZbKDvT6VJiVz8Qizgil0yToT9ynZiTltGVkJCLqgLVCEqeKKyg/BctKF9wQxGCbPL+TO63rXSz t+IHV3ivz2Rudz7kUGFzM0q8EezCY6Q==; 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 1gJfvx-0007HA-9F; Mon, 05 Nov 2018 14:32:53 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJfvv-0007Ff-9h for linux-arm-kernel@lists.infradead.org; Mon, 05 Nov 2018 14:32:52 +0000 Received: by mail-pf1-x444.google.com with SMTP id v9-v6so2216908pff.2 for ; Mon, 05 Nov 2018 06:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=q/UyctZ3IuOzEhZ86GEcGxYn7ODPlY/62qqfKTvY61k=; b=opsn9ier58llwehvmmYUz9+EtjqL1ghQC38nQElNa/1IvqKJgrk7QD5aChbZzGzJd4 h63xcAmwoq01Y0Q9uTBCN+LemZbafGqDJGCTZxRIyCQPQEdZcgwwpLkmB+QDuiYIuDAI E7EUmyK9SICu4q4nZSTrG0h4BF4tH5NKwXSILea1yJv8DXYUbJzfadmfD0iSD1KJhkfW pDbDp77w1wYQGrnQboFG0f0ZyWbn67o3ySVZsli/XXj4qVhvxSXyVKzHGvwPIExwMRY6 1/UHy6fBWc8vNZVsikstwdDeDhDLt6zDYZADU7xwCjqXabolqa4C86rRQ+FMbH37kiSq Q1Bw== 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; bh=q/UyctZ3IuOzEhZ86GEcGxYn7ODPlY/62qqfKTvY61k=; b=Uu/cq+w3ip0VVqPM1i4XsbKLPL1C1XNT9cOpprp997Lhk7NeKDNDkZxEigfqVMzWRd W8yTxKWJGXVpvYApZWVzajFB6G2DV3DBQXsZq47H2srfMm85moDMyaULojA2PxzwYlDv y+40OTd4XBKOHiG5oN2Aonln5QDgQIAxbe1mL0qsbQ72tDPZvX4kSN7JrdBODPY/TpOG GsU7ewIhdS/F/P6dTBD888Bh/nHp9Om3hplJ3QfCBhmut9jXgBc46aSHZ7adSPZtgn3U kpB64S9bIMy2gFTThBQIBtd2htMDUxLY7aPFsgCegTq9if/RhoZM+i5ALZG2OfZsUb7b ToJg== X-Gm-Message-State: AGRZ1gLbJlRi2X77l4S72yRsgr+CHvSFi0HIPqnbVTyOlxVMzko0T1XL ep75n+bMsp5iLUGAS6gj3CQ= X-Google-Smtp-Source: AJdET5d8G8PLTnWalv5b0tQEX3qYxZIbaOGoJv3OLEYsqn9P09vQ/ZbVGn5ndbFaB+Oc2mlLwbdX7A== X-Received: by 2002:a63:7b06:: with SMTP id w6mr20322224pgc.288.1541428360243; Mon, 05 Nov 2018 06:32:40 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id d5-v6sm29007092pfo.131.2018.11.05.06.32.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Nov 2018 06:32:39 -0800 (PST) From: Yangtao Li To: linux@armlinux.org.uk, jinb.park7@gmail.com, labbott@redhat.com, keescook@chromium.org Subject: [PATCH] ARM: mm: dump: Change to use DEFINE_SHOW_ATTRIBUTE macro Date: Mon, 5 Nov 2018 09:32:34 -0500 Message-Id: <20181105143234.6015-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_063251_339236_E60DA14D X-CRM114-Status: GOOD ( 11.47 ) 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: Yangtao Li , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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: Yangtao Li Acked-by: Laura Abbott Reviewed-by: Kees Cook --- 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 be8d87be4b93..201cd467a739 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); int ptdump_debugfs_register(struct ptdump_info *info, const char *name) {