src/(device/lib/soc): Remove unused variables

When building grunt with flags set to detect variables that get a value but
then are unused, there are 5 instances that causes error (unused variable).
In most cases it's enough to simply remove the variable. Other instances,
is better to simply use the variables (one instance it's a return value, on
the other instance using the variables makes code more readable).

BUG=b:120260448
TEST=Build and boot grunt.

Change-Id: I0d00fb6a42db20afb34c76b9445a741a57096ead
Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-on: https://review.coreboot.org/c/29985
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/stoneyridge/lpc.c b/src/soc/amd/stoneyridge/lpc.c
index 317574b..efc948d 100644
--- a/src/soc/amd/stoneyridge/lpc.c
+++ b/src/soc/amd/stoneyridge/lpc.c
@@ -145,6 +145,7 @@
 
 	/* Allocate ACPI NVS in CBMEM */
 	gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS, sizeof(global_nvs_t));
+	printk(BIOS_DEBUG, "ACPI GNVS at %p\n", gnvs);
 }
 
 static void lpc_set_resources(struct device *dev)
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index 749eefe..4a856a9 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -232,9 +232,9 @@
 	/* HEST */
 	current = ALIGN(current, 8);
 	hest = (acpi_hest_t *)current;
-	acpi_write_hest((void *)current, acpi_fill_hest);
+	acpi_write_hest(hest, acpi_fill_hest);
 	acpi_add_table(rsdp, (void *)current);
-	current += ((acpi_header_t *)current)->length;
+	current += hest->header.length;
 
 	/* BERT */
 	if (IS_ENABLED(CONFIG_ACPI_BERT) && bert_errors_present()) {
@@ -250,9 +250,9 @@
 		} else {
 			current = ALIGN(current, 8);
 			bert = (acpi_bert_t *)current;
-			acpi_write_bert((void *)current, (uintptr_t)rgn, size);
+			acpi_write_bert(bert, (uintptr_t)rgn, size);
 			acpi_add_table(rsdp, (void *)current);
-			current += ((acpi_header_t *)current)->length;
+			current += bert->header.length;
 		}
 	}
 
diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c
index fa9e483..5aea825 100644
--- a/src/soc/amd/stoneyridge/southbridge.c
+++ b/src/soc/amd/stoneyridge/southbridge.c
@@ -217,13 +217,10 @@
  */
 int sb_find_wideio_range(uint16_t start, uint16_t size)
 {
-	uint32_t enable_register;
 	int i, index = WIDEIO_RANGE_ERROR;
 	uint16_t end, current_size, start_wideio, end_wideio;
 
 	end = start + size;
-	enable_register = pci_read_config32(SOC_LPC_DEV,
-					   LPC_IO_OR_MEM_DECODE_ENABLE);
 	for (i = 0; i < TOTAL_WIDEIO_PORTS; i++) {
 		current_size = sb_wideio_size(i);
 		if (current_size == 0)