/*
EOL
*/
- {-1, 0}
+ {-1}
};
static void diva_init_request_array(void);
for (i = 0; divas_supported_cards[i].CardOrdinal != -1; i++) {
if (divas_supported_cards[i].CardOrdinal == CardOrdinal) {
if (!(pdiva = divas_create_pci_card(i, pdev))) {
- return (0);
+ return NULL;
}
switch (CardOrdinal) {
case CARDTYPE_DIVASRV_Q_8M_PCI:
DBG_ERR(("can not alloc request array"))
diva_driver_remove_card(pdiva);
- return (0);
+ return NULL;
}
}
- return (0);
+ return NULL;
}
/* --------------------------------------------------------------------------
int i;
pa = a[0] = (diva_os_xdi_adapter_t *) pdiva;
- a[1] = a[2] = a[3] = 0;
+ a[1] = a[2] = a[3] = NULL;
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter");
if (a[i]) {
if (a[i]->controller) {
DBG_LOG(("remove adapter (%d)",
- a[i]->controller)) IoAdapters[a[i]->controller - 1] = 0;
+ a[i]->controller)) IoAdapters[a[i]->controller - 1] = NULL;
remove_adapter_proc(a[i]);
}
diva_os_free(0, a[i]);
if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) {
DBG_ERR(("A: can't alloc adapter"));
- return (0);
+ return NULL;
}
memset(a, 0x00, sizeof(*a));
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
diva_os_free(0, a);
DBG_ERR(("A: can't get adapter resources"));
- return (0);
+ return NULL;
}
return (a);
(*(a->interface.cleanup_adapter_proc)) (a);
}
if (a->controller) {
- IoAdapters[a->controller - 1] = 0;
+ IoAdapters[a->controller - 1] = NULL;
remove_adapter_proc(a);
}
diva_os_free(0, a);
/*
** Receive and process command from user mode utility
*/
-void *diva_xdi_open_adapter(void *os_handle, const void *src,
+void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
int length,
divas_xdi_copy_from_user_fn_t cp_fn)
{
if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
DBG_ERR(("A: A(?) open, msg too small (%d < %d)",
length, sizeof(diva_xdi_um_cfg_cmd_t)))
- return (0);
+ return NULL;
}
if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
DBG_ERR(("A: A(?) open, write error"))
- return (0);
+ return NULL;
}
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
list_for_each(tmp, &adapter_queue) {
a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
if (a->xdi_mbox.data) {
diva_os_free(0, a->xdi_mbox.data);
- a->xdi_mbox.data = 0;
+ a->xdi_mbox.data = NULL;
}
}
int
-diva_xdi_write(void *adapter, void *os_handle, const void *src,
+diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
int length, divas_xdi_copy_from_user_fn_t cp_fn)
{
diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
** Write answers to user mode utility, if any
*/
int
-diva_xdi_read(void *adapter, void *os_handle, void *dst,
+diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
int max_length, divas_xdi_copy_to_user_fn_t cp_fn)
{
diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
a->xdi_mbox.data_length);
if (ret > 0) {
diva_os_free(0, a->xdi_mbox.data);
- a->xdi_mbox.data = 0;
+ a->xdi_mbox.data = NULL;
a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
}
if ((clear_int_proc = a->clear_interrupts_proc)) {
(*clear_int_proc) (a);
- a->clear_interrupts_proc = 0;
+ a->clear_interrupts_proc = NULL;
return IRQ_HANDLED;
}