Skip to content

Commit

Permalink
staging: dgap: Remove casting the return value which is a void pointer
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Sep 17, 2013
1 parent 3b33bd9 commit 538118b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/dgap/dgap_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,10 @@ static void dgap_err(char *s)
static struct cnode *dgap_newnode(int t)
{
struct cnode *n;
if ( (n = (struct cnode *) kmalloc(sizeof(struct cnode ), GFP_ATOMIC) ) != NULL) {
memset( (char *)n, 0, sizeof(struct cnode ) );

n = kmalloc(sizeof(struct cnode), GFP_ATOMIC);
if (n != NULL) {
memset((char *)n, 0, sizeof(struct cnode));
n->type = t;
}
return(n);
Expand Down
22 changes: 11 additions & 11 deletions drivers/staging/dgap/dgap_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -420,7 +420,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -445,7 +445,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand Down Expand Up @@ -479,7 +479,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -504,7 +504,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -529,7 +529,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -554,7 +554,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -579,7 +579,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -604,7 +604,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand All @@ -629,7 +629,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand Down Expand Up @@ -661,7 +661,7 @@ static ssize_t dgap_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 != DGAP_UNIT_MAGIC)
return (0);
ch = un->un_ch;
Expand Down

0 comments on commit 538118b

Please sign in to comment.