Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp838484pxk; Thu, 17 Sep 2020 18:32:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0EFCKSrFmQ5ZSxGB+oq4df4swmTiFRMlEFHL68UoOgvky3qjrrhoMBpoxewAw6QJRIVx+ X-Received: by 2002:a17:906:270f:: with SMTP id z15mr22561436ejc.6.1600392767589; Thu, 17 Sep 2020 18:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600392767; cv=none; d=google.com; s=arc-20160816; b=otwyymE2tY7xmZ5tNnGrEEIFv/+y29TCwowtGd+y42wcRXJX7meiatgL4nyqzP4RzG CtpAaF7a6cdR6HVWdXdO0zppTPgoJwZH3RMpz2/2WZz7dDpqc35qWpoj4pW8inG6k8kz dV2DY8oAqTftf0hDRaLd3vL4e082b2Bj7exmoGbMRB6h1l9iNCB/Tu5Cl/3GAHGZ/7Au 5ZXCzes0FKqTuMIYijMJg1YvX6Ohrs9dmbJ5inDFoaN+tQuPEvLvmN4fyxckcaV4OUJC x735cOnGwrJmCFBu0I9x7MobZwMOmyYxFfonT5PZ0GI+HZTvBOwEm/LxQ76AVDVcYikQ NjBA== 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=Qk8ZnZTEOaKP0jnf+uvGH0tVWbZkWT+yN9arO354C2g=; b=SgXPA6ODgmUcbtO4W/UphRdsgjN1TSDz9GqywfJN5w8MeaYd61j0gzkKVJ0CL+BsVE hzXgl7qDFs94SNrI4Fs+JnufgUM5uBFfRVk193OBDitude7ojnH9rcVjHDSr090G3FOk iL5PzGjuJdNKCgv1X/0i1Fkas+Q0o4pBVw8QckZuLuIik9RqRBtv5gz5YgtNq1bM6gDg MUGRsWT976+8k5wsa53in2A7AyJq8wQ96NfdyvpTKpu5ZXAYy4SLO7MvZ8EEA4rvHBwC DO5nZVKXPa2QU5fCzf+Ndp4LdhUbMA0vP3GJUkxexhdsrffhGm1bLhigEUmhdh4s3a6Z U2tw== 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 18si1336968edv.184.2020.09.17.18.32.24; Thu, 17 Sep 2020 18:32:47 -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 S1726281AbgIRBas (ORCPT + 99 others); Thu, 17 Sep 2020 21:30:48 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39398 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726247AbgIRBar (ORCPT ); Thu, 17 Sep 2020 21:30:47 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id ABD92E4BB1D59BF9CAE9; Fri, 18 Sep 2020 09:30:45 +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:36 +0800 From: Qinglang Miao To: =?UTF-8?q?Horia=20Geant=C4=83?= , Aymen Sghaier , Herbert Xu , "David S. Miller" CC: , , "Qinglang Miao" Subject: [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Date: Fri, 18 Sep 2020 09:31:11 +0800 Message-ID: <20200918013111.82650-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/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 c5bfc923a..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 = seq_read, - .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.23.0