Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libnvmm Remove useless calls to nvmm_init().



details:   https://anonhg.NetBSD.org/src/rev/4383d3654995
branches:  trunk
changeset: 450915:4383d3654995
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Apr 29 17:27:57 2019 +0000

description:
Remove useless calls to nvmm_init().

diffstat:

 lib/libnvmm/libnvmm.c |  50 +-------------------------------------------------
 1 files changed, 1 insertions(+), 49 deletions(-)

diffs (141 lines):

diff -r 0db7ac313231 -r 4383d3654995 lib/libnvmm/libnvmm.c
--- a/lib/libnvmm/libnvmm.c     Mon Apr 29 16:39:58 2019 +0000
+++ b/lib/libnvmm/libnvmm.c     Mon Apr 29 17:27:57 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libnvmm.c,v 1.10 2019/04/28 14:22:13 maxv Exp $        */
+/*     $NetBSD: libnvmm.c,v 1.11 2019/04/29 17:27:57 maxv Exp $        */
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -237,10 +237,6 @@
        struct nvmm_ioc_machine_destroy args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
 
        ret = ioctl(nvmm_fd, NVMM_IOC_MACHINE_DESTROY, &args);
@@ -259,10 +255,6 @@
        struct nvmm_ioc_machine_configure args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.op = op;
        args.conf = conf;
@@ -281,10 +273,6 @@
        struct nvmm_comm_page *comm;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.cpuid = cpuid;
 
@@ -309,10 +297,6 @@
        struct nvmm_comm_page *comm;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.cpuid = cpuid;
 
@@ -332,10 +316,6 @@
 {
        struct nvmm_comm_page *comm;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        if (__predict_false(cpuid >= mach->npages)) {
                return -1;
        }
@@ -356,10 +336,6 @@
        struct nvmm_comm_page *comm;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        if (__predict_false(cpuid >= mach->npages)) {
                return -1;
        }
@@ -389,10 +365,6 @@
        struct nvmm_ioc_vcpu_inject args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.cpuid = cpuid;
        memcpy(&args.event, event, sizeof(args.event));
@@ -411,10 +383,6 @@
        struct nvmm_ioc_vcpu_run args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.cpuid = cpuid;
        memset(&args.exit, 0, sizeof(args.exit));
@@ -435,10 +403,6 @@
        struct nvmm_ioc_gpa_map args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        ret = __area_add(mach, hva, gpa, size, prot);
        if (ret == -1)
                return -1;
@@ -465,10 +429,6 @@
        struct nvmm_ioc_gpa_unmap args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        ret = __area_delete(mach, hva, gpa, size);
        if (ret == -1)
                return -1;
@@ -492,10 +452,6 @@
        struct nvmm_ioc_hva_map args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.hva = hva;
        args.size = size;
@@ -513,10 +469,6 @@
        struct nvmm_ioc_hva_unmap args;
        int ret;
 
-       if (nvmm_init() == -1) {
-               return -1;
-       }
-
        args.machid = mach->machid;
        args.hva = hva;
        args.size = size;



Home | Main Index | Thread Index | Old Index