Skip to contentSkip to conversation

crypto: ctr - Remove unnecessary header inclusions

PATCH New Herbert Xu 1 participant 5 messages Apr 7, 2025

Subsystems (5)
lore
Share & tools
lore

Herbert Xu

author maintainer
#0 lore raw

cover crypto: ctr - Remove unnecessary header inclusions

This patch series removes the unnecessary header inclusions from crypto/ctr.h. The first three patches adds missing header inclusions to the drivers incorrectly depending on crypto/ctr.h.

Herbert Xu (4):
crypto: nx - Add missing header inclusions
crypto: ccp - Add missing header inclusions
crypto: s5p-sss - Add missing header inclusions
crypto: ctr - Remove unnecessary header inclusions

 drivers/crypto/ccp/ccp-crypto-aes.c  | 15 ++++++++-------
 drivers/crypto/ccp/ccp-crypto-des3.c | 15 ++++++++-------
 drivers/crypto/ccp/ccp-crypto-main.c | 13 ++++++++-----
 drivers/crypto/nx/nx-aes-cbc.c       |  8 +++++---
 drivers/crypto/nx/nx-aes-ctr.c       |  8 +++++---
 drivers/crypto/nx/nx-aes-ecb.c       |  8 +++++---
 drivers/crypto/nx/nx.c               |  4 ++--
 drivers/crypto/nx/nx.h               |  5 ++++-
 drivers/crypto/s5p-sss.c             | 24 +++++++++++-------------
 include/crypto/ctr.h                 |  3 ---
 10 files changed, 56 insertions(+), 47 deletions(-)
Signature · 1 line
2.39.5
author maintainer
#1 lore raw

PATCH 1/4 crypto: nx - Add missing header inclusions

The gutting of crypto/ctr.h uncovered missing header inclusions. Add them.

---
 drivers/crypto/nx/nx-aes-cbc.c | 8 +++++---
 drivers/crypto/nx/nx-aes-ctr.c | 8 +++++---
 drivers/crypto/nx/nx-aes-ecb.c | 8 +++++---
 drivers/crypto/nx/nx.c         | 4 ++--
 drivers/crypto/nx/nx.h         | 5 ++++-
 5 files changed, 21 insertions(+), 12 deletions(-)
drivers/crypto/nx/nx-aes-cbc.c +5 -3
index 0e440f704a8f..35fa5bad1d9f 100644
@@ -8,10 +8,12 @@
  */
 
 #include <crypto/aes.h>
-#include <crypto/algapi.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/crypto.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
 #include <asm/vio.h>
 
 #include "nx_csbcpb.h"
drivers/crypto/nx/nx-aes-ctr.c +5 -3
index dfa3ad1a12f2..709b3ee74657 100644
@@ -9,10 +9,12 @@
 
 #include <crypto/aes.h>
 #include <crypto/ctr.h>
-#include <crypto/algapi.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/crypto.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
 #include <asm/vio.h>
 
 #include "nx_csbcpb.h"
drivers/crypto/nx/nx-aes-ecb.c +5 -3
index 502a565074e9..4039cf3b22d4 100644
@@ -8,10 +8,12 @@
  */
 
 #include <crypto/aes.h>
-#include <crypto/algapi.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/crypto.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
 #include <asm/vio.h>
 
 #include "nx_csbcpb.h"
drivers/crypto/nx/nx.c +2 -2
index a3b979193d9b..4e4a371ba390 100644
@@ -7,11 +7,11 @@
  * Author: Kent Yoder <[email protected]>
  */
 
+#include <crypto/aes.h>
 #include <crypto/internal/aead.h>
 #include <crypto/internal/hash.h>
-#include <crypto/aes.h>
+#include <crypto/internal/skcipher.h>
 #include <crypto/sha2.h>
-#include <crypto/algapi.h>
 #include <crypto/scatterwalk.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
drivers/crypto/nx/nx.h +4 -1
index e1b4b6927bec..b1f6634a1644 100644
@@ -4,6 +4,9 @@
 #define __NX_H__
 
 #include <crypto/ctr.h>
+#include <crypto/internal/aead.h>
+#include <crypto/internal/hash.h>
+#include <crypto/internal/skcipher.h>
 
 #define NX_NAME		"nx-crypto"
 #define NX_STRING	"IBM Power7+ Nest Accelerator Crypto Driver"
@@ -139,7 +142,7 @@ struct nx_crypto_ctx {
 	} priv;
 };
 
-struct crypto_aead;
+struct scatterlist;
 
 /* prototypes */
 int nx_crypto_ctx_aes_ccm_init(struct crypto_aead *tfm);
