xfs
[Top] [All Lists]

xfsprogs: useless code blocks

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: xfsprogs: useless code blocks
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Mon, 20 Jul 2015 09:57:46 -0400 (EDT)
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <2035333009.511763.1437398166766.JavaMail.zimbra@xxxxxxxxxx>
Thread-index: hATFT9YUEf7oCMUwlcDOJOjXco7Kig==
Thread-topic: xfsprogs: useless code blocks
Hi all,

I found these useless bits of code in xfsprogs:

repair/incore_ino.c:575-576: 
if (ino_rec->ino_startnum == 0)
  ino_rec = ino_rec;

This one is pretty clear. It is there since 2001 (commit 2bd0ea187 
by nathans@xxxxxxx, who didn't wrote here since 2006, so I find 
CC-ing him useless). It looks like a forgotten code which doesn't 
do anything, but I ask in case it is a hidden bug.

And:

db/check.c:3035, 3037: Always true expression, as be32_to_cpu() 
translates to __u32 type and unsigned can't be less than zero.

be32_to_cpu(free->hdr.nvalid) < 0 ||

Is there any reason for these tests? I get different type sizes, or
endians as platform dependent, but signed/unsigned? Or it is
a big/little endian conversion hack?

Cheers,
Jan

-- 
Jan Tulak
jtulak@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>