Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci virtio: cosmetics - use (*pfn)(...) syntax.



details:   https://anonhg.NetBSD.org/src/rev/c3e795495460
branches:  trunk
changeset: 365774:c3e795495460
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Apr 24 11:51:09 2022 +0000

description:
virtio: cosmetics - use (*pfn)(...) syntax.

Some people prefer to call function pointers without an explicit
dereference (that is purely cosmetic in this position), especially to
create faux c++ s->pfn(...) with function pointers in struct members.
Some prefer explicit dereference (that requires parens around it).

(pfn)(...) without dereference but with parens looks odd to both, so
make it conform to one of the established alternatives.

Same object code is generated.

diffstat:

 sys/dev/pci/virtio.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r a874dd25461a -r c3e795495460 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c      Sun Apr 24 10:36:37 2022 +0000
+++ b/sys/dev/pci/virtio.c      Sun Apr 24 11:51:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtio.c,v 1.53 2021/10/28 01:36:43 yamaguchi Exp $    */
+/*     $NetBSD: virtio.c,v 1.54 2022/04/24 11:51:09 uwe Exp $  */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.53 2021/10/28 01:36:43 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.54 2022/04/24 11:51:09 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -413,7 +413,7 @@
 
        KASSERT(sc->sc_intrhand != NULL);
 
-       (sc->sc_intrhand)(sc);
+       (*sc->sc_intrhand)(sc);
 }
 
 /*
@@ -496,7 +496,7 @@
                vq = &sc->sc_vqs[i];
                if (virtio_vq_is_enqueued(sc, vq) == 1) {
                        if (vq->vq_done)
-                               r |= (vq->vq_done)(vq);
+                               r |= (*vq->vq_done)(vq);
                }
        }
 
@@ -511,7 +511,7 @@
 
        for (i = 0; i < sc->sc_nvqs; i++) {
                vq = &sc->sc_vqs[i];
-               r |= (vq->vq_intrhand)(vq->vq_intrhand_arg);
+               r |= (*vq->vq_intrhand)(vq->vq_intrhand_arg);
        }
 
        return r;
@@ -1293,7 +1293,7 @@
 int
 virtio_intrhand(struct virtio_softc *sc)
 {
-       return (sc->sc_intrhand)(sc);
+       return (*sc->sc_intrhand)(sc);
 }
 
 uint64_t



Home | Main Index | Thread Index | Old Index