diff options
author | Mark Hounschell <markh@compro.net> | 2014-02-28 15:48:44 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-28 15:03:58 -0800 |
commit | d1c3c6f5de123944b9eea435365de7ad8b3a18f5 (patch) | |
tree | 6edecc2fe01aaa3744d246f7342afd719225cdef /drivers/staging | |
parent | b115b024c4c4cfb4c5749db13b35fd299d54973c (diff) |
staging: dgap: fix do not use assignment in if condition as reported by checkpatch
This patch fixes "do not use assignment in if condition"
errors reported by checkpatch
Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/dgap/dgap.c | 75 |
1 files changed, 50 insertions, 25 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 00387ac6a56..cbce4577623 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -2876,7 +2876,8 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int head = readw(&(bs->tx_head)) & tmask; tail = readw(&(bs->tx_tail)) & tmask; - if ((bufcount = tail - head - 1) < 0) + bufcount = tail - head - 1; + if (bufcount < 0) bufcount += ch->ch_tsize; /* @@ -6750,7 +6751,8 @@ static int dgap_parsefile(char **in, int Remove) case BOARD: /* board info */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(BNODE)) == NULL) { + p->next = dgap_newnode(BNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7050,16 +7052,19 @@ static int dgap_parsefile(char **in, int Remove) case TTYN: /* tty name prefix */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(TNODE)) == NULL) { + p->next = dgap_newnode(TNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } p = p->next; - if ((s = dgap_getword(in)) == NULL) { + s = dgap_getword(in); + if (!s) { dgap_err("unexpeced end of file"); return -1; } - if ((p->u.ttyname = dgap_savestring(s)) == NULL) { + p->u.ttyname = dgap_savestring(s); + if (!p->u.ttyname) { dgap_err("out of memory"); return -1; } @@ -7068,16 +7073,19 @@ static int dgap_parsefile(char **in, int Remove) case CU: /* cu name prefix */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(CUNODE)) == NULL) { + p->next = dgap_newnode(CUNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } p = p->next; - if ((s = dgap_getword(in)) == NULL) { + s = dgap_getword(in); + if (!s) { dgap_err("unexpeced end of file"); return -1; } - if ((p->u.cuname = dgap_savestring(s)) == NULL) { + p->u.cuname = dgap_savestring(s); + if (!p->u.cuname) { dgap_err("out of memory"); return -1; } @@ -7095,7 +7103,8 @@ static int dgap_parsefile(char **in, int Remove) dgap_err("line not vaild for PC/em"); return -1; } - if ((p->next = dgap_newnode(LNODE)) == NULL) { + p->next = dgap_newnode(LNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7112,7 +7121,8 @@ static int dgap_parsefile(char **in, int Remove) dgap_err("must specify line info before concentrator"); return -1; } - if ((p->next = dgap_newnode(CNODE)) == NULL) { + p->next = dgap_newnode(CNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7160,7 +7170,8 @@ static int dgap_parsefile(char **in, int Remove) return -1; } } - if ((p->next = dgap_newnode(MNODE)) == NULL) { + p->next = dgap_newnode(MNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7192,7 +7203,8 @@ static int dgap_parsefile(char **in, int Remove) case CABLE: if (p->type == LNODE) { - if ((s = dgap_getword(in)) == NULL) { + s = dgap_getword(in); + if (!s) { dgap_err("unexpected end of file"); return -1; } @@ -7234,7 +7246,8 @@ static int dgap_parsefile(char **in, int Remove) case CONNECT: if (p->type == CNODE) { - if ((s = dgap_getword(in)) == NULL) { + s = dgap_getword(in); + if (!s) { dgap_err("unexpected end of file"); return -1; } @@ -7245,16 +7258,19 @@ static int dgap_parsefile(char **in, int Remove) case PRINT: /* transparent print name prefix */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(PNODE)) == NULL) { + p->next = dgap_newnode(PNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } p = p->next; - if ((s = dgap_getword(in)) == NULL) { + s = dgap_getword(in); + if (!s) { dgap_err("unexpeced end of file"); return -1; } - if ((p->u.printname = dgap_savestring(s)) == NULL) { + p->u.printname = dgap_savestring(s); + if (!p->u.printname) { dgap_err("out of memory"); return -1; } @@ -7263,7 +7279,8 @@ static int dgap_parsefile(char **in, int Remove) case CMAJOR: /* major number */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(JNODE)) == NULL) { + p->next = dgap_newnode(JNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7283,7 +7300,8 @@ static int dgap_parsefile(char **in, int Remove) case ALTPIN: /* altpin setting */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(ANODE)) == NULL) { + p->next = dgap_newnode(ANODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7303,7 +7321,8 @@ static int dgap_parsefile(char **in, int Remove) case USEINTR: /* enable interrupt setting */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(INTRNODE)) == NULL) { + p->next = dgap_newnode(INTRNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7323,7 +7342,8 @@ static int dgap_parsefile(char **in, int Remove) case TTSIZ: /* size of tty structure */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(TSNODE)) == NULL) { + p->next = dgap_newnode(TSNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7343,7 +7363,8 @@ static int dgap_parsefile(char **in, int Remove) case CHSIZ: /* channel structure size */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(CSNODE)) == NULL) { + p->next = dgap_newnode(CSNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7363,7 +7384,8 @@ static int dgap_parsefile(char **in, int Remove) case BSSIZ: /* board structure size */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(BSNODE)) == NULL) { + p->next = dgap_newnode(BSNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7383,7 +7405,8 @@ static int dgap_parsefile(char **in, int Remove) case UNTSIZ: /* sched structure size */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(USNODE)) == NULL) { + p->next = dgap_newnode(USNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7403,7 +7426,8 @@ static int dgap_parsefile(char **in, int Remove) case F2SIZ: /* f2200 structure size */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(FSNODE)) == NULL) { + p->next = dgap_newnode(FSNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } @@ -7423,7 +7447,8 @@ static int dgap_parsefile(char **in, int Remove) case VPSIZ: /* vpix structure size */ if (dgap_checknode(p)) return -1; - if ((p->next = dgap_newnode(VSNODE)) == NULL) { + p->next = dgap_newnode(VSNODE); + if (!p->next) { dgap_err("out of memory"); return -1; } |