Staging: fwserial: remove unnecessary parenthesis
PATCH 1/1 Staging: fwserial: remove unnecessary parenthesis
Removed parenthesis causing a coding style warning.
--- drivers/staging/fwserial/dma_fifo.c | 2 +- drivers/staging/fwserial/fwserial.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fwserial/dma_fifo.c +1 -1
@@ -259,7 +259,7 @@ int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)if (list_empty (&fifo->pending) && fifo->open ==0 )return -EINVAL ; -if (FAIL (fifo,list_empty (&fifo->pending) != (fifo->open ==0 ), +if (FAIL (fifo,list_empty (&fifo->pending) != fifo->open ==0 ,"pending list disagrees with open count:%d" , fifo->open))return -ENXIO ;
drivers/staging/fwserial/fwserial.c +1 -1
@@ -1296,7 +1296,7 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)spin_lock_bh (&port->lock); baud =set_termios (port, tty); -if ((baud ==0 ) && (old->c_cflag &CBAUD )) { +if (baud ==0 && (old->c_cflag &CBAUD )) { port->mctrl &= ~(TIOCM_DTR |TIOCM_RTS ); }else if ((baud !=0 ) && !(old->c_cflag &CBAUD )) {if (C_CRTSCTS (tty) || !tty_throttled (tty))
Signature · 1 line
2.16.1
Quoted 13 lines · Quytelda Kahja
Removed parenthesis causing a coding style warning.
Signed-off-by Quytelda Kahja <[email protected]>--- drivers/staging/fwserial/dma_fifo.c | 2 +- drivers/staging/fwserial/fwserial.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/staging/fwserial/dma_fifo.c +0
-0
drivers/staging/fwserial/dma_fifo.c int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete) · line 262
Quoted 5 lines
drivers/staging/fwserial/dma_fifo.c +1
-1@@ -259,7 +259,7 @@ int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)if (list_empty (&fifo->pending) && fifo->open ==0 )return -EINVAL ; - if (FAIL(fifo, list_empty(&fifo->pending) != (fifo->open == 0), + if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
No no no... You've changed what the code does here... I'm so surprised the compiler doesn't complain.
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
kbuild test robot
build botThank you for the patch! Perhaps something to improve:
Hi Quytelda,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.15 next-20180201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Quytelda-Kahja/Staging-fwserial-remove-unnecessary-parenthesis/20180202-093148
config: i386-randconfig-x019-201804 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce:
# save the attached .config to linux build tree
make ARCH=i386 All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:10:0,
from drivers/staging//fwserial/dma_fifo.c:8:
drivers/staging//fwserial/dma_fifo.c: In function 'dma_fifo_out_complete':
>> drivers/staging//fwserial/dma_fifo.c:253:44: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/staging//fwserial/dma_fifo.c:253:2: note: in expansion of macro 'if'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~
>> drivers/staging//fwserial/dma_fifo.c:253:6: note: in expansion of macro 'FAIL'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~~~
>> drivers/staging//fwserial/dma_fifo.c:253:44: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/staging//fwserial/dma_fifo.c:253:2: note: in expansion of macro 'if'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~
>> drivers/staging//fwserial/dma_fifo.c:253:6: note: in expansion of macro 'FAIL'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~~~
>> drivers/staging//fwserial/dma_fifo.c:253:44: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> drivers/staging//fwserial/dma_fifo.c:253:2: note: in expansion of macro 'if'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~
>> drivers/staging//fwserial/dma_fifo.c:253:6: note: in expansion of macro 'FAIL'
if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
^~~~vim +253 drivers/staging//fwserial/dma_fifo.c
236
237 /**
238 * dma_fifo_out_complete - marks pended dma as completed
239 * @fifo: address of in-place "struct dma_fifo" which was read from
240 * @complete: address of structure for previously pended dma to mark completed
241 */
242 int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)
243 {
244 struct dma_pending *pending, *next, *tmp;
245
246 if (!fifo->data)
247 return -ENOENT;
248 if (fifo->corrupt)
249 return -ENXIO;
250 if (list_empty(&fifo->pending) && fifo->open == 0)
251 return -EINVAL;
252
> 253 if (FAIL(fifo, list_empty(&fifo->pending) != fifo->open == 0,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation