j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Sun Oct 3 21:18:23 2010 New Revision: 883 URL: http://tracker.coreboot.org/trac/openbios/changeset/883
Log: sparc32: fix warnings from GCC 4.6.0
Compiling Sparc32 with GCC 4.6.0 20100925 produced a few warnings: ../arch/sparc32/context.c: In function 'start_main': ../arch/sparc32/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable] ../arch/sparc32/romvec.c: In function 'obp_devwrite': ../arch/sparc32/romvec.c:326:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable] ../drivers/iommu.c: In function 'iommu_init': ../drivers/iommu.c:102:24: error: variable 'vers' set but not used [-Werror=unused-but-set-variable] ../drivers/iommu.c:102:18: error: variable 'impl' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/arch/sparc32/context.c trunk/openbios-devel/arch/sparc32/romvec.c trunk/openbios-devel/drivers/iommu.c
Modified: trunk/openbios-devel/arch/sparc32/context.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/context.c Sun Oct 3 18:37:47 2010 (r882) +++ trunk/openbios-devel/arch/sparc32/context.c Sun Oct 3 21:18:23 2010 (r883) @@ -46,17 +46,12 @@ */ static void start_main(void) { - int retval; - /* Save startup context, so we can refer to it later. * We have to keep it in physical address since we will relocate. */ __boot_ctx = virt_to_phys(__context);
/* Start the real fun */ - retval = openbios(); - - /* Pass return value to startup context. Bootloader may see it. */ - //boot_ctx->eax = retval; + openbios();
/* Returning from here should jump to __exit_context */ __context = boot_ctx;
Modified: trunk/openbios-devel/arch/sparc32/romvec.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/romvec.c Sun Oct 3 18:37:47 2010 (r882) +++ trunk/openbios-devel/arch/sparc32/romvec.c Sun Oct 3 21:18:23 2010 (r883) @@ -323,16 +323,21 @@
static int obp_devwrite(int dev_desc, char *buf, int nbytes) { +#ifdef CONFIG_DEBUG_OBP_DEVWRITE /* disabled, makes too much noise */ int ret; +#endif
PUSH((int)buf); PUSH(nbytes); push_str("write"); PUSH(dev_desc); fword("$call-method"); +#ifdef CONFIG_DEBUG_OBP_DEVWRITE ret = POP(); - - //DPRINTF("obp_devwrite(fd 0x%x, buf %s, nbytes %d) = %d\n", dev_desc, buf, nbytes, ret); + DPRINTF("obp_devwrite(fd 0x%x, buf %s, nbytes %d) = %d\n", dev_desc, buf, nbytes, ret); +#else + POP(); +#endif
return nbytes; }
Modified: trunk/openbios-devel/drivers/iommu.c ============================================================================== --- trunk/openbios-devel/drivers/iommu.c Sun Oct 3 18:37:47 2010 (r882) +++ trunk/openbios-devel/drivers/iommu.c Sun Oct 3 21:18:23 2010 (r883) @@ -99,7 +99,9 @@ { unsigned int *ptab; int ptsize; +#ifdef CONFIG_DEBUG_IOMMU unsigned int impl, vers; +#endif unsigned int tmp; struct iommu_regs *regs; int ret; @@ -111,8 +113,10 @@ for (;;) { } } t->regs = regs; +#ifdef CONFIG_DEBUG_IOMMU impl = (regs->control & IOMMU_CTRL_IMPL) >> 28; vers = (regs->control & IOMMU_CTRL_VERS) >> 24; +#endif
tmp = regs->control; tmp &= ~(IOMMU_CTRL_RNGE);