zswap: comment clarifying maxlen
diff mbox series

Message ID 1438883689-7868-1-git-send-email-ddstreet@ieee.org
State New, archived
Headers show
Series
  • zswap: comment clarifying maxlen
Related show

Commit Message

Dan Streetman Aug. 6, 2015, 5:54 p.m. UTC
Add a comment clarifying the variable-size array created on the stack will
always be either CRYPTO_MAX_ALG_NAME (64) or 32 bytes long.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
---
 mm/zswap.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch
diff mbox series

diff --git a/mm/zswap.c b/mm/zswap.c
index 7bbecd9..b198081 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -691,6 +691,11 @@  static int __zswap_param_set(const char *val, const struct kernel_param *kp,
 	char str[kp->str->maxlen], *s;
 	int ret;
 
+	/*
+	 * kp is either zswap_zpool_kparam or zswap_compressor_kparam, defined
+	 * at the top of this file, so maxlen is CRYPTO_MAX_ALG_NAME (64) or
+	 * 32 (arbitrary).
+	 */
 	strlcpy(str, val, kp->str->maxlen);
 	s = strim(str);