[syslinux] [PATCH 12/23] com32/chain: cleaner variable names
Michal Soltys
soltys at ziu.info
Tue Nov 6 04:43:21 PST 2012
On 06.11.2012 11:07, Geert Stappers wrote:
> On Tue, Nov 06, 2012 at 01:32:46AM +0100, Michal Soltys wrote:
>> [PATCH 12/23] com32/chain: cleaner variable names
>>
>> diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c
>> index da96b3d..14e74de 100644
>> --- a/com32/chain/partiter.c
>> +++ b/com32/chain/partiter.c
>> @@ -302,16 +302,14 @@ static int prep_base_ebr(struct part_iter *iter)
>>
>> if (iter->dos.bebr_index0< 0) /* if we don't have base extended partition at all */
>> return -1;
>> - else if (!iter->dos.bebr_start) { /* if not initialized yet */
>> + else if (!iter->dos.bebr_lba) { /* if not initialized yet */
>> dp = ((struct disk_dos_mbr *)iter->data)->table + iter->dos.bebr_index0;
>>
>> - iter->dos.bebr_start = dp->start_lba;
>> - iter->dos.bebr_size = dp->length;
>> + iter->dos.bebr_lba = dp->start_lba;
>> + iter->dos.bebr_siz = dp->length;
>>
>> - iter->dos.ebr_size = iter->dos.bebr_size;
>> -
>> - iter->dos.cebr_lba = 0;
>> - iter->dos.nebr_lba = iter->dos.bebr_start;
>> + iter->dos.nebr_lba = dp->start_lba;
>> + iter->dos.nebr_siz = dp->length;
>>
>> iter->index0--;
>> }
>
> FWIW So how I'm missing a line like
> } + iter->dos.nebr_lba = 0;
>
prep_base_ebr() is just single-shot setup - so it sets bebr_lba
(necessary to calculate position of each subsequent logical partition,
line 366) and 1st nebr_lba (loop control, sanity check). At this point,
nebr_lba is set to lba of first encountered extended partition (== bebr)
and after the first iteration cebr becomes nebr.
As for initialization, everything is 0ed by default (pi_alloc()), and
ctors take care of the rest should something else be needed.
More information about the Syslinux
mailing list