summaryrefslogtreecommitdiffstats
path: root/fs/nls
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-03-24 03:15:34 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 07:33:19 -0800
commite8c96f8c29d89af0c13dc2819a9a00575846ca18 (patch)
treeb90ed0da4803df56a91be5979580e335af2d697c /fs/nls
parentb5029622ac86bb441dc5e641226fb1152fca02d7 (diff)
downloadlinux-e8c96f8c29d89af0c13dc2819a9a00575846ca18.tar.bz2
[PATCH] fs: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a duplicate of ARRAY_SIZE. Some trailing whitespaces are also deleted. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Cc: David Howells <dhowells@redhat.com> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Chris Mason <mason@suse.com> Cc: Jeff Mahoney <jeffm@suse.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Nathan Scott <nathans@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nls')
-rw-r--r--fs/nls/nls_euc-jp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nls/nls_euc-jp.c b/fs/nls/nls_euc-jp.c
index 80f108ae6661..06640c3e4021 100644
--- a/fs/nls/nls_euc-jp.c
+++ b/fs/nls/nls_euc-jp.c
@@ -268,8 +268,6 @@ static unsigned char euc2sjisibm_g3upper_map[][2] = {
{0xFC, 0x4B},
};
-#define MAP_ELEMENT_OF(map) (sizeof(map) / sizeof(map[0]))
-
static inline int sjisibm2euc(unsigned char *euc, const unsigned char sjis_hi,
const unsigned char sjis_lo);
static inline int euc2sjisibm_jisx0212(unsigned char *sjis, const unsigned char euc_hi,
@@ -310,7 +308,7 @@ static inline int euc2sjisibm_jisx0212(unsigned char *sjis, const unsigned char
unsigned short euc;
min_index = 0;
- max_index = MAP_ELEMENT_OF(euc2sjisibm_jisx0212_map) - 1;
+ max_index = ARRAY_SIZE(euc2sjisibm_jisx0212_map) - 1;
euc = (euc_hi << 8) | euc_lo;
while (min_index <= max_index) {
@@ -339,7 +337,7 @@ static inline int euc2sjisibm_g3upper(unsigned char *sjis, const unsigned char e
else
index = ((euc_hi << 8) | euc_lo) - 0xF4A1 + 12;
- if ((index < 0) || (index >= MAP_ELEMENT_OF(euc2sjisibm_g3upper_map)))
+ if ((index < 0) || (index >= ARRAY_SIZE(euc2sjisibm_g3upper_map)))
return 0;
sjis[0] = euc2sjisibm_g3upper_map[index][0];