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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140331153232.1ea27e25cb4690e64da63782@linux-foundation.org>
Date:	Mon, 31 Mar 2014 15:32:32 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Conrad Meyer <cse.cem@...il.com>
Cc:	Conrad Meyer <cemeyer@...edu>,
	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Mark <markk@...ra.co.uk>
Subject: Re: [PATCH v2] fs: FAT: Add support for DOS 1.x formatted volumes

On Mon, 31 Mar 2014 15:21:17 -0700 Conrad Meyer <cse.cem@...il.com> wrote:

> >> +     if (get_unaligned_le16(&b->sector_size) != 0 || b->sec_per_clus != 0 ||
> >> +             b->reserved != 0 || b->fats != 0 ||
> >> +             get_unaligned_le16(&b->dir_entries) != 0 ||
> >> +             get_unaligned_le16(&b->sectors) != 0 || b->media != 0 ||
> >> +             b->fat_length != 0 || b->secs_track != 0 || b->heads != 0 ||
> >> +             b->secs_track != 0 || b->heads != 0)
> >
> > Impressive!
> 
> I aim to please.

No great improvements immediately occur to me ;)

One could do

	/* nice comment */
	if (get_unaligned_le16(&b->sector_size) != 0)
		return;
	/* another nice comment */
	if (b->sec_per_clus != 0)
		return;
	...

but one would quickly run out of nice comments.

You could do s/ != 0//g.

> Not sure what would be better -- memcmp() part of the
> struct to a zeroed array?

memcmp would be hacky.  And possibly buggy if there are holes in the
struct, which is arch-dependent, shudder.

--
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