Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4322251pxf; Tue, 30 Mar 2021 05:11:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYyEq92ob6PJlPU3o1+no/ykvy9VUr+tNLxo0eOoBoJnx1CVguqwSdfrHUiGlNkjh8dbsY X-Received: by 2002:a05:6402:1393:: with SMTP id b19mr33134756edv.333.1617106295741; Tue, 30 Mar 2021 05:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617106295; cv=none; d=google.com; s=arc-20160816; b=Lwb3PCo1y/J1ut75YzINEBChQlQn3DXB1xdcPYcXzG+hkRXyx6m1GLhqM82czDMJlj 5B+DwQeEg19OvkO6v385z3ecQj3W/DkNcr4x75LM2gOKJp/qyKu+6rpct81HVg9AGEs0 GqTrRkuhEDn7E+kxPTvmyY5xmvmU6bcMa68uODkN8/rH16kghPLrQU/pIZuPcnR1L+R9 D52MmCTN25wm7qUUh5h64vDoaYqSmnGyGMPLbmnc3K3E9eGvARz0s8tmCdcqCEFAA3PT UIazldNP7TFO3Oq0O1nJ44Nztses5Qz8NhI8iCxm9Kjurb/5qPLZuhfPo1oD1nmnINhz gi3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=7o6erMMm0cNRcpdkgC7cvE9lICjacCUowUobl6jTU0M=; b=l+b6gFtKowqSbu26oEopMbYOnCTBYbWNgGI4trxBu03Xx1nvqHIHnZ2gUiBtvYegBb 1DBfBEdquvINYAINrCtfU8WNRpylt2MEtlvrMhRgA/1WmQIdLmiPXYQ3zInqg0xK0Tvs YanjCkmgWOM0LCOHjLvx9YRezZSteA8udEW2swfWJw5x7GV1Eqd2OQGUmei+518YgslB QKyZuVLoLIydihVzlZQEdtemQKv7DhlXSpz9VMYMYfy59Flevg9Gk8e4aNsFFYZr5h7x noreSt/yBMb/K/zwLPrPS6+5s8QJNWidwjyWwehrdgNWQye0/+qGoPZig6w4lhFtDqLf Pdkg== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fb9si4644726ejc.138.2021.03.30.05.11.06; Tue, 30 Mar 2021 05:11:35 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbhC3MKd (ORCPT + 99 others); Tue, 30 Mar 2021 08:10:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:15396 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231848AbhC3MJ7 (ORCPT ); Tue, 30 Mar 2021 08:09:59 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F8pB75xvFznTm9; Tue, 30 Mar 2021 20:08:15 +0800 (CST) Received: from [10.67.101.248] (10.67.101.248) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Tue, 30 Mar 2021 20:09:46 +0800 Subject: Re: [PATCH] crypto: hisilicon - check if debugfs opened To: Greg KH References: <1616833980-11006-1-git-send-email-tanghui20@huawei.com> CC: , , , , , From: tanghui20 Message-ID: <17d627e8-b89a-bbb8-f5d7-11210b859ac7@huawei.com> Date: Tue, 30 Mar 2021 20:09:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.101.248] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 >> --- >> 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. Thanks.