aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hptmv
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2017-02-20 03:43:12 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2017-02-20 03:43:12 +0000
commit4d24901ac9131267fd188c5e1ee19a219847238a (patch)
treec6b56412f6ca4e7ffd1dc366d2fc51f7fa34600f /sys/dev/hptmv
parent85161825cf4af1294d9464badbe675a1419bd4fd (diff)
downloadsrc-4d24901ac9131267fd188c5e1ee19a219847238a.tar.gz
src-4d24901ac9131267fd188c5e1ee19a219847238a.zip
sys/dev: Replace zero with NULL for pointers.
Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=313982
Diffstat (limited to 'sys/dev/hptmv')
-rw-r--r--sys/dev/hptmv/entry.c8
-rw-r--r--sys/dev/hptmv/gui_lib.c8
-rw-r--r--sys/dev/hptmv/hptproc.c2
-rw-r--r--sys/dev/hptmv/ioctl.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index b01fc9c917da..167f82a46e87 100644
--- a/sys/dev/hptmv/entry.c
+++ b/sys/dev/hptmv/entry.c
@@ -138,8 +138,8 @@ static MV_BOOLEAN hptmv_event_notify(MV_SATA_ADAPTER *pMvSataAdapter,
static struct sx hptmv_list_lock;
SX_SYSINIT(hptmv_list_lock, &hptmv_list_lock, "hptmv list");
-IAL_ADAPTER_T *gIal_Adapter = 0;
-IAL_ADAPTER_T *pCurAdapter = 0;
+IAL_ADAPTER_T *gIal_Adapter = NULL;
+IAL_ADAPTER_T *pCurAdapter = NULL;
static MV_SATA_CHANNEL gMvSataChannels[MAX_VBUS][MV_SATA_CHANNELS_NUM];
typedef struct st_HPT_DPC {
@@ -1262,7 +1262,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter)
sx_xlock(&hptmv_list_lock);
pAdapter->next = 0;
- if(gIal_Adapter == 0){
+ if(gIal_Adapter == NULL){
gIal_Adapter = pAdapter;
pCurAdapter = gIal_Adapter;
}
@@ -2427,7 +2427,7 @@ static void hpt_worker_thread(void)
sx_slock(&hptmv_list_lock);
pAdapter = gIal_Adapter;
- while(pAdapter != 0){
+ while(pAdapter != NULL){
mtx_lock(&pAdapter->lock);
_vbus_p = &pAdapter->VBus;
diff --git a/sys/dev/hptmv/gui_lib.c b/sys/dev/hptmv/gui_lib.c
index 359a41edcd3c..bc57239c217b 100644
--- a/sys/dev/hptmv/gui_lib.c
+++ b/sys/dev/hptmv/gui_lib.c
@@ -74,7 +74,7 @@ check_VDevice_valid(PVDevice p)
PVBus _vbus_p;
IAL_ADAPTER_T *pAdapter = gIal_Adapter;
- while(pAdapter != 0)
+ while(pAdapter != NULL)
{
for (i = 0; i < MV_SATA_CHANNELS_NUM; i++)
if(&(pAdapter->VDevices[i]) == p) return 0;
@@ -83,7 +83,7 @@ check_VDevice_valid(PVDevice p)
#ifdef SUPPORT_ARRAY
pAdapter = gIal_Adapter;
- while(pAdapter != 0)
+ while(pAdapter != NULL)
{
_vbus_p = &pAdapter->VBus;
for (i=0;i<MAX_ARRAY_PER_VBUS;i++)
@@ -403,7 +403,7 @@ int hpt_get_controller_count(void)
IAL_ADAPTER_T *pAdapTemp = gIal_Adapter;
int iControllerCount = 0;
- while(pAdapTemp != 0)
+ while(pAdapTemp != NULL)
{
iControllerCount++;
pAdapTemp = pAdapTemp->next;
@@ -448,7 +448,7 @@ int hpt_get_channel_info(int id, int bus, PCHANNEL_INFO pInfo)
IAL_ADAPTER_T *pAdapTemp = gIal_Adapter;
int i,iControllerCount = 0;
- while(pAdapTemp != 0)
+ while(pAdapTemp != NULL)
{
if (iControllerCount++==id)
goto found;
diff --git a/sys/dev/hptmv/hptproc.c b/sys/dev/hptmv/hptproc.c
index 9e897567e079..d9ded9fd0e1a 100644
--- a/sys/dev/hptmv/hptproc.c
+++ b/sys/dev/hptmv/hptproc.c
@@ -427,7 +427,7 @@ static void
hpt_copy_array_info(HPT_GET_INFO *pinfo, int nld, PVDevice pArray)
{
int i;
- char *sType=0, *sStatus=0;
+ char *sType = NULL, *sStatus = NULL;
char buf[32];
PVDevice pTmpArray;
diff --git a/sys/dev/hptmv/ioctl.c b/sys/dev/hptmv/ioctl.c
index 50a82aed1cb8..671d64c86bcf 100644
--- a/sys/dev/hptmv/ioctl.c
+++ b/sys/dev/hptmv/ioctl.c
@@ -691,7 +691,7 @@ hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flags)
PCommand pCmd;
UINT result;
int needsync=0, retry=0, needdelete=0;
- void *buffer = 0;
+ void *buffer = NULL;
_VBUS_INST(&pAdapter->VBus)