Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ed3dec1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by OGAWA Hirofumi
Browse files

fat: use pack_hex_byte() instead of custom one

parent a3d3203e
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/buffer_head.h>
#include <linux/compat.h>
#include <asm/uaccess.h>
#include <linux/kernel.h>
#include "fat.h"

/*
@@ -140,9 +141,8 @@ static int uni16_to_x8(unsigned char *ascii, const wchar_t *uni, int len,
{
	const wchar_t *ip;
	wchar_t ec;
	unsigned char *op, nc;
	unsigned char *op;
	int charlen;
	int k;

	ip = uni;
	op = ascii;
@@ -154,14 +154,9 @@ static int uni16_to_x8(unsigned char *ascii, const wchar_t *uni, int len,
			len -= charlen;
		} else {
			if (uni_xlate == 1) {
				*op = ':';
				for (k = 4; k > 0; k--) {
					nc = ec & 0xF;
					op[k] = nc > 9	? nc + ('a' - 10)
							: nc + '0';
					ec >>= 4;
				}
				op += 5;
				*op++ = ':';
				op = pack_hex_byte(op, ec >> 8);
				op = pack_hex_byte(op, ec);
				len -= 5;
			} else {
				*op++ = '?';