Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp908397pxk; Fri, 25 Sep 2020 00:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhJoRFuuTsxRW7yt5mjnUxXziRfw1OxcTXhT1jnG28RFpGeQXoDmsP3LLw1uC3fmBBMeet X-Received: by 2002:a50:9dc8:: with SMTP id l8mr2702761edk.58.1601019436229; Fri, 25 Sep 2020 00:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601019436; cv=none; d=google.com; s=arc-20160816; b=a7BQZ1tW1kaL7LD+pIZxuWS0V4Yx6lU3ghgSFQVMNsB/DL4C72DVDdaF0f8ygKSZw5 nMidZzA6fCTfJdFZEoqe2kLHLjVQ8XDYysLDZ56afLscXM4ibOYYJ2BaJ7gxygqBrVWR qiA/r/yKut+7CgHqnF7S7AmvAhIxF2+Yw7x/y7x88HriPTn4zXheFy0kjvxeRQwZMT8h 3VYC28mC//ILa46Mq8hNi7TSso6VJBIhfuQkHMsO1oFIQlZ2fODhyZR5H0bLfFnVv2gD OSnqM9opU8kDor0MQ6WI4luw9q754OEw325pRBpBlMmg2RqLgcnII8gpT+CoDRtwYlqr BVlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Ti9kUyH7SkjHHkB3TpGke2ZCJTdKmGaQ2okd9h7OmpE=; b=pUV0gxAfCZzviWqm5uWo1qtLRrdPuxu+E5w/6gQ3UlobrKCufqHhXtNEahsVs11WLZ w5lZ/sMC4ktPg2fzK3vbmN4O7DDaLvKIh4GL+IyY1MErxlMtPckwUofcqo7PES5BFhe9 kblELirK2IyNF1KJCQ0Be/mjLjx76PHk1OByq6kvC9LGic8isCoKwC6/Ial0BLmGYmpH TkngOxP5Zn/ZFpX5GvEg3xxU71zWiU5Om10Mdo0JZoVckjAVajYvJUCbfpo3hgaHmV0a F1SLJnpyuoNZNbTamKRZYqG0sIrFXv0jiwk0yHKpQmgYlhEpajbBmnR5Qwg3+BZMok6v G6kQ== 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 i22si1353960ejy.5.2020.09.25.00.36.48; Fri, 25 Sep 2020 00:37:16 -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 S1727238AbgIYHgq (ORCPT + 99 others); Fri, 25 Sep 2020 03:36:46 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:53018 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbgIYHgq (ORCPT ); Fri, 25 Sep 2020 03:36:46 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kLiHO-0006SK-8x; Fri, 25 Sep 2020 17:36:31 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 25 Sep 2020 17:36:29 +1000 Date: Fri, 25 Sep 2020 17:36:29 +1000 From: Herbert Xu To: Corentin Labbe Cc: arnd@arndb.de, davem@davemloft.net, mripard@kernel.org, wens@csie.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 6/7] crypto: sun4i-ss: enabled stats via debugfs Message-ID: <20200925073629.GA18921@gondor.apana.org.au> References: <1600627038-40000-1-git-send-email-clabbe@baylibre.com> <1600627038-40000-7-git-send-email-clabbe@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600627038-40000-7-git-send-email-clabbe@baylibre.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Sep 20, 2020 at 06:37:17PM +0000, Corentin Labbe wrote: > > diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c > index f3bdf465b02e..2ec359eaa4cf 100644 > --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c > +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c > @@ -34,6 +34,10 @@ static int noinline_for_stack sun4i_ss_opti_poll(struct skcipher_request *areq) > struct sg_mapping_iter mi, mo; > unsigned int oi, oo; /* offset for in and out */ > unsigned long flags; > +#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG > + struct skcipher_alg *alg = crypto_skcipher_alg(tfm); > + struct sun4i_ss_alg_template *algt; > +#endif > > if (!areq->cryptlen) > return 0; > @@ -50,6 +54,12 @@ static int noinline_for_stack sun4i_ss_opti_poll(struct skcipher_request *areq) > scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0); > } > > +#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG > + algt = container_of(alg, struct sun4i_ss_alg_template, alg.crypto); > + algt->stat_opti++; > + algt->stat_bytes += areq->cryptlen; > +#endif Please do if (IS_ENABLED(CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG)) { ... } instead so this always gets compiled. > +#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG > + /* Ignore error of debugfs */ > + ss->dbgfs_dir = debugfs_create_dir("sun4i-ss", NULL); > + ss->dbgfs_stats = debugfs_create_file("stats", 0444, ss->dbgfs_dir, ss, > + &sun4i_ss_debugfs_fops); > +#endif The calls too be done under an if statement. Only the assignments need to use the ifdef. > diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h > index 163962f9e284..a98a2c05089b 100644 > --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h > +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h > @@ -13,6 +13,7 @@ > > #include > #include > +#include Please add this into the c files that actually use debugfs, and not here. > #include > #include > #include > @@ -152,6 +153,10 @@ struct sun4i_ss_ctx { > #ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG > u32 seed[SS_SEED_LEN / BITS_PER_LONG]; > #endif > +#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG > + struct dentry *dbgfs_dir; > + struct dentry *dbgfs_stats; > +#endif You just need to add forward declarations for struct dentry. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt