Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Define DPRINTF() as __nothing when !USB_DEBUG. D...



details:   https://anonhg.NetBSD.org/src/rev/d1b812245f9a
branches:  trunk
changeset: 447031:d1b812245f9a
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Dec 28 22:55:20 2018 +0000

description:
Define DPRINTF() as __nothing when !USB_DEBUG. Drop excess braces.

No functional changes intended.

diffstat:

 sys/dev/usb/if_mue.c |  34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 deletions(-)

diffs (116 lines):

diff -r e77bcb2e40c3 -r d1b812245f9a sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c      Fri Dec 28 21:51:49 2018 +0000
+++ b/sys/dev/usb/if_mue.c      Fri Dec 28 22:55:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mue.c,v 1.25 2018/12/22 16:58:51 rin Exp $  */
+/*     $NetBSD: if_mue.c,v 1.26 2018/12/28 22:55:20 rin Exp $  */
 /*     $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $  */
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.25 2018/12/22 16:58:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.26 2018/12/28 22:55:20 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -76,7 +76,7 @@
                        MUE_PRINTF(sc, fmt, ##args);                    \
        } while (0 /* CONSTCOND */)
 #else
-#define DPRINTF(sc, fmt, args...)      /* nothing */
+#define DPRINTF(sc, fmt, args...)      __nothing
 #endif
 
 /*
@@ -657,12 +657,10 @@
                                goto done;
                        }
                        DPRINTF(sc, "success\n");
-               } else {
+               } else
                        DPRINTF(sc, "nothing to do\n");
-               }
-       } else {
+       } else
                DPRINTF(sc, "nothing to do\n");
-       }
 done:
        for (i = 0; i < __arraycount(idx); i++)
                mue_csr_write(sc, MUE_LTM_INDEX(i), idx[i]);
@@ -823,30 +821,27 @@
                sc->mue_enaddr[0] = (uint8_t)((low) & 0xff);
                if (ETHER_IS_VALID(sc->mue_enaddr))
                        return 0;
-               else {
+               else
                        DPRINTF(sc, "registers: %s\n",
                            ether_sprintf(sc->mue_enaddr));
-               }
        }
 
        if (mue_eeprom_present(sc) && !mue_read_eeprom(sc, sc->mue_enaddr,
            MUE_E2P_MAC_OFFSET, ETHER_ADDR_LEN)) {
                if (ETHER_IS_VALID(sc->mue_enaddr))
                        return 0;
-               else {
+               else
                        DPRINTF(sc, "EEPROM: %s\n",
                            ether_sprintf(sc->mue_enaddr));
-               }
        }
 
        if (mue_read_otp(sc, sc->mue_enaddr, MUE_OTP_MAC_OFFSET,
            ETHER_ADDR_LEN) == 0) {
                if (ETHER_IS_VALID(sc->mue_enaddr))
                        return 0;
-               else {
+               else
                        DPRINTF(sc, "OTP: %s\n",
                            ether_sprintf(sc->mue_enaddr));
-               }
        }
 
        /*
@@ -862,10 +857,9 @@
                    ETHER_ADDR_LEN);
                if (ETHER_IS_VALID(sc->mue_enaddr))
                        return 0;
-               else {
+               else
                        DPRINTF(sc, "prop_dictionary_get: %s\n",
                            ether_sprintf(sc->mue_enaddr));
-               }
        }
 
        return 1;
@@ -1334,11 +1328,10 @@
                rxfilt |= MUE_RFE_CTL_UNICAST;
 allmulti:      rxfilt |= MUE_RFE_CTL_MULTICAST;
                ifp->if_flags |= IFF_ALLMULTI;
-               if (ifp->if_flags & IFF_PROMISC) {
+               if (ifp->if_flags & IFF_PROMISC)
                        DPRINTF(sc, "promisc\n");
-               } else {
+               else
                        DPRINTF(sc, "allmulti\n");
-               }
        } else {
                /* Now program new ones. */
                pfiltbl[0][0] = MUE_ENADDR_HI(enaddr) | MUE_ADDR_FILTX_VALID;
@@ -1370,11 +1363,10 @@
                }
                rxfilt |= MUE_RFE_CTL_PERFECT;
                ifp->if_flags &= ~IFF_ALLMULTI;
-               if (rxfilt & MUE_RFE_CTL_MULTICAST_HASH) {
+               if (rxfilt & MUE_RFE_CTL_MULTICAST_HASH)
                        DPRINTF(sc, "perfect filter and hash tables\n");
-               } else {
+               else
                        DPRINTF(sc, "perfect filter\n");
-               }
        }
 
        for (i = 0; i < MUE_NUM_ADDR_FILTX; i++) {



Home | Main Index | Thread Index | Old Index