From nobody Tue Jul 11 19:35:01 2023 X-Original-To: dev-commits-src-all@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 4R0rgB1bfFz4dbXV; Tue, 11 Jul 2023 19:35:02 +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 4R0rgB1Bztz3LFK; Tue, 11 Jul 2023 19:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689104102; 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=yeZiEVH5JdqKJQc2f6gaERjPWmKlWf8DAsS3pZxc6Nk=; b=WoqBm4N88VAkcJRo3GBLAImvHcox8MIo9apgjcqVBFpV+TsKmpYUwvoijHVlQdQTJfG3D0 NAbAC1GgTx/6kSbUKVKIIp3iIY5+MkLBZDbC6CnlMkoN7zf5uuOmrSaLxoesikO3Z3cZpI 2hxd9kQvKfCxvc/Rt9P1Zk5lwBzvugClAJFkBOMlPLSKQyKOzS4Fgs4D8VX/6VBtRhAwiS UBgUmUiuNRFrrgw9QqyEgLflUevXhkVGhJZHcU2OACSFcnJsIRrBff5QErmVgasPa1k+Eu 1gdw+tHOsRzciRTvkvOyrRMMLZeINEPJMB3cXASYcmvWt9w8qrhlioy3tv44zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689104102; 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=yeZiEVH5JdqKJQc2f6gaERjPWmKlWf8DAsS3pZxc6Nk=; b=AsFWb34DKLKvznMhofx/XMnlkm34uhFqRztNaVmkddDTe2aWCcwiIWYNGWP4tkjSUxnWJK bgZPoLp1AhyeWq381WcPBMaf7CyQB+7YePobQR2WFkHNh5GJUSAQh4x6ACXe6tofEn2fGs NgvMXiLpAGi1KdrncApFfxdFpUCe0ds7T7T0bNPjLPUmhLV2xIBlswn/fdrmCtHTCu39WZ 5QE66yCA0VfCfwlyGAfuKgUr4ToYfDTZc1oUwCr5gWz+VEz6hQWlvo/q0cpNzO89TATfez iakYy+dRyt+RI/m0HYzCT6MclHm+cAYwCUoKa8nLEYdjjG4wuXhN0Mf02885+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689104102; a=rsa-sha256; cv=none; b=AXBgWw7+UA1lyrEf+8pm+G9zgvqKhh/6zsOj0XFR+RMNMvgH3+CER5vrlf+kXzZEII8A3T cWWxXrMTkXnnX5IRZJdPtt/oSJX8NjYdIGyLxRotFVItq8DzXYw6nl6hWFhHA8t1sauyCg 7fCzQT5tQ3M0tLeAewbHuySS39cSm98KUnExwmt/CzAH9l/cQFoC1LricTJTNs00R+GtTV xqBhCHRR5FwTehQr/thpqq8hWpK7fDqnEaJmvdnoxp3RwXPNOGDaR29crbpTJY3X3K61rW gYWHPctN+1FgftRN6pH0jyNNPdBMQ8vqxK92oYCaI3mpeq6eghCYB46xMMwZAw== 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 4R0rgB0DNBzdyw; Tue, 11 Jul 2023 19:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36BJZ1MP054479; Tue, 11 Jul 2023 19:35:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36BJZ11X054478; Tue, 11 Jul 2023 19:35:01 GMT (envelope-from git) Date: Tue, 11 Jul 2023 19:35:01 GMT Message-Id: <202307111935.36BJZ11X054478@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: 0dea4f064dfc - main - bhyve: Deduplicate some code in modify_bar_registration() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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: 0dea4f064dfcd0725d02b9b2d02b2494ca866857 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0dea4f064dfcd0725d02b9b2d02b2494ca866857 commit 0dea4f064dfcd0725d02b9b2d02b2494ca866857 Author: Mark Johnston AuthorDate: 2023-07-11 19:22:37 +0000 Commit: Mark Johnston CommitDate: 2023-07-11 19:22:37 +0000 bhyve: Deduplicate some code in modify_bar_registration() No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40877 --- usr.sbin/bhyve/pci_emul.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index f921abc356ec..cf6e1810aaad 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -615,9 +615,6 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) error = register_inout(&iop); } else error = unregister_inout(&iop); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_MEM32: case PCIBAR_MEM64: @@ -633,21 +630,18 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) error = register_mem(&mr); } else error = unregister_mem(&mr); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_ROM: error = 0; - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; default: error = EINVAL; break; } assert(error == 0); + + if (pe->pe_baraddr != NULL) + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); } static void