Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248204 > unrolled thread

[PATCH] keys: change member variable name

Started byInsu Yun <wuninsu@gmail.com>
First post2015-10-15 23:50 +0200
Last post2015-10-16 00:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] keys: change member variable name Insu Yun <wuninsu@gmail.com> - 2015-10-15 23:50 +0200
    Re: [PATCH] keys: change member variable name David Howells <dhowells@redhat.com> - 2015-10-16 00:00 +0200

#1248204 — [PATCH] keys: change member variable name

FromInsu Yun <wuninsu@gmail.com>
Date2015-10-15 23:50 +0200
Subject[PATCH] keys: change member variable name
Message-ID<qjYzn-2nB-5@gated-at.bofh.it>
key->description and key->index_key.description are same because 
they are unioned. But, for readability, using same name for
duplication and validation seems better.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 security/keys/key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/keys/key.c b/security/keys/key.c
index aee2ec5..c047846 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -278,7 +278,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
 
 	key->index_key.desc_len = desclen;
 	key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
-	if (!key->description)
+	if (!key->index_key.description)
 		goto no_memory_3;
 
 	atomic_set(&key->usage, 1);
-- 
1.9.1

--
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/

[toc] | [next] | [standalone]


#1248210

FromDavid Howells <dhowells@redhat.com>
Date2015-10-16 00:00 +0200
Message-ID<qjYJ4-2A6-11@gated-at.bofh.it>
In reply to#1248204
Insu Yun <wuninsu@gmail.com> wrote:

> key->description and key->index_key.description are same because 
> they are unioned. But, for readability, using same name for
> duplication and validation seems better.
> 
> Signed-off-by: Insu Yun <wuninsu@gmail.com>

I've applied this, but I've changed the subject line to:

	keys: Be more consistent in selection of union members used

if you're okay with that.

David
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web