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 /fs | |
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 'fs')
-rw-r--r-- | fs/nfs/super.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfsctl.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/blockcheck.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 2f8b1157daa2..04214fc5c304 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1060,7 +1060,7 @@ static int nfs_parse_mount_options(char *raw, | |||
1060 | goto out_nomem; | 1060 | goto out_nomem; |
1061 | rc = strict_strtoul(string, 10, &option); | 1061 | rc = strict_strtoul(string, 10, &option); |
1062 | kfree(string); | 1062 | kfree(string); |
1063 | if (rc != 0 || option > USHORT_MAX) | 1063 | if (rc != 0 || option > USHRT_MAX) |
1064 | goto out_invalid_value; | 1064 | goto out_invalid_value; |
1065 | mnt->nfs_server.port = option; | 1065 | mnt->nfs_server.port = option; |
1066 | break; | 1066 | break; |
@@ -1181,7 +1181,7 @@ static int nfs_parse_mount_options(char *raw, | |||
1181 | goto out_nomem; | 1181 | goto out_nomem; |
1182 | rc = strict_strtoul(string, 10, &option); | 1182 | rc = strict_strtoul(string, 10, &option); |
1183 | kfree(string); | 1183 | kfree(string); |
1184 | if (rc != 0 || option > USHORT_MAX) | 1184 | if (rc != 0 || option > USHRT_MAX) |
1185 | goto out_invalid_value; | 1185 | goto out_invalid_value; |
1186 | mnt->mount_server.port = option; | 1186 | mnt->mount_server.port = option; |
1187 | break; | 1187 | break; |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index bc3194ea01f5..508941c23af7 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -998,7 +998,7 @@ static ssize_t __write_ports_addxprt(char *buf) | |||
998 | if (sscanf(buf, "%15s %4u", transport, &port) != 2) | 998 | if (sscanf(buf, "%15s %4u", transport, &port) != 2) |
999 | return -EINVAL; | 999 | return -EINVAL; |
1000 | 1000 | ||
1001 | if (port < 1 || port > USHORT_MAX) | 1001 | if (port < 1 || port > USHRT_MAX) |
1002 | return -EINVAL; | 1002 | return -EINVAL; |
1003 | 1003 | ||
1004 | err = nfsd_create_serv(); | 1004 | err = nfsd_create_serv(); |
@@ -1040,7 +1040,7 @@ static ssize_t __write_ports_delxprt(char *buf) | |||
1040 | if (sscanf(&buf[1], "%15s %4u", transport, &port) != 2) | 1040 | if (sscanf(&buf[1], "%15s %4u", transport, &port) != 2) |
1041 | return -EINVAL; | 1041 | return -EINVAL; |
1042 | 1042 | ||
1043 | if (port < 1 || port > USHORT_MAX || nfsd_serv == NULL) | 1043 | if (port < 1 || port > USHRT_MAX || nfsd_serv == NULL) |
1044 | return -EINVAL; | 1044 | return -EINVAL; |
1045 | 1045 | ||
1046 | xprt = svc_find_xprt(nfsd_serv, transport, AF_UNSPEC, port); | 1046 | xprt = svc_find_xprt(nfsd_serv, transport, AF_UNSPEC, port); |
diff --git a/fs/ocfs2/blockcheck.c b/fs/ocfs2/blockcheck.c index b7428c5d0d3b..ec6d12339593 100644 --- a/fs/ocfs2/blockcheck.c +++ b/fs/ocfs2/blockcheck.c | |||
@@ -403,7 +403,7 @@ void ocfs2_block_check_compute(void *data, size_t blocksize, | |||
403 | * No ecc'd ocfs2 structure is larger than 4K, so ecc will be no | 403 | * No ecc'd ocfs2 structure is larger than 4K, so ecc will be no |
404 | * larger than 16 bits. | 404 | * larger than 16 bits. |
405 | */ | 405 | */ |
406 | BUG_ON(ecc > USHORT_MAX); | 406 | BUG_ON(ecc > USHRT_MAX); |
407 | 407 | ||
408 | bc->bc_crc32e = cpu_to_le32(crc); | 408 | bc->bc_crc32e = cpu_to_le32(crc); |
409 | bc->bc_ecc = cpu_to_le16((u16)ecc); | 409 | bc->bc_ecc = cpu_to_le16((u16)ecc); |
@@ -508,7 +508,7 @@ void ocfs2_block_check_compute_bhs(struct buffer_head **bhs, int nr, | |||
508 | * No ecc'd ocfs2 structure is larger than 4K, so ecc will be no | 508 | * No ecc'd ocfs2 structure is larger than 4K, so ecc will be no |
509 | * larger than 16 bits. | 509 | * larger than 16 bits. |
510 | */ | 510 | */ |
511 | BUG_ON(ecc > USHORT_MAX); | 511 | BUG_ON(ecc > USHRT_MAX); |
512 | 512 | ||
513 | bc->bc_crc32e = cpu_to_le32(crc); | 513 | bc->bc_crc32e = cpu_to_le32(crc); |
514 | bc->bc_ecc = cpu_to_le16((u16)ecc); | 514 | bc->bc_ecc = cpu_to_le16((u16)ecc); |