NLS: improve UTF8 -> UTF16 string conversion routine
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 17 Nov 2011 21:42:19 +0000 (16:42 -0500)
committer黄涛 <huangtao@rock-chips.com>
Fri, 19 Jul 2013 01:49:57 +0000 (09:49 +0800)
commit71ddb98dfa1f717ddfeaacad8035a21cacd391a3
tree71f9ed87dde64f39d354b8b1fe38f8c10f755f61
parent938ad49aa5ecb9633449d313e15a8f41f1a2ee5c
NLS: improve UTF8 -> UTF16 string conversion routine

commit 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd upstream.

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@linuxfoundation.org>
drivers/staging/hv/hv_kvp.c
fs/fat/namei_vfat.c
fs/nls/nls_base.c
include/linux/nls.h