summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-09-14 19:04:55 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-09-14 19:04:55 +0000
commita8218c38d6ca2c722159d4ce3b2d50a2bb5832f2 (patch)
tree3e43776459e5b179366d7038fd1f7808dd118ba4 /sys
parentdc032a6709ac332462d9c436b43aebe6d4898641 (diff)
Declare the type instead of a on-stack variable for sizeof purposes
(Un?)surprisingly the compiler is smart enough to produce the same code in both cases, but this conveys the intention better.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_oce.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index e38de1b7de0..cceb3be45ac 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.96 2016/08/24 10:38:34 dlg Exp $ */
+/* $OpenBSD: if_oce.c,v 1.97 2016/09/14 19:04:54 mikeb Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -3451,13 +3451,13 @@ oce_new_cq(struct oce_softc *sc, struct oce_cq *cq)
int
oce_init_stats(struct oce_softc *sc)
{
- union {
+ union cmd {
struct mbx_get_nic_stats_v0 _be2;
struct mbx_get_nic_stats _be3;
struct mbx_get_pport_stats _xe201;
- } cmd;
+ };
- sc->sc_statcmd = malloc(sizeof(cmd), M_DEVBUF, M_ZERO | M_NOWAIT);
+ sc->sc_statcmd = malloc(sizeof(union cmd), M_DEVBUF, M_ZERO | M_NOWAIT);
if (sc->sc_statcmd == NULL) {
printf("%s: failed to allocate statistics command block\n",
sc->sc_dev.dv_xname);