Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp837711pxk; Thu, 17 Sep 2020 18:31:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2kH76YbzBldD7N19r5PRFffXCnRZHXghcM5WosVV58tTDi98Ympm2QUw4erJpTQxHa6sJ X-Received: by 2002:a17:906:f6c9:: with SMTP id jo9mr33396229ejb.233.1600392678830; Thu, 17 Sep 2020 18:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600392678; cv=none; d=google.com; s=arc-20160816; b=HBrWJ7fFcSu4ualwLksrqXh8fyW1LZbc9AoSpB/CQcTEZ1c0GRVi5MQ23kH01Zv3N3 LE90fyj4EkQGlxhat/tqO2y6sCD9KrxkjMAs19/EweeGubuNfs2E7mUni9vnMPWvnhOT fxZeUtBZGqdcOfFVjuWyxS6YTcSbD8Auqv3wiRk07TMvm996qwWZgeFyCrPiqjGtkctp VOwOKi0plyfme3Xab7Rn0r6HY89rtaQdLKeELSNH7dHuRyBlMCbiH/o5lNcp+725RCU7 lgJ/JjuyilZaBRGUvWpOR/5cX4+el82Rxbgsj9wmVo6hSX9/xv7gWb0tkeLpG/SLHSWE ml5A== 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=AHeML7dD3K74B9zqcfA/F826d15fu0eTCJp5OJ+Unkg=; b=tDlvKhrgdSimGaiXjNVxyx2fYAklKdKvLXMvBvvlraxFZ4bJJ60UsbvB3TAUE50IHF L+L2746mhjRTyzOd5UkRyaSkuY8/I8xOYG5MHPA81dgSjuSVtFnyNphM0tvAQ41xd/rU qLy2fJJGGxKmWSSHYaKEU+j8f599ugpXwZpP0dTDS3OMgIlJTm2JR+oCX5QfsFLp+kPu ZRMDqqEQ5RnwW9L6BV3QBLZHH9xU0iMZfJaPbbtqJ3/zFZ8oJd7MwUQgXHYgETKSOys6 +ZJxVs1IMtNjqVi3eXw0nP7yktR6ldxUJdTjvxR/LGHjoMPSSayB51BY2BQG8CvG/mD8 g/0A== 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 h1si945601edt.106.2020.09.17.18.30.54; Thu, 17 Sep 2020 18:31:18 -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 S1726216AbgIRBan (ORCPT + 99 others); Thu, 17 Sep 2020 21:30:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13278 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbgIRBam (ORCPT ); Thu, 17 Sep 2020 21:30:42 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A3F447BEBEFA84273856; Fri, 18 Sep 2020 09:30:40 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 09:30:33 +0800 From: Qinglang Miao To: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai CC: , , , Qinglang Miao Subject: [PATCH -next v2] crypto: allwinner - Convert to DEFINE_SHOW_ATTRIBUTE Date: Fri, 18 Sep 2020 09:31:08 +0800 Message-ID: <20200918013108.82558-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-crypto@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. 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 138759dc8..65ac1c360 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -283,7 +283,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; @@ -306,18 +306,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 = seq_read, - .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 9a2351578..a27484d57 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c @@ -267,7 +267,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; @@ -290,18 +290,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 = seq_read, - .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.23.0