Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp46442pxk; Wed, 23 Sep 2020 22:01:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsdZpHi6MN31JJ+NQXwFFJ7cKb5l2GyVuOa686/C0Dx/kw7+anaNw3sWs2no+bX5k/rFmc X-Received: by 2002:aa7:d785:: with SMTP id s5mr2696567edq.154.1600923696847; Wed, 23 Sep 2020 22:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600923696; cv=none; d=google.com; s=arc-20160816; b=MdP8p07yojwIHSxv3zyOo+A6LEo4X7f7F40yG4sipuEP0kmrYDps8SDYh9Jf/e1a3E 6gGCn6OHLraUoh8jEPY2JZks57xgv9rTOg18CGC+r52Mpbiy+D+Ld6wY1bK3b8fSoQsR Wg+Prozi9y7XD81XUcc8pNnJV4gi3E2jl23l41OPvflVbYZw+d29I0ZZIV5fhZ/lAWAy SqveeBWol/k4WyCRZ3PAX44NBmTGnux70SxRaDIdU/5ct07H4GxLgawwqYcFIpGKegNn UNGHNrxKaKRFUY6OoX7CDV7dOAt/IsU07zyQyKbS2Q+IVDf9yfsgbbbuTref6yaFxJB4 tW7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=fbDtHvkZroBHPOIAUWwJhGFlGQ5/xPCppllRU7fYAP4=; b=eyP85Bydpo/1Q7NvmcEfMvPhsHHtVcuJvNrkEbPq+3VTSHig+xBM2iK5PLek4EVkko tuogfNgD0q4rQ2mCpXBliwPYqzAflScEPHWG5JeJISmn87LqUHs2lRDSBhNQT/YPISsQ PgCPcoPcbvx5Rp3z2Tz5iNhvdvte0sWAjhllgvKyKzE6TivMRmisqpJTSvkRIcJ0JMvE OjaXKJ9JiAPKROX8RzN0O8Ep9QIBQEsfMBRqVxCrbN6dmz4AGuEz/OzD2QCmrDuujDcd XOce1FnRu9WfqnSyxF+nJGlN2iy+GtRKjagsVmFAmGONmDl0O6H/5qbQ8CcF+hPFmFov MnyA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si1135296ejr.574.2020.09.23.22.01.00; Wed, 23 Sep 2020 22:01:36 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgIXFAy (ORCPT + 99 others); Thu, 24 Sep 2020 01:00:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:5968 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbgIXFAy (ORCPT ); Thu, 24 Sep 2020 01:00:54 -0400 IronPort-SDR: OfpLZDhRmvDs2nqyvxAllb63aV3m5+pe16cae/6sYVH12ZxMS3K4wOkePVrEMKysSvllIrHKv7 ddD2CZQzjO1A== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="148751722" X-IronPort-AV: E=Sophos;i="5.77,296,1596524400"; d="scan'208";a="148751722" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 22:00:52 -0700 IronPort-SDR: sFUnctqmR4qg1KgsfRgpOyMaAKHwkJVp2+Ol5m45qzFnvoQ+jf1n3W3d5DD2GcWB1QDi3Mk2fZ x+Xd49rWtnNA== X-IronPort-AV: E=Sophos;i="5.77,296,1596524400"; d="scan'208";a="455195672" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314) ([10.237.222.51]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 22:00:50 -0700 Date: Thu, 24 Sep 2020 06:00:42 +0100 From: Giovanni Cabiddu To: Liu Shixin Cc: Herbert Xu , "David S . Miller" , qat-linux , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro Message-ID: <20200924050042.GA32206@silpixa00400314> References: <7a1e8142cb4944ee95cea13e7efad23d@irsmsx602.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a1e8142cb4944ee95cea13e7efad23d@irsmsx602.ger.corp.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Sep 16, 2020 at 03:50:17AM +0100, Liu Shixin wrote: > Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Liu Shixin Acked-by: Giovanni Cabiddu > --- > drivers/crypto/qat/qat_common/adf_cfg.c | 19 +-------- > .../qat/qat_common/adf_transport_debug.c | 42 ++----------------- > 2 files changed, 5 insertions(+), 56 deletions(-) > > diff --git a/drivers/crypto/qat/qat_common/adf_cfg.c b/drivers/crypto/qat/qat_common/adf_cfg.c > index ac462796cefc..22ae32838113 100644 > --- a/drivers/crypto/qat/qat_common/adf_cfg.c > +++ b/drivers/crypto/qat/qat_common/adf_cfg.c > @@ -52,24 +52,7 @@ static const struct seq_operations qat_dev_cfg_sops = { > .show = qat_dev_cfg_show > }; > > -static int qat_dev_cfg_open(struct inode *inode, struct file *file) > -{ > - int ret = seq_open(file, &qat_dev_cfg_sops); > - > - if (!ret) { > - struct seq_file *seq_f = file->private_data; > - > - seq_f->private = inode->i_private; > - } > - return ret; > -} > - > -static const struct file_operations qat_dev_cfg_fops = { > - .open = qat_dev_cfg_open, > - .read = seq_read, > - .llseek = seq_lseek, > - .release = seq_release > -}; > +DEFINE_SEQ_ATTRIBUTE(qat_dev_cfg); > > /** > * adf_cfg_dev_add() - Create an acceleration device configuration table. > diff --git a/drivers/crypto/qat/qat_common/adf_transport_debug.c b/drivers/crypto/qat/qat_common/adf_transport_debug.c > index 2a2eccbf56ec..dac25ba47260 100644 > --- a/drivers/crypto/qat/qat_common/adf_transport_debug.c > +++ b/drivers/crypto/qat/qat_common/adf_transport_debug.c > @@ -77,31 +77,14 @@ static void adf_ring_stop(struct seq_file *sfile, void *v) > mutex_unlock(&ring_read_lock); > } > > -static const struct seq_operations adf_ring_sops = { > +static const struct seq_operations adf_ring_debug_sops = { > .start = adf_ring_start, > .next = adf_ring_next, > .stop = adf_ring_stop, > .show = adf_ring_show > }; > > -static int adf_ring_open(struct inode *inode, struct file *file) > -{ > - int ret = seq_open(file, &adf_ring_sops); > - > - if (!ret) { > - struct seq_file *seq_f = file->private_data; > - > - seq_f->private = inode->i_private; > - } > - return ret; > -} > - > -static const struct file_operations adf_ring_debug_fops = { > - .open = adf_ring_open, > - .read = seq_read, > - .llseek = seq_lseek, > - .release = seq_release > -}; > +DEFINE_SEQ_ATTRIBUTE(adf_ring_debug); > > int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name) > { > @@ -188,31 +171,14 @@ static void adf_bank_stop(struct seq_file *sfile, void *v) > mutex_unlock(&bank_read_lock); > } > > -static const struct seq_operations adf_bank_sops = { > +static const struct seq_operations adf_bank_debug_sops = { > .start = adf_bank_start, > .next = adf_bank_next, > .stop = adf_bank_stop, > .show = adf_bank_show > }; > > -static int adf_bank_open(struct inode *inode, struct file *file) > -{ > - int ret = seq_open(file, &adf_bank_sops); > - > - if (!ret) { > - struct seq_file *seq_f = file->private_data; > - > - seq_f->private = inode->i_private; > - } > - return ret; > -} > - > -static const struct file_operations adf_bank_debug_fops = { > - .open = adf_bank_open, > - .read = seq_read, > - .llseek = seq_lseek, > - .release = seq_release > -}; > +DEFINE_SEQ_ATTRIBUTE(adf_bank_debug); > > int adf_bank_debugfs_add(struct adf_etr_bank_data *bank) > { > -- > 2.25.1 >