diff mbox series

[v5,03/18] zram: remove crypto include

Message ID 20250212063153.179231-4-senozhatsky@chromium.org (mailing list archive)
State New
Headers show
Series zsmalloc/zram: there be preemption | expand

Commit Message

Sergey Senozhatsky Feb. 12, 2025, 6:27 a.m. UTC
Remove a leftover crypto header include.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
 drivers/block/zram/zcomp.c    | 1 -
 drivers/block/zram/zram_drv.c | 4 +++-
 drivers/block/zram/zram_drv.h | 1 -
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Yosry Ahmed Feb. 12, 2025, 4:13 p.m. UTC | #1
On Wed, Feb 12, 2025 at 03:27:01PM +0900, Sergey Senozhatsky wrote:
> Remove a leftover crypto header include.

The subject and log is not very descriptive imo. We stop using
CRYPTO_MAX_ALG_NAME and define our own limit in zram, and removing the
include is just an artifact of that.

> 
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
>  drivers/block/zram/zcomp.c    | 1 -
>  drivers/block/zram/zram_drv.c | 4 +++-
>  drivers/block/zram/zram_drv.h | 1 -
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
> index e83dd9a80a81..c393243eeb5c 100644
> --- a/drivers/block/zram/zcomp.c
> +++ b/drivers/block/zram/zcomp.c
> @@ -8,7 +8,6 @@
>  #include <linux/sched.h>
>  #include <linux/cpu.h>
>  #include <linux/cpuhotplug.h>
> -#include <linux/crypto.h>
>  #include <linux/vmalloc.h>
>  
>  #include "zcomp.h"
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 43f460a45e3e..12fb260e3355 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -44,6 +44,8 @@ static DEFINE_MUTEX(zram_index_mutex);
>  static int zram_major;
>  static const char *default_compressor = CONFIG_ZRAM_DEF_COMP;
>  
> +#define ZRAM_MAX_ALGO_NAME_SZ	64
> +
>  /* Module params (documentation at end) */
>  static unsigned int num_devices = 1;
>  /*
> @@ -1149,7 +1151,7 @@ static int __comp_algorithm_store(struct zram *zram, u32 prio, const char *buf)
>  	size_t sz;
>  
>  	sz = strlen(buf);
> -	if (sz >= CRYPTO_MAX_ALG_NAME)
> +	if (sz >= ZRAM_MAX_ALGO_NAME_SZ)
>  		return -E2BIG;
>  
>  	compressor = kstrdup(buf, GFP_KERNEL);
> diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
> index 63b933059cb6..97c98fa07954 100644
> --- a/drivers/block/zram/zram_drv.h
> +++ b/drivers/block/zram/zram_drv.h
> @@ -17,7 +17,6 @@
>  
>  #include <linux/rwsem.h>
>  #include <linux/zsmalloc.h>
> -#include <linux/crypto.h>
>  
>  #include "zcomp.h"
>  
> -- 
> 2.48.1.502.g6dc24dfdaf-goog
>
Sergey Senozhatsky Feb. 13, 2025, 12:53 a.m. UTC | #2
On (25/02/12 16:13), Yosry Ahmed wrote:
> On Wed, Feb 12, 2025 at 03:27:01PM +0900, Sergey Senozhatsky wrote:
> > Remove a leftover crypto header include.
> 
> The subject and log is not very descriptive imo. We stop using
> CRYPTO_MAX_ALG_NAME and define our own limit in zram, and removing the
> include is just an artifact of that.

Ack.
diff mbox series

Patch

diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index e83dd9a80a81..c393243eeb5c 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -8,7 +8,6 @@ 
 #include <linux/sched.h>
 #include <linux/cpu.h>
 #include <linux/cpuhotplug.h>
-#include <linux/crypto.h>
 #include <linux/vmalloc.h>
 
 #include "zcomp.h"
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 43f460a45e3e..12fb260e3355 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -44,6 +44,8 @@  static DEFINE_MUTEX(zram_index_mutex);
 static int zram_major;
 static const char *default_compressor = CONFIG_ZRAM_DEF_COMP;
 
+#define ZRAM_MAX_ALGO_NAME_SZ	64
+
 /* Module params (documentation at end) */
 static unsigned int num_devices = 1;
 /*
@@ -1149,7 +1151,7 @@  static int __comp_algorithm_store(struct zram *zram, u32 prio, const char *buf)
 	size_t sz;
 
 	sz = strlen(buf);
-	if (sz >= CRYPTO_MAX_ALG_NAME)
+	if (sz >= ZRAM_MAX_ALGO_NAME_SZ)
 		return -E2BIG;
 
 	compressor = kstrdup(buf, GFP_KERNEL);
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 63b933059cb6..97c98fa07954 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -17,7 +17,6 @@ 
 
 #include <linux/rwsem.h>
 #include <linux/zsmalloc.h>
-#include <linux/crypto.h>
 
 #include "zcomp.h"