[syslinux] [PATCH 2/4] chain.c: gpt's index/private.index mismatchfix, cosmetic iterator changes

Miller, Shao shao.miller at yrdsb.edu.on.ca
Mon Jul 26 17:03:58 PDT 2010


-----Original Message-----
From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On
Behalf Of Michal Soltys
Sent: Monday, July 26, 2010 18:51
To: hpa at zytor.com
Cc: syslinux at zytor.com
Subject: [syslinux] [PATCH 2/4] chain.c: gpt's index/private.index
mismatchfix, cosmetic iterator changes

1) public index in gpt iterator should not skip empty partitions, e.g.
if we have 1st and 3rd gpt entry used, we expect the numbers to be
1 and 3, not 1 and 2 (similary to how linux sees it e.g. /dev/sda1 and
/dev/sda3). It's analogous to index / mbr_index fix.

-----
Hmmm...  That makes my interpretation of the Linux code wrong for both
schemes.  If that's the case, sorry, everyone!
-----

2) free(ebr_part); in mbr iterator was not reachable. ebr iterator
takes care of freeing itself and its parent.

-----
This is a coding style picked up from Michael Brown of iPXE.  The code
might be unreachable, but it follows a logical path for "unwinding" what
we've done.  For example, if some part of the code is changed and a new
exit path comes into existence, the fall-through does not need
consideration and the free() suddenly has a good use.  I'd suggest
leaving it in...  Are you having an unreachable code path warning/error?
-----

3) in ebr iterator, error jump from "insane" partition error
can simply go to err_ebr.

-----
I believe that's the same thing here.  Notice how things that need
unwinding come just before the error label?  I find that it also helps
to document our state.  I'd suggest leaving it in.

Thanks!

- Shao Miller




More information about the Syslinux mailing list