Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1064378ybh; Thu, 16 Jul 2020 02:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkMiU/jCESI+hgFema8YOGFkoJb5CHPXBAXd39qbuKfT5zCQvaXI89UOYrGrgdecilUK1N X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr2626829eji.547.1594890215852; Thu, 16 Jul 2020 02:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594890215; cv=none; d=google.com; s=arc-20160816; b=SYCfhc019GURgokmb5MLYytq/XVSzGcalQgGL6FidQAkcxvDX1ho7htDV2J/6clqhg 8S5TQ/m7+LzlSwsc2Nqg8rSoIXIyFjvTtQ/23Hsts94DwkuAoT4wdEXL+G/ddV0XMLeB 2A388u/StNvG8wvuLAUlwRb3rq+2UdvI4oI4+TQ2FJEjmFzMlYGgWTeXtH0ayITRuQM4 OCHHIv5+0/8Wm3hpHSolHLZQyc40irqh/TrJMOmk3qRwn/JAh4Ru8bjUdFidL7PRymcJ lqRYXqL7Qd9RUTPWda5B/svsaR2qHZd3bOg4eSQrLLP+CHB3+CBN2UToc0bKj5dMNVEq DY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bj9S6FwQ3I20o5nLkbVHmSb3RWP/upFhKdoRkdnqac4=; b=Pl/+ISV/RQwAQW1lqxz9nBf/sFvaAUg2xPE1/2jXfXuPOobe5v9QmbZAGsCqimxmmH yCv5GCOQXeskzRsYYQI9G4yE3jo9wIXFrp3Xe9wRlNyjWtVz/Rw5F/dRAG1XBOidXBEf TkAVzelJb7xDA+jGECHAYvcBSZhmWlepcbKQH8LvRNm7rERRo1Qfn1K31a1QJU/51gVa +v+m8VWZitU8ZDbY9V9UTA2aT7EB2KMuKxaCKPIcZSTuWyp1dHPY6UbFxYv1QAVuiaVu KnzjzH6K04MYYJWeT3fR1YT6X7olUQE5JaicTmb0xPmh2jnvdU654R7069fPBftusuuS TFVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 t19si2595389ejx.443.2020.07.16.02.03.12; Thu, 16 Jul 2020 02:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbgGPJCn (ORCPT + 99 others); Thu, 16 Jul 2020 05:02:43 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726830AbgGPJCm (ORCPT ); Thu, 16 Jul 2020 05:02:42 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 667F23729D547BA16FCB; Thu, 16 Jul 2020 17:02:40 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Jul 2020 17:02:36 +0800 From: Qinglang Miao To: Greg Kroah-Hartman , Corentin Labbe , Maxime Ripard , Chen-Yu Tsai CC: , Subject: [PATCH -next] crypto: allwinner - Convert to DEFINE_SHOW_ATTRIBUTE Date: Thu, 16 Jul 2020 17:06:32 +0800 Message-ID: <20200716090632.14124-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 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Chen Huang Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Chen Huang --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 15 ++------------- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 15 ++------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 52c7785c0..3fe7fe698 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -279,7 +279,7 @@ static struct sun8i_ce_alg_template ce_algs[] = { }; #ifdef CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG -static int sun8i_ce_dbgfs_read(struct seq_file *seq, void *v) +static int sun8i_ce_debugfs_show(struct seq_file *seq, void *v) { struct sun8i_ce_dev *ce = seq->private; int i; @@ -302,18 +302,7 @@ static int sun8i_ce_dbgfs_read(struct seq_file *seq, void *v) return 0; } -static int sun8i_ce_dbgfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, sun8i_ce_dbgfs_read, inode->i_private); -} - -static const struct file_operations sun8i_ce_debugfs_fops = { - .owner = THIS_MODULE, - .open = sun8i_ce_dbgfs_open, - .read_iter = seq_read_iter, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(sun8i_ce_debugfs); #endif static void sun8i_ce_free_chanlist(struct sun8i_ce_dev *ce, int i) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c index fde536469..6fe3e009c 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c @@ -263,7 +263,7 @@ static struct sun8i_ss_alg_template ss_algs[] = { }; #ifdef CONFIG_CRYPTO_DEV_SUN8I_SS_DEBUG -static int sun8i_ss_dbgfs_read(struct seq_file *seq, void *v) +static int sun8i_ss_debugfs_show(struct seq_file *seq, void *v) { struct sun8i_ss_dev *ss = seq->private; int i; @@ -286,18 +286,7 @@ static int sun8i_ss_dbgfs_read(struct seq_file *seq, void *v) return 0; } -static int sun8i_ss_dbgfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, sun8i_ss_dbgfs_read, inode->i_private); -} - -static const struct file_operations sun8i_ss_debugfs_fops = { - .owner = THIS_MODULE, - .open = sun8i_ss_dbgfs_open, - .read_iter = seq_read_iter, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(sun8i_ss_debugfs); #endif static void sun8i_ss_free_flows(struct sun8i_ss_dev *ss, int i) -- 2.17.1