From: Charles Manning Date: Fri, 28 Feb 2014 10:52:33 +1300 Subject: [U-Boot] [PATCH v4] socfpga: Add socfpga preloader signing to mkimage In-Reply-To: <20140227212311.250F9381357@gemini.denx.de> References: <1393194939-29786-1-git-send-email-cdhmanning@gmail.com> <20140227212311.250F9381357@gemini.denx.de> Message-ID: <201402281052.33990.manningc2@actrix.gen.nz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 28 February 2014 10:23:11 Wolfgang Denk wrote: > 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. Ok, I will write a small wrapper thing that accesses the bzlib table. That table will now be compiled in if you use either bzlib or the alternative crc32. Does that sound OK? > > > > > > + * 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. That stuff is now gone > > > > > 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. Is bzlib_crc32 Ok? Thank you for your feedback. -- CHarles