Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp838749pxk; Thu, 17 Sep 2020 18:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDC7hXeim5kmwgmnj7PhRYNdTkDALjSzCMbEp1Ft01myvg+9G2eE/BYDbJyayuoxhkeXJS X-Received: by 2002:a50:f418:: with SMTP id r24mr36222969edm.295.1600392798234; Thu, 17 Sep 2020 18:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600392798; cv=none; d=google.com; s=arc-20160816; b=hZ1SALeaHif4eafFjcer8eZkh3NPUU/uZF0TDPAvKalO75G+JSvXYRH8yKWmnDlNQ0 RGDS1CvC0WhGwsSZYk4rhFIyiniYjjVQVvMCszpMgKGM2XExasfdK6b8q5IBocECUBIA ZqRo1R6VZqs40Gt1yZpcCcIG8MRIkg5s9aN4AUOMQjugWrMLQQJD+Opp3JJbj8oFE+1u S9Erpn4De9jEn6CIGxo4e7pJ/QuAhptOh9yjOKzNV6DwfKEI2SFNxefh96ogjDv8ELIt M8OdP+OLP46y6CrYTd/OjkYNowrEs6n4mK7TeTDB/UZjAJ7CfSrUQ25WWvvmA+id89A1 o3fw== 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=+FYVF+UfisuebkMa7+b5KqFgBhTGoz7q6bprjOSAaTM=; b=cLM4c2qrjI+G229sNjpr/MwvI+q9DaktuKw8T4W7IMc2HUnoGvUv76zrvGyUF+hEKR cOrlknQmxCjy3DJtPtWZcaBADDGSVxxvF6TtttDmYhaG5+hPdkYKLOhTWriN0ubcHEkR AbrKDry4GukFN5IMidE+ZVVXN6IGR3VcOtlCTOM0efGhNc+62c3TzYO7++ApdYf8khJH qd8xyPGtyrwBpIQRjxhGbM8KfxGx9HKeAjsyAaxAUlmLKz3G/xtpC5xp6jBGg8Zbt3/d parXQjF1v9xs/4pkQeRD1Q8wtt//k7W3cyxlrgcvGHKKB5kXVyudqzf0twvBw6058wIw GFEw== 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 m17si968123edj.540.2020.09.17.18.32.55; Thu, 17 Sep 2020 18:33:18 -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 S1726310AbgIRBay (ORCPT + 99 others); Thu, 17 Sep 2020 21:30:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39276 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbgIRBav (ORCPT ); Thu, 17 Sep 2020 21:30:51 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DC7AC86507DEF281E73B; Fri, 18 Sep 2020 09:30:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 09:30:35 +0800 From: Qinglang Miao To: Corentin Labbe , Herbert Xu , "David S. Miller" CC: , , , Qinglang Miao Subject: [PATCH -next v2] crypto: amlogic: Convert to DEFINE_SHOW_ATTRIBUTE Date: Fri, 18 Sep 2020 09:31:10 +0800 Message-ID: <20200918013110.82604-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. drivers/crypto/amlogic/amlogic-gxl-core.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c index 466552acb..5bbeff433 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-core.c +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c @@ -98,7 +98,7 @@ static struct meson_alg_template mc_algs[] = { }; #ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG -static int meson_dbgfs_read(struct seq_file *seq, void *v) +static int meson_debugfs_show(struct seq_file *seq, void *v) { struct meson_dev *mc = seq->private; int i; @@ -118,19 +118,7 @@ static int meson_dbgfs_read(struct seq_file *seq, void *v) } return 0; } - -static int meson_dbgfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, meson_dbgfs_read, inode->i_private); -} - -static const struct file_operations meson_debugfs_fops = { - .owner = THIS_MODULE, - .open = meson_dbgfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(meson_debugfs); #endif static void meson_free_chanlist(struct meson_dev *mc, int i) -- 2.23.0