From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 28 Mar 2012 01:46:08 +0200 Subject: [U-Boot] BIOS EMULATOR driver In-Reply-To: References: Message-ID: <201203280146.09023.marex@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 Graeme Russ, > Hi Viktor, > > On Wed, Mar 28, 2012 at 9:46 AM, Viktor K?iv?k wrote: > > Dear Timur Tabi, > > > > 2012/3/27 Marek Vasut : > >> Dear Timur Tabi, > >> > >>> Marek Vasut wrote: > >>> > Agreed, but I expected there was some dead code and that was the > >>> > point I was trying to express ;-) > >>> > >>> Well, until you do a thorough analysis, you really have no idea if > >>> there is any dead code at all. > >> > >> I don't ... but Viktor probably does and I believe that's what he wants > >> to ask about. > > > > Yes I do the analysis, actually only one method is used > > (PCI_mapBIOSImage), but there are two other methods related to video > > card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, > > PCI_unmapBIOSImage). Nothing calls they but I think they can be > > preserved too. > > > > But there are a lots of other code which can be removed. For example > > BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or > > BE_getVESABuf() from same file. So my question is: It is safe remove > > dead code or somebody can use it for debugging purposes ? I've got > > same problem with another driver so this is general question. > > What exactly is the problem? > > Wolfgang previously pointed out: > > "Did you check if you really find any such code in your linked image? > As I already explained, normally -ffunction-sections / -fdata-sections > with --gc-sections should make sure any unused functions get dropped > automatically." > > If these linker options successfully remove all of the dead code, then > there should be no urgency in removing it. However, if you are > experiencing compile errors due to unused functions, then yes, removing > the dead code should be investigated. But if you plan to remove any > code, make sure that there are no other boards which may potentially use > the code you plan to remove Greame, it's the UDM plight ... killing all dead code really helps streamlining the API. > > Regards, > > Graeme Best regards, Marek Vasut