[PATCH v2 2/3] staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc

Greg KH gregkh at linuxfoundation.org
Wed Aug 28 04:54:30 UTC 2013


On Tue, Aug 27, 2013 at 10:13:27PM -0400, Lidza Louina wrote:
> This patch replaces dgnc_driver_kzmalloc with kzalloc.
> A patch that follows removes the dgnc_driver_kzmalloc
> function.
> 
> Signed-off-by: Lidza Louina <lidza.louina at gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c |  6 +++---
>  drivers/staging/dgnc/dgnc_tty.c    | 20 ++++++++++----------
>  2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index 8032368..4226f09 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -501,7 +501,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
>  
>  	/* get the board structure and prep it */
>  	brd = dgnc_Board[dgnc_NumBoards] =
> -	(struct board_t *) dgnc_driver_kzmalloc(sizeof(struct board_t), GFP_KERNEL);
> +	(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);

I'll take this for now, but all of these casts of the kzalloc() call
need to go away, as they are pointless (kzalloc() returns a void *,
which automatically can be assigned to any pointer type, no need to be
explicit about it.)

So that means you'll get another patch accepted modifying these same
lines now :)

thanks,

greg k-h


More information about the devel mailing list