linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] crypto: caam - Fix kerneldoc
@ 2020-09-02 15:05 Krzysztof Kozlowski
  2020-09-02 15:05 ` [PATCH 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 15:05 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32
  Cc: Krzysztof Kozlowski

Fix kerneldoc warnings:

  drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function prototype: 'struct caam_ctx '
  drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function prototype: 'struct caam_hash_ctx '

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/crypto/caam/caamalg_qi2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
index 66ae1d581168..0441e4ff2df2 100644
--- a/drivers/crypto/caam/caamalg_qi2.c
+++ b/drivers/crypto/caam/caamalg_qi2.c
@@ -59,7 +59,7 @@ struct caam_skcipher_alg {
 };
 
 /**
- * caam_ctx - per-session context
+ * struct caam_ctx - per-session context
  * @flc: Flow Contexts array
  * @key:  [authentication key], encryption key
  * @flc_dma: I/O virtual addresses of the Flow Contexts
@@ -2951,7 +2951,7 @@ enum hash_optype {
 };
 
 /**
- * caam_hash_ctx - ahash per-session context
+ * struct caam_hash_ctx - ahash per-session context
  * @flc: Flow Contexts array
  * @key: authentication key
  * @flc_dma: I/O virtual addresses of the Flow Contexts
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] crypto: caam - Simplify with dev_err_probe()
  2020-09-02 15:05 [PATCH 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
@ 2020-09-02 15:05 ` Krzysztof Kozlowski
  2020-09-03 12:04   ` Iuliana Prodan
  2020-09-02 15:05 ` [PATCH 3/4] crypto: stm32-hash " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 15:05 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/crypto/caam/caamalg_qi2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
index 0441e4ff2df2..076c6b04bea9 100644
--- a/drivers/crypto/caam/caamalg_qi2.c
+++ b/drivers/crypto/caam/caamalg_qi2.c
@@ -5115,8 +5115,7 @@ static int dpaa2_caam_probe(struct fsl_mc_device *dpseci_dev)
 	/* DPIO */
 	err = dpaa2_dpseci_dpio_setup(priv);
 	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(dev, "dpaa2_dpseci_dpio_setup() failed\n");
+		dev_err_probe(dev, err, "dpaa2_dpseci_dpio_setup() failed\n");
 		goto err_dpio_setup;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] crypto: stm32-hash - Simplify with dev_err_probe()
  2020-09-02 15:05 [PATCH 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
  2020-09-02 15:05 ` [PATCH 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-02 15:05 ` Krzysztof Kozlowski
  2020-09-02 15:05 ` [PATCH 4/4] crypto: allwinner/sun8i " Krzysztof Kozlowski
  2020-09-03 12:08 ` [PATCH 1/4] crypto: caam - Fix kerneldoc Iuliana Prodan
  3 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 15:05 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/crypto/stm32/stm32-hash.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index 092eaabda238..3524130cf6ee 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -1464,14 +1464,9 @@ static int stm32_hash_probe(struct platform_device *pdev)
 	}
 
 	hdev->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(hdev->clk)) {
-		if (PTR_ERR(hdev->clk) != -EPROBE_DEFER) {
-			dev_err(dev, "failed to get clock for hash (%lu)\n",
-				PTR_ERR(hdev->clk));
-		}
-
-		return PTR_ERR(hdev->clk);
-	}
+	if (IS_ERR(hdev->clk))
+		return dev_err_probe(dev, PTR_ERR(hdev->clk),
+				     "failed to get clock for hash\n");
 
 	ret = clk_prepare_enable(hdev->clk);
 	if (ret) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] crypto: allwinner/sun8i - Simplify with dev_err_probe()
  2020-09-02 15:05 [PATCH 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
  2020-09-02 15:05 ` [PATCH 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
  2020-09-02 15:05 ` [PATCH 3/4] crypto: stm32-hash " Krzysztof Kozlowski
@ 2020-09-02 15:05 ` Krzysztof Kozlowski
  2020-09-03 12:08 ` [PATCH 1/4] crypto: caam - Fix kerneldoc Iuliana Prodan
  3 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-02 15:05 UTC (permalink / raw)
  To: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 9 +++------
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 9 +++------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
index 138759dc8190..e3c62051c595 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
@@ -573,12 +573,9 @@ static int sun8i_ce_probe(struct platform_device *pdev)
 		return irq;
 
 	ce->reset = devm_reset_control_get(&pdev->dev, NULL);
-	if (IS_ERR(ce->reset)) {
-		if (PTR_ERR(ce->reset) == -EPROBE_DEFER)
-			return PTR_ERR(ce->reset);
-		dev_err(&pdev->dev, "No reset control found\n");
-		return PTR_ERR(ce->reset);
-	}
+	if (IS_ERR(ce->reset))
+		return dev_err_probe(&pdev->dev, PTR_ERR(ce->reset),
+				     "No reset control found\n");
 
 	mutex_init(&ce->mlock);
 
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
index 9a23515783a6..576df8c8df51 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
@@ -545,12 +545,9 @@ static int sun8i_ss_probe(struct platform_device *pdev)
 		return irq;
 
 	ss->reset = devm_reset_control_get(&pdev->dev, NULL);
-	if (IS_ERR(ss->reset)) {
-		if (PTR_ERR(ss->reset) == -EPROBE_DEFER)
-			return PTR_ERR(ss->reset);
-		dev_err(&pdev->dev, "No reset control found\n");
-		return PTR_ERR(ss->reset);
-	}
+	if (IS_ERR(ss->reset))
+		return dev_err_probe(&pdev->dev, PTR_ERR(ss->reset),
+				     "No reset control found\n");
 
 	mutex_init(&ss->mlock);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] crypto: caam - Simplify with dev_err_probe()
  2020-09-02 15:05 ` [PATCH 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-03 12:04   ` Iuliana Prodan
  0 siblings, 0 replies; 7+ messages in thread
