Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755959AbbHFRzA (ORCPT ); Thu, 6 Aug 2015 13:55:00 -0400 Received: from mail-qg0-f48.google.com ([209.85.192.48]:36708 "EHLO mail-qg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846AbbHFRy5 (ORCPT ); Thu, 6 Aug 2015 13:54:57 -0400 From: Dan Streetman To: Andrew Morton Cc: Seth Jennings , Linux-MM , linux-kernel , Dan Streetman Subject: [PATCH] zswap: comment clarifying maxlen Date: Thu, 6 Aug 2015 13:54:49 -0400 Message-Id: <1438883689-7868-1-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 980 Lines: 32 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 --- mm/zswap.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/