* Re: [PATCH] Staging: fwserial: remove unnecessary parenthesis
2018-02-01 5:39 [PATCH] Staging: fwserial: remove unnecessary parenthesis Quytelda Kahja
@ 2018-02-01 8:23 ` Dan Carpenter
2018-02-02 2:14 ` kbuild test robot
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-02-01 8:23 UTC (permalink / raw)
To: Quytelda Kahja; +Cc: devel, gregkh, linux-kernel
On Wed, Jan 31, 2018 at 09:39:51PM -0800, Quytelda Kahja wrote:
> Removed parenthesis causing a coding style warning.
>
> Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
> ---
> drivers/staging/fwserial/dma_fifo.c | 2 +-
> drivers/staging/fwserial/fwserial.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/fwserial/dma_fifo.c b/drivers/staging/fwserial/dma_fifo.c
> index 8b23a553fd4a..ead71f93f3c9 100644
> --- a/drivers/staging/fwserial/dma_fifo.c
> +++ b/drivers/staging/fwserial/dma_fifo.c
> @@ -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
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Staging: fwserial: remove unnecessary parenthesis
2018-02-01 5:39 [PATCH] Staging: fwserial: remove unnecessary parenthesis Quytelda Kahja
2018-02-01 8:23 ` Dan Carpenter
@ 2018-02-02 2:14 ` kbuild test robot
1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2018-02-02 2:14 UTC (permalink / raw)
To: Quytelda Kahja; +Cc: kbuild-all, gregkh, devel, Quytelda Kahja, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3925 bytes --]
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
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41281 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread