Replace 0 with NULL for pointers Fix do while
Signed-off-by: Peter Huewe <[email protected]> [adjusted for meego kernel] Signed-off-by: Mark Allyn <[email protected]> --- drivers/staging/sep/sep_driver.c | 52 +++++++++++++++++++------------------- 1 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c index 632996a..dabb3e3 100644 --- a/drivers/staging/sep/sep_driver.c +++ b/drivers/staging/sep/sep_driver.c @@ -459,12 +459,12 @@ static int sep_free_dma_table_data_handler(struct sep_device *sep) } /* Reset all the values */ - dma->in_page_array = 0; - dma->out_page_array = 0; + dma->in_page_array = NULL; + dma->out_page_array = NULL; dma->in_num_pages = 0; dma->out_num_pages = 0; - dma->in_map_array = 0; - dma->out_map_array = 0; + dma->in_map_array = NULL; + dma->out_map_array = NULL; dma->in_map_num_entries = 0; dma->out_map_num_entries = 0; } @@ -1120,13 +1120,13 @@ static int sep_lock_kernel_pages(struct sep_device *sep, if (in_out_flag == SEP_DRIVER_IN_FLAG) { *lli_array_ptr = lli_array; sep->dma_res_arr[sep->nr_dcb_creat].in_num_pages = 1; - sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = 0; + sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = NULL; sep->dma_res_arr[sep->nr_dcb_creat].in_map_array = map_array; sep->dma_res_arr[sep->nr_dcb_creat].in_map_num_entries = 1; } else { *lli_array_ptr = lli_array; sep->dma_res_arr[sep->nr_dcb_creat].out_num_pages = 1; - sep->dma_res_arr[sep->nr_dcb_creat].out_page_array = 0; + sep->dma_res_arr[sep->nr_dcb_creat].out_page_array = NULL; sep->dma_res_arr[sep->nr_dcb_creat].out_map_array = map_array; sep->dma_res_arr[sep->nr_dcb_creat].out_map_num_entries = 1; } @@ -1222,7 +1222,7 @@ static int sep_lock_user_pages(struct sep_device *sep, result = get_user_pages(current, current->mm, app_virt_addr, num_pages, ((in_out_flag == SEP_DRIVER_IN_FLAG) ? 0 : 1), - 0, page_array, 0); + 0, page_array, NULL); up_read(¤t->mm->mmap_sem); @@ -1713,7 +1713,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, dev_dbg(&sep->pdev->dev, "block_size is %x\n", block_size); /* Initialize the pages pointers */ - sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = 0; + sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = NULL; sep->dma_res_arr[sep->nr_dcb_creat].in_num_pages = 0; /* Set the kernel address for first table to be allocated */ @@ -1749,7 +1749,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, sep->dma_res_arr[sep->nr_dcb_creat].in_num_pages); current_entry = 0; - info_entry_ptr = 0; + info_entry_ptr = NULL; sep_lli_entries = sep->dma_res_arr[sep->nr_dcb_creat].in_num_pages; @@ -1798,7 +1798,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, in_lli_table_ptr, ¤t_entry, &num_entries_in_table, table_data_size); - if (info_entry_ptr == 0) { + if (info_entry_ptr == NULL) { /* Set the output parameters to physical addresses */ *lli_table_ptr = sep_shared_area_virt_to_bus(sep, @@ -1881,13 +1881,13 @@ static int sep_construct_dma_tables_from_lli( /* Points to the area where next lli table can be allocated */ void *lli_table_alloc_addr = 0; /* Input lli table */ - struct sep_lli_entry *in_lli_table_ptr = 0; + struct sep_lli_entry *in_lli_table_ptr = NULL; /* Output lli table */ - struct sep_lli_entry *out_lli_table_ptr = 0; + struct sep_lli_entry *out_lli_table_ptr = NULL; /* Pointer to the info entry of the table - the last entry */ - struct sep_lli_entry *info_in_entry_ptr = 0; + struct sep_lli_entry *info_in_entry_ptr = NULL; /* Pointer to the info entry of the table - the last entry */ - struct sep_lli_entry *info_out_entry_ptr = 0; + struct sep_lli_entry *info_out_entry_ptr = NULL; /* Points to the first entry to be processed in the lli_in_array */ u32 current_in_entry = 0; /* Points to the first entry to be processed in the lli_out_array */ @@ -2003,7 +2003,7 @@ static int sep_construct_dma_tables_from_lli( table_data_size); /* If info entry is null - this is the first table built */ - if (info_in_entry_ptr == 0) { + if (info_in_entry_ptr == NULL) { /* Set the output parameters to physical addresses */ *lli_table_in_ptr = sep_shared_area_virt_to_bus(sep, in_lli_table_ptr); @@ -2140,8 +2140,8 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep, } /* Initialize the pages pointers */ - sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = 0; - sep->dma_res_arr[sep->nr_dcb_creat].out_page_array = 0; + sep->dma_res_arr[sep->nr_dcb_creat].in_page_array = NULL; + sep->dma_res_arr[sep->nr_dcb_creat].out_page_array = NULL; /* Lock the pages of the buffer and translate them to pages */ if (is_kva == true) { @@ -2268,7 +2268,7 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep, /* Size of tail */ u32 tail_size = 0; /* Address of the created DCB table */ - struct sep_dcblock *dcb_table_ptr = 0; + struct sep_dcblock *dcb_table_ptr = NULL; /* The physical address of the first input DMA table */ dma_addr_t in_first_mlli_address = 0; /* Number of entries in the first input DMA table */ @@ -2551,7 +2551,7 @@ static int sep_free_dma_tables_and_dcb(struct sep_device *sep, bool isapplet, */ static int sep_get_static_pool_addr_handler(struct sep_device *sep) { - u32 *static_pool_addr = 0; + u32 *static_pool_addr = NULL; dev_dbg(&sep->pdev->dev, "sep_get_static_pool_addr_handler start\n"); @@ -2582,9 +2582,9 @@ static int sep_start_handler(struct sep_device *sep) dev_dbg(&sep->pdev->dev, "sep_start_handler start\n"); /* Wait in polling for message from SEP */ - do + do { reg_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR3_REG_ADDR); - while (!reg_val); + } while (!reg_val); /* Check the value */ if (reg_val == 0x1) @@ -2749,9 +2749,9 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) /* Wait for acknowledge */ dev_dbg(&sep->pdev->dev, "init; waiting for msg response\n"); - do + do { reg_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR3_REG_ADDR); - while (!(reg_val & 0xFFFFFFFD)); + } while (!(reg_val & 0xFFFFFFFD)); if (reg_val == 0x1) { dev_warn(&sep->pdev->dev, "init; device int failed\n"); @@ -2769,9 +2769,9 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) /* Wait for response */ dev_dbg(&sep->pdev->dev, "init; waiting for zero set response\n"); - do + do { reg_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR3_REG_ADDR); - while (reg_val != 0); + } while (reg_val != 0); end_function: dev_dbg(&sep->pdev->dev, "init is done\n"); @@ -3533,7 +3533,7 @@ static void sep_remove(struct pci_dev *pdev) iounmap((void *) sep_dev->reg_addr); } -static DEFINE_PCI_DEVICE_TABLE(sep_pci_id_tbl) = { +static DEFINE_PCI_DEVICE_TABLE(sep_pci_id_tbl) = { {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MFLD_PCI_DEVICE_ID)}, {0} }; -- 1.6.3.3 _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
