Skip to contentSkip to conversation

crypto: caam - Fix kerneldoc

PATCH Superseded Krzysztof Kozlowski 2 participants 7 messages Sep 2, 2020 – Sep 3, 2020

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#4 lore raw

PATCH 4/4 crypto: allwinner/sun8i - Simplify with dev_err_probe()

In reply to Krzysztof Kozlowski

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

---
 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(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +3 -6
index 138759dc8190..e3c62051c595 100644
@@ -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);
 
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c +3 -6
index 9a23515783a6..576df8c8df51 100644
@@ -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);
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/4 crypto: stm32-hash - Simplify with dev_err_probe()

In reply to Krzysztof Kozlowski

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

---
 drivers/crypto/stm32/stm32-hash.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/crypto/stm32/stm32-hash.c +3 -8
index 092eaabda238..3524130cf6ee 100644
@@ -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) {
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/4 crypto: caam - Simplify with dev_err_probe()

In reply to Krzysztof Kozlowski

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

---
 drivers/crypto/caam/caamalg_qi2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/caam/caamalg_qi2.c +1 -2
index 0441e4ff2df2..076c6b04bea9 100644
@@ -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;
 	}
 
Signature · 1 line
2.17.1
#0 lore raw

PATCH 1/4 crypto: caam - Fix kerneldoc

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 '

---
 drivers/crypto/caam/caamalg_qi2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/caam/caamalg_qi2.c +2 -2
index 66ae1d581168..0441e4ff2df2 100644
@@ -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
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] crypto: caam - Simplify with dev_err_probe()

In reply to Krzysztof Kozlowski
Quoted 4 lines · Krzysztof Kozlowski

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

Quoted 19 lines
---
  drivers/crypto/caam/caamalg_qi2.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/caam/caamalg_qi2.c +1 -2
index 0441e4ff2df2..076c6b04bea9 100644
@@ -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;
  	}
 
#5 lore raw
In reply to Krzysztof Kozlowski
Quoted 7 lines · 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 '

---

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

Quoted 18 lines
  drivers/crypto/caam/caamalg_qi2.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/caam/caamalg_qi2.c +1 -1
index 66ae1d581168..0441e4ff2df2 100644
@@ -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

drivers/crypto/caam/caamalg_qi2.c enum hash_optype { · line 2957

Quoted 8 lines
drivers/crypto/caam/caamalg_qi2.c +1 -1
@@ -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

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw
Quoted 9 lines · Iuliana Prodan
Quoted 7 lines · 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 '

---

Quoted 10 lines

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

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel