[PATCH] isofs endianness annotations
authorAl Viro <viro@ftp.linux.org.uk>
Sat, 24 Dec 2005 19:33:09 +0000 (14:33 -0500)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 10 Oct 2006 23:15:34 +0000 (16:15 -0700)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/isofs/joliet.c

index 81a90e170ac36a10a8fd56e4e3d2242dfab1885d..fb8fe7a9ddc6cf6aee6a8a80542505985c069a34 100644 (file)
@@ -14,9 +14,9 @@
  * Convert Unicode 16 to UTF-8 or ASCII.
  */
 static int
-uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
+uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
 {
-       wchar_t *ip, ch;
+       __be16 *ip, ch;
        unsigned char *op;
 
        ip = uni;
@@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
 
        while ((ch = get_unaligned(ip)) && len) {
                int llen;
-               ch = be16_to_cpu(ch);
-               if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
+               llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE);
+               if (llen > 0)
                        op += llen;
                else
                        *op++ = '?';
@@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st
                len = wcsntombs_be(outname, de->name,
                                   de->name_len[0] >> 1, PAGE_SIZE);
        } else {
-               len = uni16_to_x8(outname, (u16 *) de->name,
+               len = uni16_to_x8(outname, (__be16 *) de->name,
                                  de->name_len[0] >> 1, nls);
        }
        if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {