summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorMark Hounschell <markh@compro.net>2014-03-03 13:45:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-06 14:10:58 -0800
commit9b073ac53eea902712f88388b42efcebce211bec (patch)
treec914e5d343c001dfb9989b0d6ff40eaf66b8b7f6 /drivers/staging/dgap
parent8cbb5e3f9d0ba08fd151a3bb404d9183bb86be1a (diff)
downloadlinux-stable-9b073ac53eea902712f88388b42efcebce211bec.tar.gz
linux-stable-9b073ac53eea902712f88388b42efcebce211bec.tar.bz2
linux-stable-9b073ac53eea902712f88388b42efcebce211bec.zip
staging: dgap: Fix various previously missed checkpatch errors
This patch fixes various small checkpatch errors I missed in patches 01-10. Remove check for kfree of brd->channels as kfree is safe. Also there is no need to set it to NULL after freeing it. Remove a useless cast for a kzalloc return value. Remove double negative test in a white space fix line. Signed-off-by: Mark Hounschell <markh@compro.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 29d38e7ac933..698655e5cc61 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -258,7 +258,7 @@ static uint dgap_driver_start = FALSE;
static struct class *dgap_class;
static struct board_t *dgap_BoardsByMajor[256];
-static uchar *dgap_TmpWriteBuf = NULL;
+static uchar *dgap_TmpWriteBuf;
DECLARE_MUTEX(dgap_TmpWriteSem);
static uint dgap_count = 500;
@@ -743,12 +743,8 @@ static void dgap_cleanup_board(struct board_t *brd)
}
/* Free all allocated channels structs */
- for (i = 0; i < MAXPORTS ; i++) {
- if (brd->channels[i]) {
- kfree(brd->channels[i]);
- brd->channels[i] = NULL;
- }
- }
+ for (i = 0; i < MAXPORTS ; i++)
+ kfree(brd->channels[i]);
kfree(brd->flipbuf);
kfree(brd->flipflagbuf);
@@ -771,11 +767,12 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
unsigned long flags;
/* get the board structure and prep it */
- brd = dgap_Board[dgap_NumBoards] =
- (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
+ brd = kzalloc(sizeof(struct board_t), GFP_KERNEL);
if (!brd)
return -ENOMEM;
+ dgap_Board[dgap_NumBoards] = brd;
+
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
@@ -7470,7 +7467,7 @@ static int dgap_parsefile(char **in, int Remove)
* the group, and returns that position. If the first character is a ^, then
* this will match the first occurrence not in that group.
*/
-static char *dgap_sindex (char *string, char *group)
+static char *dgap_sindex(char *string, char *group)
{
char *ptr;
@@ -7517,7 +7514,7 @@ static int dgap_gettok(char **in, struct cnode *p)
dgap_err("board !!type not specified");
return 1;
} else {
- while ( (w = dgap_getword(in)) != NULL ) {
+ while ((w = dgap_getword(in))) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
if (!strcmp(w, t->string))