lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <871uuz87lc.fsf@devron.myhome.or.jp>
Date:	Fri, 30 Sep 2011 04:35:43 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Joe Perches <joe@...ches.com>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4] fat: don't use custom hex_to_bin()

Joe Perches <joe@...ches.com> writes:

>> > perhaps:
>> >
>> > 	__le16	foo;
>> >
>> > 	if (hex2bin((u8 *)&foo, ip + 1, 2) < 0)
>> > 		return -EINVAL;
>> > 	*(u16 *)op = le16_to_cpu(foo);
>> >
>> > 	op += 2;
>> 
>> I also thought about it. But I think it is not so good, like you had
>> mistake.  It should actually be "__be16 foo" and "be16_to_cpu()".
>> 
>> If we used sscanf() instead of hex2bin(), I might agree to use
>> "le16_to_cpu()" though.
>> 
>> Thanks.
>
> Funny.
>
> I guess that's what I get for reading Andy's comment
> and coding that readably.
>
> +                                       /* The ip contains 2 bytes in little
> +                                        * endian format. We need to get them
> +                                        * in native endian. */

In here, simply comment is wrong.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