git: 1db163b82565 - main - bhnd: Fix some -Wunused-but-set-variable warnings

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 28 Feb 2022 16:11:00 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=1db163b82565302edebcfde9aee3a77586bccb1f

commit 1db163b82565302edebcfde9aee3a77586bccb1f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-02-28 15:54:25 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-02-28 15:54:25 +0000

    bhnd: Fix some -Wunused-but-set-variable warnings
    
    MFC after:      1 week
---
 sys/dev/bhnd/bcma/bcma.c                  | 3 ---
 sys/dev/bhnd/bhndb/bhndb.c                | 6 ------
 sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c | 3 ---
 sys/dev/bhnd/cores/chipc/chipc.c          | 3 ---
 sys/dev/bhnd/siba/siba.c                  | 3 ---
 5 files changed, 18 deletions(-)

diff --git a/sys/dev/bhnd/bcma/bcma.c b/sys/dev/bhnd/bcma/bcma.c
index 7b2bc2d59e0f..5ae6db1fbca6 100644
--- a/sys/dev/bhnd/bcma/bcma.c
+++ b/sys/dev/bhnd/bcma/bcma.c
@@ -120,11 +120,8 @@ bcma_add_child(device_t dev, u_int order, const char *name, int unit)
 static void
 bcma_child_deleted(device_t dev, device_t child)
 {
-	struct bhnd_softc	*sc;
 	struct bcma_devinfo	*dinfo;
 
-	sc = device_get_softc(dev);
-
 	/* Call required bhnd(4) implementation */
 	bhnd_generic_child_deleted(dev, child);
 
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
index 9a2beb50e9bb..323972f5585c 100644
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -146,12 +146,9 @@ bhndb_probe_nomatch(device_t dev, device_t child)
 static int
 bhndb_print_child(device_t dev, device_t child)
 {
-	struct bhndb_softc	*sc;
 	struct resource_list	*rl;
 	int			 retval = 0;
 
-	sc = device_get_softc(dev);
-
 	retval += bus_print_child_header(dev, child);
 
 	rl = BUS_GET_RESOURCE_LIST(dev, child);
@@ -1894,12 +1891,9 @@ bhndb_bus_barrier(device_t dev, device_t child, struct bhnd_resource *r,
 static int
 bhndb_bhnd_map_intr(device_t dev, device_t child, u_int intr, rman_res_t *irq)
 {
-	struct bhndb_softc	*sc;
 	u_int			 ivec;
 	int			 error;
 
-	sc = device_get_softc(dev);
-
 	/* Is the intr valid? */
 	if (intr >= bhnd_get_intr_count(child))
 		return (EINVAL);
diff --git a/sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c b/sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c
index 14ee0385cf5e..d04702c10f97 100644
--- a/sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c
+++ b/sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c
@@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
 static int
 bhnd_pmu_chipc_probe(device_t dev)
 {
-	struct bhnd_pmu_softc	*sc;
 	struct chipc_caps	*ccaps;
 	struct chipc_softc	*chipc_sc;
 	device_t		 chipc;
@@ -70,8 +69,6 @@ bhnd_pmu_chipc_probe(device_t dev)
 	uint32_t		 pcaps;
 	uint8_t			 rev;
 
-	sc = device_get_softc(dev);
-
 	/* Look for chipc parent */
 	chipc = device_get_parent(dev);
 	if (device_get_devclass(chipc) != devclass_find("bhnd_chipc"))
diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c
index 72d92ba682bc..7f74edf6b3fe 100644
--- a/sys/dev/bhnd/cores/chipc/chipc.c
+++ b/sys/dev/bhnd/cores/chipc/chipc.c
@@ -599,12 +599,9 @@ chipc_print_child(device_t dev, device_t child)
 static device_t
 chipc_add_child(device_t dev, u_int order, const char *name, int unit)
 {
-	struct chipc_softc	*sc;
 	struct chipc_devinfo	*dinfo;
 	device_t		 child;
 
-	sc = device_get_softc(dev);
-
 	child = device_add_child_ordered(dev, order, name, unit);
 	if (child == NULL)
 		return (NULL);
diff --git a/sys/dev/bhnd/siba/siba.c b/sys/dev/bhnd/siba/siba.c
index 6794412ef760..994f4327b752 100644
--- a/sys/dev/bhnd/siba/siba.c
+++ b/sys/dev/bhnd/siba/siba.c
@@ -1260,11 +1260,8 @@ siba_add_child(device_t dev, u_int order, const char *name, int unit)
 static void
 siba_child_deleted(device_t dev, device_t child)
 {
-	struct bhnd_softc	*sc;
 	struct siba_devinfo	*dinfo;
 
-	sc = device_get_softc(dev);
-
 	/* Call required bhnd(4) implementation */
 	bhnd_generic_child_deleted(dev, child);