NLS: improve UTF8 -> UTF16 string conversion routine
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 17 Nov 2011 21:42:19 +0000 (16:42 -0500)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:25:40 +0000 (13:25 -0700)
commit53cf1a5e95526200a6f85e5be623fe7cc7f5934f
tree06763271eaf7504f9b535641f82a84ff99f76a00
parent20b6f1fc64e4e7e1ee121b39e7b774312b0ec56b
NLS: improve UTF8 -> UTF16 string conversion routine

The utf8s_to_utf16s conversion routine needs to be improved.  Unlike
its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
the maximum length of the output buffer or the endianness of its
16-bit output.

This patch (as1501) adds the two missing arguments, and adjusts the
only two places in the kernel where the function is called.  A
follow-on patch will add a third caller that does utilize the new
capabilities.

The two conversion routines are still annoyingly inconsistent in the
way they handle invalid byte combinations.  But that's a subject for a
different patch.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
(cherry picked from commit 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd)

Signed-off-by: Andy Whitcroft <apw@canonical.com>
drivers/hv/hv_kvp.c
fs/fat/namei_vfat.c
fs/nls/nls_base.c
include/linux/nls.h