From: Wolfgang Denk Date: Fri, 22 Nov 2013 22:13:30 +0100 Subject: [U-Boot] fatls shows duplicated entries with long and short names In-Reply-To: <20131122205046.GU420@bill-the-cat> References: <525C1514.5030307@digi.com> <20131014160737.GE5843@oliver-linux> <525CEBE0.5080307@digi.com> <20131015092631.5ca2d3bd@lilith> <1385148689885-168231.post@n7.nabble.com> <20131122205046.GU420@bill-the-cat> Message-ID: <20131122211330.CA0F2380ADF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Tom, In message <20131122205046.GU420@bill-the-cat> you wrote: > > So, the last report said that they had a tree missing > 6ad77d88e57f6ab815ec7e85c5ac329054318c73, but yours can't be. Can you > add some debug prints and see what's going on? Having > u8 foo = bar(); > if (a && foo == baz) { ... } > not work, but: > if (a && bar() == baz) { ... } > work is quite puzzling. Thanks! The actual code is this: if (dols && mkcksum(dentptr->name) == prevcksum) { versus __u8 csum = mkcksum(dentptr->name, dentptr->ext); if (dols && csum == prevcksum) { Note that csum is __u8, but prevcksum is __u16. Eventually there is a type issue. It looks a bit fishy to me that prevcksum 16 bits, while all operations are done on 8 bit data, and comparison is against 8 bit as well. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "An open mind has but one disadvantage: it collects dirt." - a saying at RPI