]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: dgnc: Remove casting the return value which is a void pointer
authorJingoo Han <jg1.han@samsung.com>
Wed, 25 Sep 2013 23:35:49 +0000 (08:35 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 16:26:12 +0000 (09:26 -0700)
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

CC: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_driver.c
drivers/staging/dgnc/dgnc_sysfs.c

index 3c5475901212b4945bcb70124ee1d1b198f127cd..c398193e9b85c81a8bafb0464f3e16bcbde41588 100644 (file)
@@ -487,7 +487,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 dgnc_board *) kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
+               kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
        if (!brd) {
                APR(("memory allocation for board structure failed\n"));
                return -ENOMEM;
@@ -495,7 +495,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
        /* make a temporary message buffer for the boot messages */
        brd->msgbuf = brd->msgbuf_head =
-               (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
+               kzalloc(sizeof(char) * 8192, GFP_KERNEL);
        if (!brd->msgbuf) {
                kfree(brd);
                APR(("memory allocation for board msgbuf failed\n"));
index 5834e0c17ee0eba9a5add291d2fabdc22bc54b86..946230c234875009b07070a6ef22ca345552b74c 100644 (file)
@@ -433,7 +433,7 @@ static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *at
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -458,7 +458,7 @@ static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *att
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -483,7 +483,7 @@ static ssize_t dgnc_tty_msignals_show(struct device *d, struct device_attribute
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -517,7 +517,7 @@ static ssize_t dgnc_tty_iflag_show(struct device *d, struct device_attribute *at
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -542,7 +542,7 @@ static ssize_t dgnc_tty_cflag_show(struct device *d, struct device_attribute *at
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -567,7 +567,7 @@ static ssize_t dgnc_tty_oflag_show(struct device *d, struct device_attribute *at
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -592,7 +592,7 @@ static ssize_t dgnc_tty_lflag_show(struct device *d, struct device_attribute *at
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -617,7 +617,7 @@ static ssize_t dgnc_tty_digi_flag_show(struct device *d, struct device_attribute
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -642,7 +642,7 @@ static ssize_t dgnc_tty_rxcount_show(struct device *d, struct device_attribute *
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -667,7 +667,7 @@ static ssize_t dgnc_tty_txcount_show(struct device *d, struct device_attribute *
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;
@@ -692,7 +692,7 @@ static ssize_t dgnc_tty_name_show(struct device *d, struct device_attribute *att
 
        if (!d)
                return 0;
-       un = (struct un_t *) dev_get_drvdata(d);
+       un = dev_get_drvdata(d);
        if (!un || un->magic != DGNC_UNIT_MAGIC)
                return 0;
        ch = un->un_ch;