From: Iuliana Prodan @ 2020-09-03 12:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Corentin Labbe, Herbert Xu, David S. Miller,
	Maxime Ripard, Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32

On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and the error value gets printed.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>

> ---
>   drivers/crypto/caam/caamalg_qi2.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
> index 0441e4ff2df2..076c6b04bea9 100644
> --- a/drivers/crypto/caam/caamalg_qi2.c
> +++ b/drivers/crypto/caam/caamalg_qi2.c
> @@ -5115,8 +5115,7 @@ static int dpaa2_caam_probe(struct fsl_mc_device *dpseci_dev)
>   	/* DPIO */
>   	err = dpaa2_dpseci_dpio_setup(priv);
>   	if (err) {
> -		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "dpaa2_dpseci_dpio_setup() failed\n");
> +		dev_err_probe(dev, err, "dpaa2_dpseci_dpio_setup() failed\n");
>   		goto err_dpio_setup;
>   	}
>   
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] crypto: caam - Fix kerneldoc
  2020-09-02 15:05 [PATCH 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2020-09-02 15:05 ` [PATCH 4/4] crypto: allwinner/sun8i " Krzysztof Kozlowski
@ 2020-09-03 12:08 ` Iuliana Prodan
  2020-09-03 12:21   ` Krzysztof Kozlowski
  3 siblings, 1 reply; 7+ messages in thread
From: Iuliana Prodan @ 2020-09-03 12:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Corentin Labbe, Herbert Xu, David S. Miller,
	Maxime Ripard, Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32

On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
> Fix kerneldoc warnings:
> 
>    drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function prototype: 'struct caam_ctx '
>    drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function prototype: 'struct caam_hash_ctx '
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
This LGTM, but, while here, can you, please, check the other kernel-doc 
warnings:
drivers/crypto/caam/ctrl.c:449: warning: Function parameter or member 
'ctrl' not described in 'caam_get_era'
drivers/crypto/caam/jr.c:331: warning: Function parameter or member 
'rdev' not described in 'caam_jr_free'
drivers/crypto/caam/jr.c:369: warning: Excess function parameter 
'status' description in 'caam_jr_enqueue'
drivers/crypto/caam/caamalg_desc.c:387: warning: Function parameter or 
member 'geniv' not described in 'cnstr_shdsc_aead_decap'

Thanks,
Iulia

>   drivers/crypto/caam/caamalg_qi2.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
> index 66ae1d581168..0441e4ff2df2 100644
> --- a/drivers/crypto/caam/caamalg_qi2.c
> +++ b/drivers/crypto/caam/caamalg_qi2.c
> @@ -59,7 +59,7 @@ struct caam_skcipher_alg {
>   };
>   
>   /**
> - * caam_ctx - per-session context
> + * struct caam_ctx - per-session context
>    * @flc: Flow Contexts array
>    * @key:  [authentication key], encryption key
>    * @flc_dma: I/O virtual addresses of the Flow Contexts
> @@ -2951,7 +2951,7 @@ enum hash_optype {
>   };
>   
>   /**
> - * caam_hash_ctx - ahash per-session context
> + * struct caam_hash_ctx - ahash per-session context
>    * @flc: Flow Contexts array
>    * @key: authentication key
>    * @flc_dma: I/O virtual addresses of the Flow Contexts
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] crypto: caam - Fix kerneldoc
  2020-09-03 12:08 ` [PATCH 1/4] crypto: caam - Fix kerneldoc Iuliana Prodan
@ 2020-09-03 12:21   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-03 12:21 UTC (permalink / raw)
  To: Iuliana Prodan
  Cc: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Horia Geantă,
	Aymen Sghaier, Maxime Coquelin, Alexandre Torgue, Chen Zhou,
	linux-crypto, linux-arm-kernel, linux-kernel, linux-stm32

On Thu, 3 Sep 2020 at 14:08, Iuliana Prodan <iuliana.prodan@nxp.com> wrote:
>
> On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
> > Fix kerneldoc warnings:
> >
> >    drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function prototype: 'struct caam_ctx '
> >    drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function prototype: 'struct caam_hash_ctx '
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> This LGTM, but, while here, can you, please, check the other kernel-doc
> warnings:
> drivers/crypto/caam/ctrl.c:449: warning: Function parameter or member
> 'ctrl' not described in 'caam_get_era'
> drivers/crypto/caam/jr.c:331: warning: Function parameter or member
> 'rdev' not described in 'caam_jr_free'
> drivers/crypto/caam/jr.c:369: warning: Excess function parameter
> 'status' description in 'caam_jr_enqueue'
> drivers/crypto/caam/caamalg_desc.c:387: warning: Function parameter or
> member 'geniv' not described in 'cnstr_shdsc_aead_decap'

Sure, I'll take a look.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-03 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 15:05 [PATCH 1/4] crypto: caam - Fix kerneldoc Krzysztof Kozlowski
2020-09-02 15:05 ` [PATCH 2/4] crypto: caam - Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-03 12:04   ` Iuliana Prodan
2020-09-02 15:05 ` [PATCH 3/4] crypto: stm32-hash " Krzysztof Kozlowski
2020-09-02 15:05 ` [PATCH 4/4] crypto: allwinner/sun8i " Krzysztof Kozlowski
2020-09-03 12:08 ` [PATCH 1/4] crypto: caam - Fix kerneldoc Iuliana Prodan
2020-09-03 12:21   ` Krzysztof Kozlowski

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).