[OPW,kernel,1/3] Staging: dgnc: Removed kzalloc casts and splitted up nearby double assignments.
diff mbox

Message ID 20131012151020.GA9566@gmail.com
State Rejected
Headers show

Commit Message

Agnieszka Tabaka Oct. 12, 2013, 3:10 p.m. UTC
Signed-off-by: Agnieszka Tabaka <nufcia@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Greg KH Oct. 14, 2013, 4:06 p.m. UTC | #1
What "kzalloc casts"?  I don't see that in the patch below anywhere,
just splitting up the double assignments (which shouldn't be a big deal,
right?)

thanks,

greg k-h

On Sat, Oct 12, 2013 at 05:10:20PM +0200, Agnieszka Tabaka wrote:
> Signed-off-by: Agnieszka Tabaka <nufcia@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index 4271fa3..6fdc632 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -486,16 +486,16 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
>  	unsigned long flags;
>  
>  	/* get the board structure and prep it */
> -	brd = dgnc_Board[dgnc_NumBoards] =
> -		kzalloc(sizeof(*brd), GFP_KERNEL);
> +	brd = kzalloc(sizeof(struct board_t), GFP_KERNEL);
> +	dgnc_Board[dgnc_NumBoards] = brd;
>  	if (!brd) {
>  		APR(("memory allocation for board structure failed\n"));
>  		return -ENOMEM;
>  	}
>  
>  	/* make a temporary message buffer for the boot messages */
> -	brd->msgbuf = brd->msgbuf_head =
> -		kzalloc(sizeof(u8) * 8192, GFP_KERNEL);
> +	brd->msgbuf = kzalloc(sizeof(char) * 8192, GFP_KERNEL);
> +	brd->msgbuf_head = brd->msgbuf;
>  	if (!brd->msgbuf) {
>  		kfree(brd);
>  		APR(("memory allocation for board msgbuf failed\n"));
> -- 
> 1.8.1.2
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Patch
diff mbox

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 4271fa3..6fdc632 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -486,16 +486,16 @@  static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	brd = dgnc_Board[dgnc_NumBoards] =
-		kzalloc(sizeof(*brd), GFP_KERNEL);
+	brd = kzalloc(sizeof(struct board_t), GFP_KERNEL);
+	dgnc_Board[dgnc_NumBoards] = brd;
 	if (!brd) {
 		APR(("memory allocation for board structure failed\n"));
 		return -ENOMEM;
 	}
 
 	/* make a temporary message buffer for the boot messages */
-	brd->msgbuf = brd->msgbuf_head =
-		kzalloc(sizeof(u8) * 8192, GFP_KERNEL);
+	brd->msgbuf = kzalloc(sizeof(char) * 8192, GFP_KERNEL);
+	brd->msgbuf_head = brd->msgbuf;
 	if (!brd->msgbuf) {
 		kfree(brd);
 		APR(("memory allocation for board msgbuf failed\n"));