[coreboot-gerrit] New patch to review for coreboot: 76f9530 northbridge/intel/haswell/gma.c: Guard `graphics_base` by `MAINBOARD_DO_NATIVE_INIT`

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Mon Dec 9 00:23:02 CET 2013


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4507

-gerrit

commit 76f95303094de753a3cb6e11f70fccfadd4dd40e
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date:   Sun Dec 8 23:55:35 2013 +0100

    northbridge/intel/haswell/gma.c: Guard `graphics_base` by `MAINBOARD_DO_NATIVE_INIT`
    
    Removing `-Wno-unused-but-set-variable` from `CFLAGS` results in the
    following error.
    
    	    CC         northbridge/intel/haswell/gma.ramstage.o
    	src/northbridge/intel/haswell/gma.c: In function 'gma_func0_init':
    	src/northbridge/intel/haswell/gma.c:281:6: error: variable 'graphics_base' set but not used [-Werror=unused-but-set-variable]
    	cc1: all warnings being treated as errors
    
    The variable `graphics_base` is only used when the Kconfig variable
    `MAINBOARD_DO_NATIVE_INIT` is selected, so guard its declaration and
    assignment with preprocessor macros.
    
    Change-Id: Id667d9a747a0931bebe951861bc96e1043715848
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 src/northbridge/intel/haswell/gma.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
index 653cbdc..65b8590 100644
--- a/src/northbridge/intel/haswell/gma.c
+++ b/src/northbridge/intel/haswell/gma.c
@@ -278,18 +278,21 @@ static void gma_func0_init(struct device *dev)
 {
 	int lightup_ok = 0;
 	u32 reg32;
+#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
 	u32 graphics_base; //, graphics_size;
+#endif
 	/* IGD needs to be Bus Master */
 	reg32 = pci_read_config32(dev, PCI_COMMAND);
 	reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
 	pci_write_config32(dev, PCI_COMMAND, reg32);
 
-
+#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
 	/* the BAR for graphics space is a well known number for
 	 * sandy and ivy. And the resource code renumbers it.
 	 * So it's almost like having two hardcodes.
 	 */
 	graphics_base = dev->resource_list[1].base;
+#endif
 
 	/* Init graphics power management */
 	gma_pm_init_pre_vbios(dev);



More information about the coreboot-gerrit mailing list