提交 d02d48d8 编写于 作者: A Al Viro 提交者: Linus Torvalds

[PATCH] isofs endianness annotations

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6ca15841
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* Convert Unicode 16 to UTF-8 or ASCII. * Convert Unicode 16 to UTF-8 or ASCII.
*/ */
static int static int
uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls) uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
{ {
wchar_t *ip, ch; __be16 *ip, ch;
unsigned char *op; unsigned char *op;
ip = uni; ip = uni;
...@@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls) ...@@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
while ((ch = get_unaligned(ip)) && len) { while ((ch = get_unaligned(ip)) && len) {
int llen; int llen;
ch = be16_to_cpu(ch); llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE);
if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0) if (llen > 0)
op += llen; op += llen;
else else
*op++ = '?'; *op++ = '?';
...@@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st ...@@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st
len = wcsntombs_be(outname, de->name, len = wcsntombs_be(outname, de->name,
de->name_len[0] >> 1, PAGE_SIZE); de->name_len[0] >> 1, PAGE_SIZE);
} else { } else {
len = uni16_to_x8(outname, (u16 *) de->name, len = uni16_to_x8(outname, (__be16 *) de->name,
de->name_len[0] >> 1, nls); de->name_len[0] >> 1, nls);
} }
if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) { if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册