[Ocfs2-tools-devel] [PATCH] mkfs.ocfs2: remove duplicated code in init_record
Eric Ren
zren at suse.com
Tue Mar 22 19:11:00 PDT 2016
Hi,
On 03/22/2016 07:43 PM, Joseph Qi wrote:
> Hi Eric,
> Why not just remove the first initialization?
Aha, it's just because I prefer keeping the first position of
initialization, and also like
the code style of the second. So, there're two changes, but I think
either way should be OK.
Thanks,
Eric
>
> On 2016/3/22 12:56, Eric Ren wrote:
>> In function init_record(), rec->flags is initialized twice. Remove
>> the duplicated code line.
>>
>> Signed-off-by: Eric Ren <zren at suse.com>
>> ---
>> mkfs.ocfs2/mkfs.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
>> index 7abea73..043a5c7 100644
>> --- a/mkfs.ocfs2/mkfs.c
>> +++ b/mkfs.ocfs2/mkfs.c
>> @@ -2797,13 +2797,12 @@ init_record(State *s, SystemFileDiskRecord *rec, int type, int mode)
>> {
>> memset(rec, 0, sizeof(SystemFileDiskRecord));
>>
>> - rec->flags = OCFS2_VALID_FL | OCFS2_SYSTEM_FL;
>> + rec->flags = (OCFS2_VALID_FL | OCFS2_SYSTEM_FL);
>> rec->mode = mode;
>>
>> rec->links = S_ISDIR(mode) ? 0 : 1;
>>
>> rec->bi.used_bits = rec->bi.total_bits = 0;
>> - rec->flags = (OCFS2_VALID_FL | OCFS2_SYSTEM_FL);
>>
>> switch (type) {
>> case SFI_JOURNAL:
>>
>
>
More information about the Ocfs2-tools-devel
mailing list