]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: dgnc: remove useless message buffer
authorDaeseok Youn <daeseok.youn@gmail.com>
Mon, 26 Sep 2016 00:38:48 +0000 (09:38 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2016 11:12:25 +0000 (13:12 +0200)
There is a temporary message buffer for the boot message
in dgnc_found_board() but the buffer was not used anywhere in
dgnc driver.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_driver.c
drivers/staging/dgnc/dgnc_driver.h

index b598034736c10d73262e0ca8794ee24ce4db2d0f..c87b3def6ed87e4d73b24fe9168df52a81afe61c 100644 (file)
@@ -324,17 +324,6 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
                brd->re_map_membase = NULL;
        }
 
-       if (brd->msgbuf_head) {
-               unsigned long flags;
-
-               spin_lock_irqsave(&dgnc_global_lock, flags);
-               brd->msgbuf = NULL;
-               dev_dbg(&brd->pdev->dev, "%s\n", brd->msgbuf_head);
-               kfree(brd->msgbuf_head);
-               brd->msgbuf_head = NULL;
-               spin_unlock_irqrestore(&dgnc_global_lock, flags);
-       }
-
        /* Free all allocated channels structs */
        for (i = 0; i < MAXPORTS ; i++) {
                if (brd->channels[i]) {
@@ -362,7 +351,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
        unsigned int pci_irq;
        int i = 0;
        int rc = 0;
-       unsigned long flags;
 
        /* get the board structure and prep it */
        dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
@@ -371,15 +359,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
        if (!brd)
                return -ENOMEM;
 
-       /* make a temporary message buffer for the boot messages */
-       brd->msgbuf_head = kcalloc(8192, sizeof(u8), GFP_KERNEL);
-       brd->msgbuf = brd->msgbuf_head;
-
-       if (!brd->msgbuf) {
-               kfree(brd);
-               return -ENOMEM;
-       }
-
        /* store the info for the board we've found */
        brd->magic = DGNC_BOARD_MAGIC;
        brd->boardnum = dgnc_num_boards;
@@ -553,13 +532,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
                     brd->bd_ops->tasklet,
                     (unsigned long)brd);
 
-       spin_lock_irqsave(&dgnc_global_lock, flags);
-       brd->msgbuf = NULL;
-       dev_dbg(&brd->pdev->dev, "%s\n", brd->msgbuf_head);
-       kfree(brd->msgbuf_head);
-       brd->msgbuf_head = NULL;
-       spin_unlock_irqrestore(&dgnc_global_lock, flags);
-
        wake_up_interruptible(&brd->state_wait);
 
        return 0;
index 88d2696b8616120864ddea72acc4a875b4d494c6..747a1008e5f9bb7e61d3f5b521b49888453f229a 100644 (file)
@@ -213,12 +213,6 @@ struct dgnc_board {
                                         * as defined by DPA
                                         */
 
-       /*
-        *      Mgmt data.
-        */
-       char            *msgbuf_head;
-       char            *msgbuf;
-
        uint            bd_dividend;    /* Board/UARTs specific dividend */
 
        struct board_ops *bd_ops;