From nobody Fri May 20 00:20:56 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8F2FF1B4026C; Fri, 20 May 2022 00:20:56 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L46p02wMmz3ky0; Fri, 20 May 2022 00:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653006056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vsGUIztFBTg0EfU9CVkm6etKtMX+rxqvnq5+ruxFe58=; b=ALqMuNikU1Zjj41jAvmvtcYh6aYfRn+fWejkJ1t4HcndTJdM/BfxEaNru9RXvdxB12h+tN 60RuYzKAxdayorhF7LRiXkG3brJUHgoCW6C9Ur25iDZR78HpdvJoa+u4oORZDrx8XZly9J YqoOQBGHSOyufzWjqEkGeUsw5O6kp0PhbB+QGi3+/1W6VrUgBs6Xw+YINWDdlurp8dKThk io4J+SJ0B+80EIUC2B9h9NsN+ZcUDHliDOxIaCMH5d4x5a5C6mupcelFes0z4HkCoEHDur retCUSIFgdluR1f++g8Ttd1OkHkE1TvoeUdqo0gPzVujvbxW+ZKTvqWMwTLrRw== 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 3490027C8D; Fri, 20 May 2022 00:20:56 +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 24K0Kukp071755; Fri, 20 May 2022 00:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24K0Kuid071754; Fri, 20 May 2022 00:20:56 GMT (envelope-from git) Date: Fri, 20 May 2022 00:20:56 GMT Message-Id: <202205200020.24K0Kuid071754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: da567228b6c0 - stable/13 - arcmsr: Store softc pointer in si_drv1 of cdev. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da567228b6c0f4f03844705a6be616c2bd04b26e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653006056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vsGUIztFBTg0EfU9CVkm6etKtMX+rxqvnq5+ruxFe58=; b=itsdO8vp+Gvi/NfxxgIjBVFRLZBo7Dh1nVrsa6yRwqzELLO5+hyuKMePj7gxcvw7GY7378 piVkRz4nwmDBKw1/6dSwyP5kp+8h8pMPysxH+i79/Hbxi1N98pVlyi+yNNvVRAPq5KGI5D 0rWdbXERa8P/Y28VvkKqeytnbQ2Wwj4mqgXPOX5ENfE+LZYGmtSVr1Hbz/fnJCOeeqRKP5 NkWgaUrefLXOaAsG5sFO7elEmcTAXhEJ4PUafmABAjNKNyRdXN6zRjQrkoiYDp1P/RGuOb ONKWHn1i0NBec0zL9iqfiCoIlkUcwNAbTNkM1/TpAOQSyceEuuJYPsKQO79h/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653006056; a=rsa-sha256; cv=none; b=CUyl8PKmjpA70GZPVKpPUVfkwnX3pM6hiqvoc3htxans2OsbQ2WziQcijCDA79mO4Kf1sa jJGfEF6DN+EytA77356WsLSRwEHBge7pHHvNAQsYjKQ4xpKa2DEpDVcduM9S31SGppel6A rFv+eQpJID+TWX8j7z6hETzWaAp5pA9BcWznnUrZQs6fsjDrZR8w3jiJE9ZP0ObhtxmxmF ng0wIvWeYkPHNtZ7Q6W85krGJgM7GvxCOJGMLZjkCrRzziVE8OZidfaj4ITcrkP/1YHWER J3Ov8cea3S7aUH5WrhAzVZI/LDqrzH66nfhVckcq5tKcFAYkPajnGE3Nnc2/Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=da567228b6c0f4f03844705a6be616c2bd04b26e commit da567228b6c0f4f03844705a6be616c2bd04b26e Author: John Baldwin AuthorDate: 2022-04-21 17:29:14 +0000 Commit: John Baldwin CommitDate: 2022-05-19 21:32:50 +0000 arcmsr: Store softc pointer in si_drv1 of cdev. Rather than fetching the softc using the controller's unit number as an index into the devclass. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D35004 (cherry picked from commit a9e5e04e6468e7ad9d17a8fe73b2bc7091894934) --- sys/dev/arcmsr/arcmsr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index f91877f92e02..f64093a94e7f 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -240,8 +240,7 @@ static struct cdevsw arcmsr_cdevsw={ */ static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) { - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + struct AdapterControlBlock *acb = dev->si_drv1; if (acb == NULL) { return ENXIO; @@ -254,8 +253,7 @@ static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc */ static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) { - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + struct AdapterControlBlock *acb = dev->si_drv1; if (acb == NULL) { return ENXIO; @@ -268,8 +266,7 @@ static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *pro */ static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) { - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + struct AdapterControlBlock *acb = dev->si_drv1; if (acb == NULL) { return ENXIO; @@ -4932,6 +4929,7 @@ irq_alloc_failed: */ static int arcmsr_attach(device_t dev) { + struct make_dev_args args; struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev); u_int32_t unit=device_get_unit(dev); struct ccb_setasync csa; @@ -5000,7 +4998,13 @@ irqx: xpt_action((union ccb *)&csa); ARCMSR_LOCK_RELEASE(&acb->isr_lock); /* Create the control device. */ - acb->ioctl_dev = make_dev(&arcmsr_cdevsw, unit, UID_ROOT, GID_WHEEL /* GID_OPERATOR */, S_IRUSR | S_IWUSR, "arcmsr%d", unit); + make_dev_args_init(&args); + args.mda_devsw = &arcmsr_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_WHEEL /* GID_OPERATOR */; + args.mda_mode = S_IRUSR | S_IWUSR; + args.mda_si_drv1 = acb; + (void)make_dev_s(&args, &acb->ioctl_dev, "arcmsr%d", unit); (void)make_dev_alias(acb->ioctl_dev, "arc%d", unit); arcmsr_callout_init(&acb->devmap_callout);