summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_pci.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2017-03-14 02:06:03 +0000
committerpfg <pfg@FreeBSD.org>2017-03-14 02:06:03 +0000
commitf3584df197214b997bc9ae927780e03c37c9e36c (patch)
treeaae668303806e238ca59fc767e74a67964266c3f /sys/dev/isp/isp_pci.c
parent1c6f535240ae8fa78eae79343be21fe7ff7a6807 (diff)
downloadFreeBSD-src-f3584df197214b997bc9ae927780e03c37c9e36c.zip
FreeBSD-src-f3584df197214b997bc9ae927780e03c37c9e36c.tar.gz
MFC r313982, r314068:
sys: Replace zero with NULL for pointers. Found with: devel/coccinelle
Diffstat (limited to 'sys/dev/isp/isp_pci.c')
-rw-r--r--sys/dev/isp/isp_pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index b0acd96..8a51cf5 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -583,10 +583,10 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
name, &tval) == 0 && tval != 0) {
isp->isp_confopts |= ISP_CFG_FULL_DUPLEX;
}
- sptr = 0;
+ sptr = NULL;
snprintf(name, sizeof(name), "%stopology", prefix);
if (resource_string_value(device_get_name(dev), device_get_unit(dev),
- name, (const char **) &sptr) == 0 && sptr != 0) {
+ name, (const char **) &sptr) == 0 && sptr != NULL) {
if (strcmp(sptr, "lport") == 0) {
isp->isp_confopts |= ISP_CFG_LPORT;
} else if (strcmp(sptr, "nport") == 0) {
@@ -631,12 +631,12 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
* hint replacement to specify WWN strings with a leading
* 'w' (e..g w50000000aaaa0001). Sigh.
*/
- sptr = 0;
+ sptr = NULL;
snprintf(name, sizeof(name), "%sportwwn", prefix);
tval = resource_string_value(device_get_name(dev), device_get_unit(dev),
name, (const char **) &sptr);
- if (tval == 0 && sptr != 0 && *sptr++ == 'w') {
- char *eptr = 0;
+ if (tval == 0 && sptr != NULL && *sptr++ == 'w') {
+ char *eptr = NULL;
ISP_FC_PC(isp, chan)->def_wwpn = strtouq(sptr, &eptr, 16);
if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwpn == -1) {
device_printf(dev, "mangled portwwn hint '%s'\n", sptr);
@@ -644,12 +644,12 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
}
}
- sptr = 0;
+ sptr = NULL;
snprintf(name, sizeof(name), "%snodewwn", prefix);
tval = resource_string_value(device_get_name(dev), device_get_unit(dev),
name, (const char **) &sptr);
- if (tval == 0 && sptr != 0 && *sptr++ == 'w') {
- char *eptr = 0;
+ if (tval == 0 && sptr != NULL && *sptr++ == 'w') {
+ char *eptr = NULL;
ISP_FC_PC(isp, chan)->def_wwnn = strtouq(sptr, &eptr, 16);
if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwnn == 0) {
device_printf(dev, "mangled nodewwn hint '%s'\n", sptr);
OpenPOWER on IntegriCloud