__generic_block_fiemap(): fix for files bigger than 4GB
[safe/jmp/linux-2.6] / fs / cifs / cifs_unicode.c
index 6382720..714a542 100644 (file)
@@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
        int maxwords = maxbytes / 2;
        char tmp[NLS_MAX_CHARSET_SIZE];
 
-       for (i = 0; from[i] && i < maxwords; i++) {
+       for (i = 0; i < maxwords && from[i]; i++) {
                charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
                                             NLS_MAX_CHARSET_SIZE);
                if (charlen > 0)
@@ -181,35 +181,6 @@ cifs_from_ucs2(char *to, const __le16 *from, int tolen, int fromlen,
 }
 
 /*
- * NAME:       cifs_strfromUCS()
- *
- * FUNCTION:   Convert little-endian unicode string to character string
- *
- */
-int
-cifs_strfromUCS_le(char *to, const __le16 *from,
-                  int len, const struct nls_table *codepage)
-{
-       int i;
-       int outlen = 0;
-
-       for (i = 0; (i < len) && from[i]; i++) {
-               int charlen;
-               /* 2.4.0 kernel or greater */
-               charlen =
-                   codepage->uni2char(le16_to_cpu(from[i]), &to[outlen],
-                                      NLS_MAX_CHARSET_SIZE);
-               if (charlen > 0) {
-                       outlen += charlen;
-               } else {
-                       to[outlen++] = '?';
-               }
-       }
-       to[outlen] = 0;
-       return outlen;
-}
-
-/*
  * NAME:       cifs_strtoUCS()
  *
  * FUNCTION:   Convert character string to unicode string