From: Wolfgang Denk Date: Thu, 27 Feb 2014 22:23:11 +0100 Subject: [U-Boot] [PATCH v4] socfpga: Add socfpga preloader signing to mkimage In-Reply-To: References: <1393194939-29786-1-git-send-email-cdhmanning@gmail.com> <20140224064836.E46F9380355@gemini.denx.de> <201402250818.42323.manningc2@actrix.gen.nz> Message-ID: <20140227212311.250F9381357@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 Charles, sorry, I only send part of the message. Here is the rest. In message you wrote: > > > > Both Gerhard and me asked before: Why exactly do we need another > > > implementation of CRC32. We already have some - why cannot we use > > > these? ... > The actual table values I am using are also found in lib/bzlib_crctable.c So could you use the bzlib implementation for your purposes? > This is, however, not exposed but is a private thing within bzlib. > > The best choice would possibly be to expose this with a new crc function, > but that means dragging bzlib (or parts thereof) into mkimage or at least > putting "hooks" into bzlib that were never intended to be there. > > The alternative is to maybe just add a new alt_crc.c to lib. Code duplication is always bad. Please factor out common code parts. > > > > + * Copyright for the CRC code: > > > > + * > > > > + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or > > > > + * code or tables extracted from it, as desired without restriction. > > > > > > I asked before: Please provide _exact_ reference. See ... Exact reference includes some URL plus version id, etc. > > > I also commented before: If you really need this copied code (i. e. > > > you canot use one of the already existing implementations of CRC32 - > > > which I seriously doubt), then better move this into a separate file, > > > and assign a separate license ID tag for it. > > > > You say "already exiting implementations". I see only one: lib/crc32.c. > > Perhaps I am not looking in the right place? > > > > I shall split this code out and call it alt_crc32 and put it in lib with > > one > > of those proxy files in tools. "alt" is a really bad name - you mentioned yourself that ther eis not only one alternative, so please rather use a descriptive name. 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 Old programmers never die, they just branch to a new address.