Signature · 1 line
2.39.5
author maintainer
#2 lore raw

PATCH 2/4 crypto: ccp - Add missing header inclusions

In reply to Herbert Xu

The gutting of crypto/ctr.h uncovered missing header inclusions. Add them.

---
 drivers/crypto/ccp/ccp-crypto-aes.c  | 15 ++++++++-------
 drivers/crypto/ccp/ccp-crypto-des3.c | 15 ++++++++-------
 drivers/crypto/ccp/ccp-crypto-main.c | 13 ++++++++-----
 3 files changed, 24 insertions(+), 19 deletions(-)
drivers/crypto/ccp/ccp-crypto-aes.c +8 -7
index d11daaf47f06..685d42ec7ade 100644
@@ -7,15 +7,16 @@
  * Author: Tom Lendacky <[email protected]>
  */
 
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/delay.h>
-#include <linux/scatterlist.h>
-#include <linux/crypto.h>
-#include <crypto/algapi.h>
 #include <crypto/aes.h>
 #include <crypto/ctr.h>
-#include <crypto/scatterwalk.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/scatterlist.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 
 #include "ccp-crypto.h"
 
drivers/crypto/ccp/ccp-crypto-des3.c +8 -7
index afae30adb703..91b1189c47de 100644
@@ -7,14 +7,15 @@
  * Author: Gary R Hook <[email protected]>
  */
 
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/delay.h>
-#include <linux/scatterlist.h>
-#include <linux/crypto.h>
-#include <crypto/algapi.h>
-#include <crypto/scatterwalk.h>
 #include <crypto/internal/des.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/scatterlist.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 
 #include "ccp-crypto.h"
 
drivers/crypto/ccp/ccp-crypto-main.c +8 -5
index ecd58b38c46e..bc90aba5162a 100644
@@ -7,14 +7,17 @@
  * Author: Tom Lendacky <[email protected]>
  */
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <crypto/internal/akcipher.h>
+#include <crypto/internal/hash.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/ccp.h>
+#include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/ccp.h>
+#include <linux/module.h>
 #include <linux/scatterlist.h>
-#include <crypto/internal/hash.h>
-#include <crypto/internal/akcipher.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
 
 #include "ccp-crypto.h"
 
Signature · 1 line
2.39.5
author maintainer
#3 lore raw

PATCH 3/4 crypto: s5p-sss - Add missing header inclusions

In reply to Herbert Xu

The gutting of crypto/ctr.h uncovered missing header inclusions. Add them.

---
 drivers/crypto/s5p-sss.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/crypto/s5p-sss.c +11 -13
index b4c3c14dafd5..b829c84f60f2 100644
@@ -9,11 +9,17 @@
 //
 // Hash part based on omap-sham.c driver.
 
+#include <crypto/aes.h>
+#include <crypto/ctr.h>
+#include <crypto/internal/hash.h>
+#include <crypto/internal/skcipher.h>
+#include <crypto/md5.h>
+#include <crypto/scatterwalk.h>
+#include <crypto/sha1.h>
+#include <crypto/sha2.h>
 #include <linux/clk.h>
-#include <linux/crypto.h>
 #include <linux/dma-mapping.h>
 #include <linux/err.h>
-#include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -22,17 +28,9 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/scatterlist.h>
-
-#include <crypto/ctr.h>
-#include <crypto/aes.h>
-#include <crypto/algapi.h>
-#include <crypto/scatterwalk.h>
-
-#include <crypto/hash.h>
-#include <crypto/md5.h>
-#include <crypto/sha1.h>
-#include <crypto/sha2.h>
-#include <crypto/internal/hash.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
 
 #define _SBF(s, v)			((v) << (s))
 
Signature · 1 line
2.39.5
author maintainer
#4 lore raw

PATCH 4/4 crypto: ctr - Remove unnecessary header inclusions

In reply to Herbert Xu

Now that the broken drivers have been fixed, remove the unnecessary inclusions from crypto/ctr.h.

---
 include/crypto/ctr.h | 3 ---
 1 file changed, 3 deletions(-)
include/crypto/ctr.h +0 -3
index c41685874f00..06984a26c8cf 100644
@@ -8,9 +8,6 @@
 #ifndef _CRYPTO_CTR_H
 #define _CRYPTO_CTR_H
 
-#include <crypto/algapi.h>
-#include <crypto/internal/skcipher.h>
-
 #define CTR_RFC3686_NONCE_SIZE 4
 #define CTR_RFC3686_IV_SIZE 8
 #define CTR_RFC3686_BLOCK_SIZE 16
Signature · 1 line
2.39.5