Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / jfs / jfs_unicode.c
index 974077f..f327dec 100644 (file)
@@ -29,7 +29,7 @@
  * FUNCTION:   Convert little-endian unicode string to character string
  *
  */
-int jfs_strfromUCS_le(char *to, const wchar_t * from,  /* LITTLE ENDIAN */
+int jfs_strfromUCS_le(char *to, const __le16 * from,
                      int len, struct nls_table *codepage)
 {
        int i;
@@ -51,8 +51,9 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
                }
        } else {
                for (i = 0; (i < len) && from[i]; i++) {
-                       if (le16_to_cpu(from[i]) & 0xff00) {
-                               if (warn) {
+                       if (unlikely(le16_to_cpu(from[i]) & 0xff00)) {
+                               to[i] = '?';
+                               if (unlikely(warn)) {
                                        warn--;
                                        warn_again--;
                                        printk(KERN_ERR
@@ -61,7 +62,7 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
                                        printk(KERN_ERR
                                "mount with iocharset=utf8 to access\n");
                                }
-                               to[i] = '?';
+
                        }
                        else
                                to[i] = (char) (le16_to_cpu(from[i]));