linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Streetman <ddstreet@ieee.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Seth Jennings <sjennings@variantweb.net>,
	Linux-MM <linux-mm@kvack.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Dan Streetman <ddstreet@ieee.org>
Subject: [PATCH] zswap: comment clarifying maxlen
Date: Thu,  6 Aug 2015 13:54:49 -0400	[thread overview]
Message-ID: <1438883689-7868-1-git-send-email-ddstreet@ieee.org> (raw)
In-Reply-To: <CALZtONCquXbE-dHWQUfKL_OSO7Bk5HN+t2EZduoD11vcaiJxmQ@mail.gmail.com>

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(+)

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


  reply	other threads:[~2015-08-06 17:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 13:46 [PATCH 0/3] make zswap params changeable at runtime Dan Streetman
2015-08-05 13:46 ` [PATCH 1/3] zpool: add zpool_has_pool() Dan Streetman
2015-08-05 20:08   ` Andrew Morton
2015-08-05 22:00     ` Dan Streetman
2015-08-05 22:06       ` Andrew Morton
2015-08-06 21:50         ` Seth Jennings
2015-08-07  3:30           ` Seth Jennings
2015-08-14 20:01         ` Dan Streetman
2015-08-06 17:54       ` [PATCH] zpool: clarification comment for zpool_has_pool Dan Streetman
2015-08-05 13:46 ` [PATCH 2/3] zswap: dynamic pool creation Dan Streetman
2015-08-07  6:30   ` Sergey Senozhatsky
2015-08-07 14:24     ` Dan Streetman
2015-08-07 18:57       ` Dan Streetman
2015-08-10  0:49       ` Sergey Senozhatsky
2015-08-14 20:02         ` Dan Streetman
2015-08-05 13:46 ` [PATCH 3/3] zswap: change zpool/compressor at runtime Dan Streetman
2015-08-05 20:14   ` Andrew Morton
2015-08-06 10:06     ` Dan Streetman
2015-08-06 17:54       ` Dan Streetman [this message]
2015-08-06  0:08   ` Sergey Senozhatsky
2015-08-06 10:20     ` Dan Streetman
2015-08-06 10:59       ` Sergey Senozhatsky
2015-08-06 11:07         ` Dan Streetman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438883689-7868-1-git-send-email-ddstreet@ieee.org \
    --to=ddstreet@ieee.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjennings@variantweb.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).