git: 4b9b6a501a76 - main - arm/arm64 nvidia: Remove unused variables.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Sat, 09 Apr 2022 01:31:47 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=4b9b6a501a76d93c085223a8bc86073d202cc1bb

commit 4b9b6a501a76d93c085223a8bc86073d202cc1bb
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-09 01:31:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-09 01:31:29 +0000

    arm/arm64 nvidia: Remove unused variables.
---
 sys/arm/nvidia/as3722.c                         | 8 +-------
 sys/arm/nvidia/as3722_gpio.c                    | 2 --
 sys/arm/nvidia/tegra124/tegra124_clk_pll.c      | 7 +------
 sys/arm/nvidia/tegra124/tegra124_coretemp.c     | 3 ---
 sys/arm/nvidia/tegra124/tegra124_cpufreq.c      | 3 +--
 sys/arm/nvidia/tegra_efuse.c                    | 7 -------
 sys/arm/nvidia/tegra_ehci.c                     | 2 --
 sys/arm/nvidia/tegra_i2c.c                      | 3 +--
 sys/arm/nvidia/tegra_pcie.c                     | 6 ------
 sys/arm/nvidia/tegra_pinmux.c                   | 3 +--
 sys/arm64/nvidia/tegra210/max77620.c            | 5 +----
 sys/arm64/nvidia/tegra210/tegra210_clk_pll.c    | 3 ---
 sys/arm64/nvidia/tegra210/tegra210_coretemp.c   | 3 ---
 sys/arm64/nvidia/tegra210/tegra210_cpufreq.c    | 3 +--
 sys/arm64/nvidia/tegra210/tegra210_pinmux.c     | 3 +--
 sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c | 2 --
 16 files changed, 8 insertions(+), 55 deletions(-)

diff --git a/sys/arm/nvidia/as3722.c b/sys/arm/nvidia/as3722.c
index 60301c78a2fb..b7de41f815d9 100644
--- a/sys/arm/nvidia/as3722.c
+++ b/sys/arm/nvidia/as3722.c
@@ -261,9 +261,6 @@ as3722_parse_fdt(struct as3722_softc *sc, phandle_t node)
 static void
 as3722_intr(void *arg)
 {
-	struct as3722_softc *sc;
-
-	sc = (struct as3722_softc *)arg;
 	/* XXX Finish temperature alarms. */
 }
 
