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

@@ -196,8 +196,10 @@ ob_ide_400ns_delay(struct ide_drive *drive)
static void
ob_ide_error(struct ide_drive *drive, unsigned char stat, const char *msg)
{
#ifdef CONFIG_DEBUG_IDE
struct ide_channel *chan = drive->channel;
unsigned char err;
#endif
if (!stat)
stat = ob_ide_pio_readb(drive, IDEREG_STATUS);
@@ -206,11 +208,15 @@ ob_ide_error(struct ide_drive *drive, unsigned char stat, const char *msg)
IDE_DPRINTF(" cmd=%x, stat=%x", chan->ata_cmd.command, stat);
if ((stat & (BUSY_STAT | ERR_STAT)) == ERR_STAT) {
err = ob_ide_pio_readb(drive, IDEREG_ERROR);
#ifdef CONFIG_DEBUG_IDE
err =
#endif
ob_ide_pio_readb(drive, IDEREG_ERROR);
IDE_DPRINTF(", err=%x", err);
}
IDE_DPRINTF("\n");
#ifdef CONFIG_DEBUG_IDE
/*
* see if sense is valid and dump that
*/
@@ -237,6 +243,7 @@ ob_ide_error(struct ide_drive *drive, unsigned char stat, const char *msg)
IDE_DPRINTF(", no sense");
IDE_DPRINTF("\n");
}
#endif
}
/*