The branch main has been updated by avg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8b37048bc5482ffe46404dbe6311f0530d2c150b

commit 8b37048bc5482ffe46404dbe6311f0530d2c150b
Author:     Andriy Gapon <a...@freebsd.org>
AuthorDate: 2021-12-13 11:51:47 +0000
Commit:     Andriy Gapon <a...@freebsd.org>
CommitDate: 2021-12-13 11:51:47 +0000

    Revert "mmc_sim: fix setting of the mutex name"
    
    This reverts commit df472af034e7726dea533ac7f44440dad4ba6a34.
    
    The change hasn't been reviewed.
---
 sys/cam/mmc/mmc_sim.c | 9 ++++++---
 sys/cam/mmc/mmc_sim.h | 1 -
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c
index 792551a93511..45d706f61d0a 100644
--- a/sys/cam/mmc/mmc_sim.c
+++ b/sys/cam/mmc/mmc_sim.c
@@ -191,6 +191,7 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb 
*ccb)
 int
 mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim)
 {
+       char sim_name[64], mtx_name[64];
 
        mmc_sim->dev = dev;
 
@@ -198,11 +199,13 @@ mmc_cam_sim_alloc(device_t dev, const char *name, struct 
mmc_sim *mmc_sim)
                goto fail;
        }
 
-       snprintf(mmc_sim->name, sizeof(mmc_sim->name), "%s_sim", name);
-       mtx_init(&mmc_sim->mtx, mmc_sim->name, NULL, MTX_DEF);
+       snprintf(sim_name, sizeof(sim_name), "%s_sim", name);
+       snprintf(mtx_name, sizeof(mtx_name), "%s_mtx", name);
+
+       mtx_init(&mmc_sim->mtx, sim_name, NULL, MTX_DEF);
        mmc_sim->sim = cam_sim_alloc(mmc_cam_sim_default_action,
            mmc_cam_default_poll,
-           mmc_sim->name, mmc_sim, device_get_unit(dev),
+           name, mmc_sim, device_get_unit(dev),
            &mmc_sim->mtx, 1, 1, mmc_sim->devq);
 
        if (mmc_sim->sim == NULL) {
diff --git a/sys/cam/mmc/mmc_sim.h b/sys/cam/mmc/mmc_sim.h
index 10bd183c307d..2b1159a9758e 100644
--- a/sys/cam/mmc/mmc_sim.h
+++ b/sys/cam/mmc/mmc_sim.h
@@ -33,7 +33,6 @@
 struct mmc_sim {
        struct mmc_cam_sim_softc        *sc;
        struct mtx                      mtx;
-       char                            name[64];
        struct cam_devq                 *devq;
        struct cam_sim                  *sim;
        device_t                        dev;

Reply via email to