@@ -285,16 +282,13 @@ static int
 as3722_attach(device_t dev)
 {
 	struct as3722_softc *sc;
-	const char *dname;
-	int dunit, rv, rid;
+	int rv, rid;
 	phandle_t node;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 	sc->bus_addr = iicbus_get_addr(dev);
 	node = ofw_bus_get_node(sc->dev);
-	dname = device_get_name(dev);
-	dunit = device_get_unit(dev);
 	rv = 0;
 	LOCK_INIT(sc);
 
diff --git a/sys/arm/nvidia/as3722_gpio.c b/sys/arm/nvidia/as3722_gpio.c
index 1afdb8a94f8b..b46aef2af795 100644
--- a/sys/arm/nvidia/as3722_gpio.c
+++ b/sys/arm/nvidia/as3722_gpio.c
@@ -381,10 +381,8 @@ as3722_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *out_flags)
 static int
 as3722_gpio_get_mode(struct as3722_softc *sc, uint32_t pin, uint32_t gpio_flags)
 {
-	uint8_t ctrl;
 	int flags;
 
-	ctrl = sc->gpio_pins[pin]->pin_ctrl_reg;
 	flags =  sc->gpio_pins[pin]->pin_cfg_flags;
 
 	/* Tristate mode. */
diff --git a/sys/arm/nvidia/tegra124/tegra124_clk_pll.c b/sys/arm/nvidia/tegra124/tegra124_clk_pll.c
index d6aa55f8efe0..a19c739a02fb 100644
--- a/sys/arm/nvidia/tegra124/tegra124_clk_pll.c
+++ b/sys/arm/nvidia/tegra124/tegra124_clk_pll.c
@@ -560,14 +560,11 @@ plle_enable(struct pll_sc *sc)
 {
 	uint32_t reg;
 	int rv;
-	struct mnp_bits *mnp_bits;
 	uint32_t pll_m = 1;
 	uint32_t pll_n = 200;
 	uint32_t pll_p = 13;
 	uint32_t pll_cml = 13;
 
-	mnp_bits = &sc->mnp_bits;
-
 	/* Disable lock override. */
 	RD4(sc, sc->base_reg, &reg);
 	reg &= ~PLLE_BASE_LOCK_OVERRIDE;
@@ -1030,7 +1027,6 @@ tegra124_pll_recalc(struct clknode *clk, uint64_t *freq)
 	struct pll_sc *sc;
 	uint32_t m, n, p, pr;
 	uint32_t reg, misc_reg;
-	int locked;
 
 	sc = clknode_get_softc(clk);
 
@@ -1042,13 +1038,12 @@ tegra124_pll_recalc(struct clknode *clk, uint64_t *freq)
 		p = reg_to_pdiv(sc, pr);
 	else
 		p = 2 * (pr - 1);
-	locked = is_locked(sc);
 
 	dprintf("%s: %s (0x%08x, 0x%08x) - m: %d, n: %d, p: %d (%d): "
 	    "e: %d, r: %d, o: %d - %s\n", __func__,
 	    clknode_get_name(clk), reg, misc_reg, m, n, p, pr,
 	    (reg >> 30) & 1, (reg >> 29) & 1, (reg >> 28) & 1,
-	    locked ? "locked" : "unlocked");
+	    is_locked(sc) ? "locked" : "unlocked");
 
 	if ((m == 0) || (n == 0) || (p == 0)) {
 		*freq = 0;
diff --git a/sys/arm/nvidia/tegra124/tegra124_coretemp.c b/sys/arm/nvidia/tegra124/tegra124_coretemp.c
index 1ed592cc04ba..a6d9607146c0 100644
--- a/sys/arm/nvidia/tegra124/tegra124_coretemp.c
+++ b/sys/arm/nvidia/tegra124/tegra124_coretemp.c
@@ -245,9 +245,6 @@ tegra124_coretemp_attach(device_t dev)
 static int
 tegra124_coretemp_detach(device_t dev)
 {
-	struct tegra124_coretemp_softc *sc;
-
-	sc = device_get_softc(dev);
 	return (0);
 }
 
diff --git a/sys/arm/nvidia/tegra124/tegra124_cpufreq.c b/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
index 629d8a7b8cfb..fe14f62c3c40 100644
--- a/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
+++ b/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
@@ -293,7 +293,7 @@ static int
 tegra124_cpufreq_settings(device_t dev, struct cf_setting *sets, int *count)
 {
 	struct tegra124_cpufreq_softc *sc;
-	int i, j, max_cnt;
+	int i, j;
 
 	if (sets == NULL || count == NULL)
 		return (EINVAL);
@@ -301,7 +301,6 @@ tegra124_cpufreq_settings(device_t dev, struct cf_setting *sets, int *count)
 	sc = device_get_softc(dev);
 	memset(sets, CPUFREQ_VAL_UNKNOWN, sizeof(*sets) * (*count));
 
-	max_cnt = min(sc->nspeed_points, *count);
 	for (i = 0, j = sc->nspeed_points - 1; j >= 0; j--) {
 		if (sc->cpu_max_freq < sc->speed_points[j].freq)
 			continue;
diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c
index e18fd9c3a274..226f694fe8b2 100644
--- a/sys/arm/nvidia/tegra_efuse.c
+++ b/sys/arm/nvidia/tegra_efuse.c
@@ -334,7 +334,6 @@ tegra210_init(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku)
 {
 	int i, threshold, speedo_rev;
 	uint32_t cpu_speedo[3], soc_speedo[3];
-	uint32_t cpu_iddq, soc_iddq, gpu_iddq;
 
 	cpu_speedo[0] = RD4(sc, TEGRA210_FUSE_CPU_SPEEDO_0);
 	cpu_speedo[1] = RD4(sc, TEGRA210_FUSE_CPU_SPEEDO_1);
@@ -348,10 +347,6 @@ tegra210_init(struct tegra_efuse_softc *sc, struct tegra_sku_info *sku)
 	sku->soc_iddq_value = RD4(sc, TEGRA210_FUSE_SOC_IDDQ);
 	sku->gpu_iddq_value = RD4(sc, TEGRA210_FUSE_GPU_IDDQ);
 
-	cpu_iddq = RD4(sc, TEGRA210_FUSE_CPU_IDDQ) * 4;
-	soc_iddq = RD4(sc, TEGRA210_FUSE_SOC_IDDQ) * 4;
-	gpu_iddq = RD4(sc, TEGRA210_FUSE_GPU_IDDQ) * 5;
-
 	speedo_rev = tegra210_get_speedo_revision(sc);
 device_printf(sc->dev, " Speedo revision: %u\n", speedo_rev);
 
@@ -444,12 +439,10 @@ static int
 tegra_efuse_attach(device_t dev)
 {
 	int rv, rid;
-	phandle_t node;
 	struct tegra_efuse_softc *sc;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
-	node = ofw_bus_get_node(dev);
 	sc->soc = (struct efuse_soc *)ofw_bus_search_compatible(dev,
 	    compat_data)->ocd_data;
 
diff --git a/sys/arm/nvidia/tegra_ehci.c b/sys/arm/nvidia/tegra_ehci.c
index 058cbe7c5fb9..d3c97c117842 100644
--- a/sys/arm/nvidia/tegra_ehci.c
+++ b/sys/arm/nvidia/tegra_ehci.c
@@ -150,11 +150,9 @@ tegra_ehci_attach(device_t dev)
 	ehci_softc_t *esc;
 	int rv, rid;
 	uint64_t freq;
-	phandle_t node;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
-	node = ofw_bus_get_node(dev);
 	esc = &sc->ehci_softc;
 
 	/* Allocate resources. */
diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c
index 02db5218b883..359b51e2609b 100644
--- a/sys/arm/nvidia/tegra_i2c.c
+++ b/sys/arm/nvidia/tegra_i2c.c
@@ -742,7 +742,6 @@ static int
 tegra_i2c_detach(device_t dev)
 {
 	struct tegra_i2c_softc *sc;
-	int rv;
 
 	sc = device_get_softc(dev);
 	tegra_i2c_hw_init(sc);
@@ -755,7 +754,7 @@ tegra_i2c_detach(device_t dev)
 
 	LOCK_DESTROY(sc);
 	if (sc->iicbus)
-	    rv = device_delete_child(dev, sc->iicbus);
+		device_delete_child(dev, sc->iicbus);
 	return (bus_generic_detach(dev));
 }
 
diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c
index ec8f361cff7f..707579b9e44f 100644
--- a/sys/arm/nvidia/tegra_pcie.c
+++ b/sys/arm/nvidia/tegra_pcie.c
@@ -710,12 +710,6 @@ static int
 tegra_pcib_msi_setup_intr(device_t dev, struct intr_irqsrc *isrc,
     struct resource *res, struct intr_map_data *data)
 {
-	struct tegra_pcib_softc *sc;
-	struct tegra_pcib_irqsrc *tgi;
-
-	sc = device_get_softc(dev);
-	tgi = (struct tegra_pcib_irqsrc *)isrc;
-
 	if (data == NULL || data->type != INTR_MAP_DATA_MSI)
 		return (ENOTSUP);
 
diff --git a/sys/arm/nvidia/tegra_pinmux.c b/sys/arm/nvidia/tegra_pinmux.c
index 17356233306f..633485ee7b6a 100644
--- a/sys/arm/nvidia/tegra_pinmux.c
+++ b/sys/arm/nvidia/tegra_pinmux.c
@@ -702,7 +702,6 @@ static int pinmux_configure(device_t dev, phandle_t cfgxref)
 {
 	struct pinmux_softc *sc;
 	phandle_t node, cfgnode;
-	int rv;
 
 	sc = device_get_softc(dev);
 	cfgnode = OF_node_from_xref(cfgxref);
@@ -710,7 +709,7 @@ static int pinmux_configure(device_t dev, phandle_t cfgxref)
 	for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) {
 		if (!ofw_bus_node_status_okay(node))
 			continue;
-		rv = pinmux_process_node(sc, node);
+		pinmux_process_node(sc, node);
 	}
 	return (0);
 }
diff --git a/sys/arm64/nvidia/tegra210/max77620.c b/sys/arm64/nvidia/tegra210/max77620.c
index d35948fbfb60..329e8b94322a 100644
--- a/sys/arm64/nvidia/tegra210/max77620.c
+++ b/sys/arm64/nvidia/tegra210/max77620.c
@@ -383,16 +383,13 @@ static int
 max77620_attach(device_t dev)
 {
 	struct max77620_softc *sc;
-	const char *dname;
-	int dunit, rv, rid;
+	int rv, rid;
 	phandle_t node;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 	sc->bus_addr = iicbus_get_addr(dev);
 	node = ofw_bus_get_node(sc->dev);
-	dname = device_get_name(dev);
-	dunit = device_get_unit(dev);
 	rv = 0;
 	LOCK_INIT(sc);
 
diff --git a/sys/arm64/nvidia/tegra210/tegra210_clk_pll.c b/sys/arm64/nvidia/tegra210/tegra210_clk_pll.c
index 64e3f6623d29..1f984fe4fcdd 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_clk_pll.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_clk_pll.c
@@ -753,13 +753,10 @@ plle_enable(struct pll_sc *sc)
 {
 	uint32_t reg;
 	int rv;
-	struct mnp_bits *mnp_bits;
 	uint32_t pll_m = 2;
 	uint32_t pll_n = 125;
 	uint32_t pll_cml = 14;
 
-	mnp_bits = &sc->mnp_bits;
-
 	/* Disable lock override. */
 	RD4(sc, sc->base_reg, &reg);
 	reg &= ~PLLE_BASE_LOCK_OVERRIDE;
diff --git a/sys/arm64/nvidia/tegra210/tegra210_coretemp.c b/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
index 0b637954eceb..6f7323f6d6ce 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_coretemp.c
@@ -249,9 +249,6 @@ tegra210_coretemp_attach(device_t dev)
 static int
 tegra210_coretemp_detach(device_t dev)
 {
-	struct tegra210_coretemp_softc *sc;
-
-	sc = device_get_softc(dev);
 	return (0);
 }
 
diff --git a/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c b/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
index 4519dc3ca9d6..f92fb4edcf96 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_cpufreq.c
@@ -251,7 +251,7 @@ static int
 tegra210_cpufreq_settings(device_t dev, struct cf_setting *sets, int *count)
 {
 	struct tegra210_cpufreq_softc *sc;
-	int i, j, max_cnt;
+	int i, j;
 
 	if (sets == NULL || count == NULL)
 		return (EINVAL);
@@ -259,7 +259,6 @@ tegra210_cpufreq_settings(device_t dev, struct cf_setting *sets, int *count)
 	sc = device_get_softc(dev);
 	memset(sets, CPUFREQ_VAL_UNKNOWN, sizeof(*sets) * (*count));
 
-	max_cnt = min(sc->nspeed_points, *count);
 	for (i = 0, j = sc->nspeed_points - 1; j >= 0; j--) {
 		if (sc->cpu_max_freq < sc->speed_points[j].freq)
 			continue;
diff --git a/sys/arm64/nvidia/tegra210/tegra210_pinmux.c b/sys/arm64/nvidia/tegra210/tegra210_pinmux.c
index 9f4f05368026..d990ce729d39 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_pinmux.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_pinmux.c
@@ -669,7 +669,6 @@ static int pinmux_configure(device_t dev, phandle_t cfgxref)
 {
 	struct pinmux_softc *sc;
 	phandle_t node, cfgnode;
-	int rv;
 
 	sc = device_get_softc(dev);
 	cfgnode = OF_node_from_xref(cfgxref);
@@ -678,7 +677,7 @@ static int pinmux_configure(device_t dev, phandle_t cfgxref)
 	for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) {
 		if (!ofw_bus_node_status_okay(node))
 			continue;
-		rv = pinmux_process_node(sc, node);
+		pinmux_process_node(sc, node);
 	}
 	return (0);
 }
diff --git a/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c b/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
index 4ecbceb98049..92e554b61bb4 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
@@ -1745,7 +1745,6 @@ process_port(struct padctl_softc *sc, phandle_t node)
 {
 
 	struct padctl_port *port;
-	struct padctl_pad *pad;
 	char *name;
 	int rv;
 
@@ -1792,7 +1791,6 @@ process_port(struct padctl_softc *sc, phandle_t node)
 		goto end;
 	}
 
-	pad = port->lane->pad;
 	if (port->type == PADCTL_PORT_USB3) {
 		rv = OF_getencprop(node,  "nvidia,usb2-companion",
 		   &(port->companion), sizeof(port->companion));