zswap: Uncross module parameter setting functions
authorPhil Elwell <phil@raspberrypi.com>
Tue, 19 May 2020 14:47:02 +0000 (15:47 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:34:05 +0000 (16:34 +0100)
The "compressor" and "zpool" parameters of the zswap module each has
a custom setter function that calls __zswap_param_set with specific
parameters, but the "zpool" setter uses parameters that are correct for
the "compressor" parameter, and vice-versa.

Fix this by swapping the function bodies over.

Fixes: 90b0fc26d5db ("zswap: change zpool/compressor at runtime")

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
mm/zswap.c

index 46a3223..b0fc8d9 100644 (file)
@@ -761,13 +761,13 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp,
 static int zswap_compressor_param_set(const char *val,
                                      const struct kernel_param *kp)
 {
-       return __zswap_param_set(val, kp, zswap_zpool_type, NULL);
+       return __zswap_param_set(val, kp, NULL, zswap_compressor);
 }
 
 static int zswap_zpool_param_set(const char *val,
                                 const struct kernel_param *kp)
 {
-       return __zswap_param_set(val, kp, NULL, zswap_compressor);
+       return __zswap_param_set(val, kp, zswap_zpool_type, NULL);
 }
 
 static int zswap_enabled_param_set(const char *val,