Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/net/lib/libshmif * remove the unused "opaque" param...



details:   https://anonhg.NetBSD.org/src/rev/7eaf3d0ecd7a
branches:  trunk
changeset: 786427:7eaf3d0ecd7a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Apr 28 10:53:21 2013 +0000

description:
* remove the unused "opaque" parameter
* fix some typos in the previous

diffstat:

 sys/rump/net/lib/libshmif/if_shmem.c      |   8 ++++----
 sys/rump/net/lib/libshmif/rumpcomp_user.c |  24 ++++++++++++------------
 sys/rump/net/lib/libshmif/rumpcomp_user.h |   6 +++---
 3 files changed, 19 insertions(+), 19 deletions(-)

diffs (139 lines):

diff -r c7f8cb718fb4 -r 7eaf3d0ecd7a sys/rump/net/lib/libshmif/if_shmem.c
--- a/sys/rump/net/lib/libshmif/if_shmem.c      Sun Apr 28 10:43:45 2013 +0000
+++ b/sys/rump/net/lib/libshmif/if_shmem.c      Sun Apr 28 10:53:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $      */
+/*     $NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $      */
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -251,7 +251,7 @@
 #endif
        shmif_unlockbus(sc->sc_busmem);
 
-       sc->sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, 0, &error);
+       sc->sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, &error);
        if (sc->sc_kq == -1) {
                rumpuser_unmap(sc->sc_busmem, BUSMEM_SIZE);
                return error;
@@ -669,7 +669,7 @@
                     == sc->sc_nextpacket) {
                        shmif_unlockbus(busmem);
                        error = 0;
-                       rumpcomp_shmif_watchwait(sc->sc_kq, NULL, &error);
+                       rumpcomp_shmif_watchwait(sc->sc_kq, &error);
                        if (__predict_false(error))
                                printf("shmif_rcv: wait failed %d\n", error);
                        membar_consumer();
diff -r c7f8cb718fb4 -r 7eaf3d0ecd7a sys/rump/net/lib/libshmif/rumpcomp_user.c
--- a/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 10:43:45 2013 +0000
+++ b/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 10:53:21 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpcomp_user.c,v 1.1 2013/04/28 10:43:45 pooka Exp $ */
+/*      $NetBSD: rumpcomp_user.c,v 1.2 2013/04/28 10:53:22 pooka Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -42,7 +42,7 @@
  */
 #if defined(__NetBSD__)
 int
-rumpcomp_shmif_watchsetup(int kq, int fd, intptr_t opaque, int *error)
+rumpcomp_shmif_watchsetup(int kq, int fd, int *error)
 {
        struct kevent kev;
        int rv;
@@ -56,14 +56,16 @@
        }
 
        EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR,
-           NOTE_WRITE, 0, opaque);
+           NOTE_WRITE, 0, 0);
        rv = kevent(kq, &kev, 1, NULL, 0, NULL);
        *error = errno;
-       return rv;
+       if (rv == -1)
+               return -1;
+       return kq;
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
        void *cookie;
        struct kevent kev;
@@ -73,10 +75,8 @@
        do {
                rv = kevent(kq, NULL, 0, &kev, 1, NULL);
        } while (rv == -1 && errno == EINTR);
+       *error = errno;
 
-       *error = errno;
-       if (rv != -1 && opaque)
-               *opaque = kev.udata;
        rumpuser_component_schedule(cookie);
        return rv;
 }
@@ -85,7 +85,7 @@
 #include <sys/inotify.h>
 
 int
-rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error)
+rumpcomp_shmif_watchsetup(int inotify, int fd, int *error)
 {
        char procbuf[PATH_MAX], linkbuf[PATH_MAX];
        ssize_t nn;
@@ -122,7 +122,7 @@
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
        struct inotify_event iev;
        void *cookie;
@@ -145,7 +145,7 @@
 
 /* a polling default implementation */
 int
-rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error)
+rumpcomp_shmif_watchsetup(int inotify, int fd, int *error)
 {
        static int warned = 0;
 
@@ -159,7 +159,7 @@
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
        void *cookie;
 
diff -r c7f8cb718fb4 -r 7eaf3d0ecd7a sys/rump/net/lib/libshmif/rumpcomp_user.h
--- a/sys/rump/net/lib/libshmif/rumpcomp_user.h Sun Apr 28 10:43:45 2013 +0000
+++ b/sys/rump/net/lib/libshmif/rumpcomp_user.h Sun Apr 28 10:53:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpcomp_user.h,v 1.1 2013/04/28 10:43:45 pooka Exp $  */
+/*     $NetBSD: rumpcomp_user.h,v 1.2 2013/04/28 10:53:22 pooka Exp $  */
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -25,5 +25,5 @@
  * SUCH DAMAGE.
  */
 
-int    rumpcomp_shmif_watchsetup(int, int, intptr_t, int *);
-int    rumpcomp_shmif_watchwait(int, intptr_t *, int *);
+int    rumpcomp_shmif_watchsetup(int, int, int *);
+int    rumpcomp_shmif_watchwait(int, int *);



Home | Main Index | Thread Index | Old Index