diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-05-24 17:33:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:07:02 -0400 |
commit | 4be929be34f9bdeffa40d815d32d7d60d2c7f03b (patch) | |
tree | 4d2c6e2b8ef766e565e2e050ee151de2e02081d3 /security/keys | |
parent | 940370fc86b920b51a34217a1facc3e9e97c2456 (diff) |
kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, SHRT_MAX and SHRT_MIN
- C99 knows about USHRT_MAX/SHRT_MAX/SHRT_MIN, not
USHORT_MAX/SHORT_MAX/SHORT_MIN.
- Make SHRT_MIN of type s16, not int, for consistency.
[akpm@linux-foundation.org: fix drivers/dma/timb_dma.c]
[akpm@linux-foundation.org: fix security/keys/keyring.c]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/keys')
-rw-r--r-- | security/keys/keyring.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index ef03a82a0135..d37f713e73ce 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -669,7 +669,7 @@ static void keyring_unlink_rcu_disposal(struct rcu_head *rcu) | |||
669 | struct keyring_list *klist = | 669 | struct keyring_list *klist = |
670 | container_of(rcu, struct keyring_list, rcu); | 670 | container_of(rcu, struct keyring_list, rcu); |
671 | 671 | ||
672 | if (klist->delkey != USHORT_MAX) | 672 | if (klist->delkey != USHRT_MAX) |
673 | key_put(klist->keys[klist->delkey]); | 673 | key_put(klist->keys[klist->delkey]); |
674 | kfree(klist); | 674 | kfree(klist); |
675 | } | 675 | } |
@@ -746,7 +746,7 @@ int __key_link_begin(struct key *keyring, const struct key_type *type, | |||
746 | max += klist->maxkeys; | 746 | max += klist->maxkeys; |
747 | 747 | ||
748 | ret = -ENFILE; | 748 | ret = -ENFILE; |
749 | if (max > USHORT_MAX - 1) | 749 | if (max > USHRT_MAX - 1) |
750 | goto error_quota; | 750 | goto error_quota; |
751 | size = sizeof(*klist) + sizeof(struct key *) * max; | 751 | size = sizeof(*klist) + sizeof(struct key *) * max; |
752 | if (size > PAGE_SIZE) | 752 | if (size > PAGE_SIZE) |
@@ -763,7 +763,7 @@ int __key_link_begin(struct key *keyring, const struct key_type *type, | |||
763 | sizeof(struct key *) * klist->nkeys); | 763 | sizeof(struct key *) * klist->nkeys); |
764 | nklist->delkey = klist->nkeys; | 764 | nklist->delkey = klist->nkeys; |
765 | nklist->nkeys = klist->nkeys + 1; | 765 | nklist->nkeys = klist->nkeys + 1; |
766 | klist->delkey = USHORT_MAX; | 766 | klist->delkey = USHRT_MAX; |
767 | } else { | 767 | } else { |
768 | nklist->nkeys = 1; | 768 | nklist->nkeys = 1; |
769 | nklist->delkey = 0; | 769 | nklist->delkey = 0; |