Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1062689ybh; Thu, 16 Jul 2020 02:01:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLKkyt0a4gnSLs0ClapQnAibwgK0GrOogPXKNfV3zSzfxSpMAjUDixS520Wq9y4GW2h1gZ X-Received: by 2002:a05:6402:c06:: with SMTP id co6mr3519676edb.142.1594890066281; Thu, 16 Jul 2020 02:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594890066; cv=none; d=google.com; s=arc-20160816; b=wyGGcJMHZJQB496YmyZoDdLS48AEUGQ4qwJszdRZifB+f11KT/u51pz6N3tMsZKySh 3oI6VaemH5RHHIK1+gXqMuw2LozTjJPmbMRfbhdcf2Y6phSiYZN7OfhErwqAHE2M+vt9 G5yrXhcw/5mtM1HpqSNmlc0GICHeR2SVmE15qx61vEWmLx7zibX8tT/RXRBVvVoeXPhL WGLQSJD6JBa3XJ73ZT/340sW5OzqpBvIrLxwsZRP3X6NmLlF8PYeZrKX+kwwoIQz0ydw e/P5tejWjDORQSVdTccweNmFZt7wFPJmSBDB+v9Og86cFDWX2FUAJ3rZ6fAEFE2pbMWn u/jg== 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=kpSEBog6pXEVZuIBwOqyLOznMFX0h03/0h1e+gj0A2Y=; b=xxC7J4jCd7Rln4HsaWvq/DwHmTLIcg58vkEXYtoS+441G2yXnMjPiTVPSUVyrqtPWn CnJKUM3lH816Y45+NpU9shO1Ov8YN+53w52EbCZ0GzGrBJhguz4SDeM2KwAKjzIJT9je KPtFuVqOVCI2XDUyMddshbhggUBzLxb5GfwLE7TS921CMhxeaWCHMtj4VwZj6iwvAJBu kwThA8rLt4MSX7a5nExM08ssKyDZ8/gYOIeTUkIhEfZSkF+Iy1elV4uzzNCIgDbu5PZw O9O9jhvnDpNHrJn9JV6QAt+SN6rDWVSv7Tp1O+OTHtTQZ5laIzPRQZiHPvQ+kYN3kpHw 71vA== 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 op10si2820563ejb.149.2020.07.16.02.00.42; Thu, 16 Jul 2020 02:01:06 -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 S1728353AbgGPJAL (ORCPT + 99 others); Thu, 16 Jul 2020 05:00:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7865 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725897AbgGPJAK (ORCPT ); Thu, 16 Jul 2020 05:00:10 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EEC9AB6515A83DD13784; Thu, 16 Jul 2020 17:00:08 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Jul 2020 17:00:07 +0800 From: Qinglang Miao To: Greg Kroah-Hartman , =?UTF-8?q?Horia=20Geant=C4=83?= , Aymen Sghaier CC: , Subject: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Date: Thu, 16 Jul 2020 17:04:03 +0800 Message-ID: <20200716090403.13507-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: Liu Shixin Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- drivers/crypto/caam/dpseci-debugfs.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/crypto/caam/dpseci-debugfs.c b/drivers/crypto/caam/dpseci-debugfs.c index aa10841b6..0eca8c2fd 100644 --- a/drivers/crypto/caam/dpseci-debugfs.c +++ b/drivers/crypto/caam/dpseci-debugfs.c @@ -44,33 +44,14 @@ static int dpseci_dbg_fqs_show(struct seq_file *file, void *offset) return 0; } -static int dpseci_dbg_fqs_open(struct inode *inode, struct file *file) -{ - int err; - struct dpaa2_caam_priv *priv; - - priv = (struct dpaa2_caam_priv *)inode->i_private; - - err = single_open(file, dpseci_dbg_fqs_show, priv); - if (err < 0) - dev_err(priv->dev, "single_open() failed\n"); - - return err; -} - -static const struct file_operations dpseci_dbg_fq_ops = { - .open = dpseci_dbg_fqs_open, - .read_iter = seq_read_iter, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(dpseci_dbg_fqs); void dpaa2_dpseci_debugfs_init(struct dpaa2_caam_priv *priv) { priv->dfs_root = debugfs_create_dir(dev_name(priv->dev), NULL); debugfs_create_file("fq_stats", 0444, priv->dfs_root, priv, - &dpseci_dbg_fq_ops); + &dpseci_dbg_fqs_fops); } void dpaa2_dpseci_debugfs_exit(struct dpaa2_caam_priv *priv) -- 2.17.1