Fix dead variable assignment, spotted by clang analyzer

Fix clang warnings:
../kernel/dict.c:289:2: warning: Value stored to 'len' is never read
        len -= sizeof(dictionary_header_t);
../packages/cmdline.c:181:8: warning: Value stored to 'buf' during its
      initialization is never read
        char *buf = ci->buf;
../libopenbios/elf_info.c:126:2: warning: Value stored to 'name' is never read
        name = addr;
../libopenbios/elf_load.c:277:5: warning: Value stored to 'addr' is never read
    addr += pad;
../drivers/ide.c:209:3: warning: Value stored to 'err' is never read
                err = ob_ide_pio_readb(drive, IDEREG_ERROR);
../drivers/ide.c:219:17: warning: Value stored to 'old_cdb' during its initialization is never read
                unsigned char old_cdb = cmd->cdb[0];
../drivers/ide.c:222:4: warning: Value stored to 'old_cdb' is never read
                        old_cdb = cmd->old_cdb;
../drivers/pci.c:103:2: warning: Value stored to 'ss' is never read
        ss = 0;
../drivers/pci.c:100:2: warning: Value stored to 'dev' is never read
        dev = 0;
../drivers/pci.c:212:2: warning: Value stored to 'bus' is never read
        bus = (hi >> 16) & 0xFF;
../drivers/pci.c:953:4: warning: Value stored to 'rev' is never read
                        rev = pci_config_read8(addr, PCI_REVISION_ID);
../packages/video.c:331:2: warning: Value stored to 's' is never read
        s = video.fb.mphys - s;
../packages/video.c:330:2: warning: Value stored to 'size' is never read
        size = ((video.fb.h * video.fb.rb + s) + 0xfff) & ~0xfff;
../fs/hfsplus/btree.c:229:5: warning: Value stored to 'p' is never read
    p = btree_readhead(&bt->head, p);
../fs/hfsplus/volume.c:149:2: warning: Value stored to 'p' is never read
        p = volume_readfork(p, &vh->start_file );

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@751 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2010-04-25 12:53:37 +00:00
parent 747b59656b
commit 183f3f9b00
9 changed files with 21 additions and 19 deletions

View File

@@ -178,7 +178,7 @@ static void /* ( -- ) */
cmdline_prompt( cmdline_info_t *ci )
{
int cur_added=0, histind=0, ch, i, pos=0, n=0, prompt=1;
char *buf = ci->buf;
char *buf;
int terminate = 0;
buf = ci->buf;

View File

@@ -308,7 +308,10 @@ NODE_METHODS( video ) = {
void
init_video( unsigned long fb, int width, int height, int depth, int rb )
{
int i, s, size;
int i;
#ifdef CONFIG_PPC
int s, size;
#endif
phandle_t ph=0;
video.fb.mphys = fb;
@@ -326,11 +329,10 @@ init_video( unsigned long fb, int width, int height, int depth, int rb )
video.has_video = 1;
video.pal = malloc( 256 * sizeof(ulong) );
s = (video.fb.mphys & 0xfff);
size = ((video.fb.h * video.fb.rb + s) + 0xfff) & ~0xfff;
s = video.fb.mphys - s;
#ifdef CONFIG_PPC
s = (video.fb.mphys & 0xfff);
size = ((video.fb.h * video.fb.rb + s) + 0xfff) & ~0xfff;
ofmem_claim_phys( video.fb.mphys, size, 0 );
ofmem_claim_virt( video.fb.mphys, size, 0 );
ofmem_map( video.fb.mphys, video.fb.mphys, size, -1 );