From owner-dev-commits-src-main@freebsd.org Sun Jan 3 16:51:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 188884D7106; Sun, 3 Jan 2021 16:51:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D84XM0Dy1z3Pl6; Sun, 3 Jan 2021 16:51:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEFF02F8A; Sun, 3 Jan 2021 16:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 103GpE8Y002961; Sun, 3 Jan 2021 16:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 103GpEni002960; Sun, 3 Jan 2021 16:51:14 GMT (envelope-from git) Date: Sun, 3 Jan 2021 16:51:14 GMT Message-Id: <202101031651.103GpEni002960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2ce5eef6e23a - main - cam: Remove Giant handling from cam_sim_alloc() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ce5eef6e23acba92d5dc2056d9be28542802750 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2021 16:51:15 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2ce5eef6e23acba92d5dc2056d9be28542802750 commit 2ce5eef6e23acba92d5dc2056d9be28542802750 Author: Mark Johnston AuthorDate: 2021-01-03 16:34:10 +0000 Commit: Mark Johnston 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. */