cifs: clean up various nits in unicode routines (try #2)
authorJeff Layton <jlayton@redhat.com>
Tue, 5 Apr 2011 19:02:37 +0000 (15:02 -0400)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:31 +0000 (14:23 -0500)
commitf4e7ab5f04d88d496c1cb131de56e54dbd8f9a9b
tree57014606ba07257e9494064d51a1cabc2458f622
parent86db49250c2b11deafc4f5be796fa2dcbd15ef9d
cifs: clean up various nits in unicode routines (try #2)

BugLink: http://bugs.launchpad.net/bugs/788691

commit 581ade4d1c025eb10421eda0d0c0a2f04447d7c5 upstream.

Minor revision to the original patch. Don't abuse the __le16 variable
on the stack by casting it to wchar_t and handing it off to char2uni.
Declare an actual wchar_t on the stack instead. This fixes a valid
sparse warning.

Fix the spelling of UNI_ASTERISK. Eliminate the unneeded len_remaining
variable in cifsConvertToUCS.

Also, as David Howells points out. We were better off making
cifsConvertToUCS *not* use put_unaligned_le16 since it means that we
can't optimize the mapped characters at compile time. Switch them
instead to use cpu_to_le16, and simply use put_unaligned to set them
in the string.

Reported-and-acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
fs/cifs/cifs_unicode.c
fs/cifs/cifs_unicode.h