Module Name: src Committed By: yamaguchi Date: Thu Dec 26 03:08:19 UTC 2019
Modified Files: src/sys/dev/pci: if_ixl.c Log Message: Improve DDPRINTF for ixl(4) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/if_ixl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_ixl.c diff -u src/sys/dev/pci/if_ixl.c:1.12 src/sys/dev/pci/if_ixl.c:1.13 --- src/sys/dev/pci/if_ixl.c:1.12 Fri Dec 20 02:19:27 2019 +++ src/sys/dev/pci/if_ixl.c Thu Dec 26 03:08:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ixl.c,v 1.12 2019/12/20 02:19:27 yamaguchi Exp $ */ +/* $NetBSD: if_ixl.c,v 1.13 2019/12/26 03:08:19 yamaguchi Exp $ */ /* * Copyright (c) 2013-2015, Intel Corporation @@ -594,11 +594,14 @@ struct ixl_softc { #define delaymsec(_x) DELAY(1000 * (_x)) #ifdef IXL_DEBUG -#define DDPRINTF(sc, fmt, args...) \ -do { \ - if (sc != NULL) \ - device_printf(sc->sc_dev, ""); \ - printf("%s:\t" fmt, __func__, ##args); \ +#define DDPRINTF(sc, fmt, args...) \ +do { \ + if ((sc) != NULL) { \ + device_printf( \ + ((struct ixl_softc *)(sc))->sc_dev, \ + ""); \ + } \ + printf("%s:\t" fmt, __func__, ##args); \ } while (0) #else #define DDPRINTF(sc, fmt, args...) __nothing