git: 2ce5eef6e23a - main - cam: Remove Giant handling from cam_sim_alloc()
Mark Johnston
markj at FreeBSD.org
Sun Jan 3 16:51:15 UTC 2021
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=2ce5eef6e23acba92d5dc2056d9be28542802750
commit 2ce5eef6e23acba92d5dc2056d9be28542802750
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-01-03 16:34:10 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-01-03 16:50:31 +0000
cam: Remove Giant handling from cam_sim_alloc()
There are no non-MPSAFE SIM drivers left in the tree, verified with
coccinelle.
Reviewed by: scottl, imp
Differential Revision: https://reviews.freebsd.org/D27853
---
sys/cam/cam_sim.c | 12 ++----------
sys/cam/cam_sim.h | 1 -
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/sys/cam/cam_sim.c b/sys/cam/cam_sim.c
index 58600798bae6..e82332b999c3 100644
--- a/sys/cam/cam_sim.c
+++ b/sys/cam/cam_sim.c
@@ -72,9 +72,7 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll,
{
struct cam_sim *sim;
- sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
- M_CAMSIM, M_ZERO | M_NOWAIT);
-
+ sim = malloc(sizeof(struct cam_sim), M_CAMSIM, M_ZERO | M_NOWAIT);
if (sim == NULL)
return (NULL);
@@ -92,13 +90,7 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll,
sim->refcount = 1;
sim->devq = queue;
sim->mtx = mtx;
- if (mtx == &Giant) {
- sim->flags |= 0;
- callout_init(&sim->callout, 0);
- } else {
- sim->flags |= CAM_SIM_MPSAFE;
- callout_init(&sim->callout, 1);
- }
+ callout_init(&sim->callout, 1);
return (sim);
}
diff --git a/sys/cam/cam_sim.h b/sys/cam/cam_sim.h
index 557d3d23cb57..589d2bd1f16d 100644
--- a/sys/cam/cam_sim.h
+++ b/sys/cam/cam_sim.h
@@ -103,7 +103,6 @@ struct cam_sim {
int max_dev_openings;
u_int32_t flags;
#define CAM_SIM_REL_TIMEOUT_PENDING 0x01
-#define CAM_SIM_MPSAFE 0x02
struct callout callout;
struct cam_devq *devq; /* Device Queue to use for this SIM */
int refcount; /* References to the SIM. */
More information about the dev-commits-src-all
mailing list