linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: tanghui20 <tanghui20@huawei.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-crypto@vger.kernel.org, xuzaibo@huawei.com,
	wangzhou1@hisilicon.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: hisilicon - check if debugfs opened
Date: Tue, 30 Mar 2021 14:23:06 +0200	[thread overview]
Message-ID: <YGMYKquXSaju9H+A@kroah.com> (raw)
In-Reply-To: <17d627e8-b89a-bbb8-f5d7-11210b859ac7@huawei.com>

On Tue, Mar 30, 2021 at 08:09:46PM +0800, tanghui20 wrote:
> 
> 
> On 2021/3/28 23:09, Greg KH wrote:
> > On Sat, Mar 27, 2021 at 04:33:00PM +0800, Hui Tang wrote:
> > > 'xx_debugfs_init' check if debugfs opened.
> > > 
> > > Signed-off-by: Hui Tang <tanghui20@huawei.com>
> > > ---
> > >  drivers/crypto/hisilicon/hpre/hpre_main.c | 5 ++++-
> > >  drivers/crypto/hisilicon/qm.c             | 3 +++
> > >  drivers/crypto/hisilicon/sec2/sec_main.c  | 5 ++++-
> > >  drivers/crypto/hisilicon/zip/zip_main.c   | 3 +++
> > >  4 files changed, 14 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c
> > > index c7ab06d..f2605c4 100644
> > > --- a/drivers/crypto/hisilicon/hpre/hpre_main.c
> > > +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
> > > @@ -779,6 +779,9 @@ static int hpre_debugfs_init(struct hisi_qm *qm)
> > >  	struct device *dev = &qm->pdev->dev;
> > >  	int ret;
> > > 
> > > +	if (!debugfs_initialized())
> > > +		return -ENOENT;
> > 
> > Why?  What does this help with?  Why does the code care if debugfs is
> > running or not?
> > 
> When !CONFIG_DEBUG_FS, there is no problem if debugfs is not checked,
> but if checking debugfs, a series of stub functions of debugfs can be
> skipped and 'xx_debugfs_init' will be return immediately.

And have you measured an actual speed difference for that?  I would be
amazed if you could...

thanks,

greg k-h

  reply	other threads:[~2021-03-30 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27  8:33 [PATCH] crypto: hisilicon - check if debugfs opened Hui Tang
2021-03-28 15:09 ` Greg KH
2021-03-30 12:09   ` tanghui20
2021-03-30 12:23     ` Greg KH [this message]
2021-03-30 12:40       ` tanghui20
2021-03-30 12:45         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YGMYKquXSaju9H+A@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tanghui20@huawei.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).