linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coding Style fix in drivers/staging/fwserial
@ 2017-03-14  6:02 mshan
  2017-03-14  6:02 ` [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues mshan
  0 siblings, 1 reply; 7+ messages in thread
From: mshan @ 2017-03-14  6:02 UTC (permalink / raw)
  To: gregkh, domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter,
	devel, linux-kernel

Arguments in the macros should be coverd in brackets to aviod any 
precedence issues. Fixed it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
  2017-03-14  6:02 Coding Style fix in drivers/staging/fwserial mshan
@ 2017-03-14  6:02 ` mshan
  2017-03-14  9:46   ` Dan Carpenter
  2017-03-15  4:00   ` kbuild test robot
  0 siblings, 2 replies; 7+ messages in thread
From: mshan @ 2017-03-14  6:02 UTC (permalink / raw)
  To: gregkh, domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter,
	devel, linux-kernel

Signed-off-by: mshan <mohsinshan1k@gmail.com>
---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 41a49c8..d693c03 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -98,7 +98,7 @@ struct fwtty_transaction {
 	};
 };
 
-#define to_device(a, b)			(a->b)
+#define to_device(a, b)			((a)->(b))
 #define fwtty_err(p, fmt, ...)						\
 	dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
 #define fwtty_info(p, fmt, ...)						\
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
  2017-03-14  6:02 ` [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues mshan
@ 2017-03-14  9:46   ` Dan Carpenter
  2017-03-15  4:00   ` kbuild test robot
  1 sibling, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2017-03-14  9:46 UTC (permalink / raw)
  To: mshan
  Cc: gregkh, domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter,
	devel, linux-kernel


Didn't work.  Send the patch to yourself until you figure it out.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
  2017-03-14  6:02 ` [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues mshan
  2017-03-14  9:46   ` Dan Carpenter
@ 2017-03-15  4:00   ` kbuild test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2017-03-15  4:00 UTC (permalink / raw)
  To: mshan
  Cc: kbuild-all, gregkh, domdevlin, bhumirks, chopin.simon,
	mohsinshan1k, peter, devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 23804 bytes --]

Hi mshan,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc2 next-20170310]
[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/mshan/Fixed-a-minor-coding-style-warning-Arguments-in-the-macros-should-be-coverd-in-brackets-to-aviod-any-precedence-issues/20170315-084955
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from drivers/staging/fwserial/fwserial.c:21:0:
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_log_tx_error':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:201:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "card busy\n");
      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:204:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "bad unit addr or write length\n");
      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:207:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "failed rx\n");
      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:210:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "missing ack\n");
      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:213:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "remote busy\n");
      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:216:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "failed tx: %d\n", rcode);
      ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:329:0,
                    from include/linux/kernel.h:13,
                    from arch/x86/include/asm/percpu.h:44,
                    from arch/x86/include/asm/current.h:5,
                    from include/linux/sched.h:11,
                    from drivers/staging/fwserial/fwserial.c:19:
   drivers/staging/fwserial/fwserial.c: In function '__fwtty_restart_tx':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:290:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "fifo len: %d avail: %d\n", len, avail);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_update_port_status':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:327:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "status: %x delta: %x\n", status, delta);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_emit_breaks':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:523:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "sending %d brks\n", n);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_rx':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:547:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "%d\n", n);
     ^~~~~~~~~
   In file included from drivers/staging/fwserial/fwserial.c:21:0:
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:587:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "flip buffer overrun\n");
      ^~~~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_port_handler':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:630:3: note: in expansion of macro 'fwtty_err_ratelimited'
      fwtty_err_ratelimited(port, "ignoring unauthenticated data\n");
      ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:329:0,
                    from include/linux/kernel.h:13,
                    from arch/x86/include/asm/percpu.h:44,
                    from arch/x86/include/asm/current.h:5,
                    from include/linux/sched.h:11,
                    from drivers/staging/fwserial/fwserial.c:19:
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_tx_complete':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:687:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "rcode: %d\n", rcode);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_tx':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:750:3: note: in expansion of macro 'fwtty_dbg'
      fwtty_dbg(port, "out: %u rem: %d\n", txn->dma_pended.len, n);
      ^~~~~~~~~
   In file included from drivers/staging/fwserial/fwserial.c:21:0:
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/device.h:1377:13: note: in definition of macro 'dev_level_ratelimited'
      dev_level(dev, fmt, ##__VA_ARGS__);   \
                ^~~
   drivers/staging/fwserial/fwserial.c:111:2: note: in expansion of macro 'dev_err_ratelimited'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~~
   drivers/staging/fwserial/fwserial.c:111:22: note: in expansion of macro 'to_device'
     dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
                         ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:760:5: note: in expansion of macro 'fwtty_err_ratelimited'
        fwtty_err_ratelimited(port, "fifo err: %d\n",
        ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:329:0,
                    from include/linux/kernel.h:13,
                    from arch/x86/include/asm/percpu.h:44,
                    from arch/x86/include/asm/current.h:5,
                    from include/linux/sched.h:11,
                    from drivers/staging/fwserial/fwserial.c:19:
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_write_xchar':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:820:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "%02x\n", ch);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_port_dtr_rts':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:905:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "on/off: %d\n", on);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_port_carrier_raised':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:933:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "%d\n", rc);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_write':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:1111:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "%d\n", c);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_write_room':
>> drivers/staging/fwserial/fwserial.c:101:33: error: expected identifier before '(' token
    #define to_device(a, b)   ((a)->(b))
                                    ^
   include/linux/dynamic_debug.h:134:34: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                     ^~~
   drivers/staging/fwserial/fwserial.c:109:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
     ^~~~~~~
   drivers/staging/fwserial/fwserial.c:109:10: note: in expansion of macro 'to_device'
     dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
             ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c:1138:2: note: in expansion of macro 'fwtty_dbg'
     fwtty_dbg(port, "%d\n", n);
     ^~~~~~~~~
   drivers/staging/fwserial/fwserial.c: In function 'fwtty_chars_in_buffer':

vim +101 drivers/staging/fwserial/fwserial.c

    15	 */
    16	
    17	#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    18	
    19	#include <linux/sched.h>
    20	#include <linux/slab.h>
  > 21	#include <linux/device.h>
    22	#include <linux/mod_devicetable.h>
    23	#include <linux/rculist.h>
    24	#include <linux/workqueue.h>
    25	#include <linux/ratelimit.h>
    26	#include <linux/bug.h>
    27	#include <linux/uaccess.h>
    28	
    29	#include "fwserial.h"
    30	
    31	#define be32_to_u64(hi, lo)  ((u64)be32_to_cpu(hi) << 32 | be32_to_cpu(lo))
    32	
    33	#define LINUX_VENDOR_ID   0xd00d1eU  /* same id used in card root directory   */
    34	#define FWSERIAL_VERSION  0x00e81cU  /* must be unique within LINUX_VENDOR_ID */
    35	
    36	/* configurable options */
    37	static int num_ttys = 4;	    /* # of std ttys to create per fw_card    */
    38					    /* - doubles as loopback port index       */
    39	static bool auto_connect = true;    /* try to VIRT_CABLE to every peer        */
    40	static bool create_loop_dev = true; /* create a loopback device for each card */
    41	
    42	module_param_named(ttys, num_ttys, int, 0644);
    43	module_param_named(auto, auto_connect, bool, 0644);
    44	module_param_named(loop, create_loop_dev, bool, 0644);
    45	
    46	/*
    47	 * Threshold below which the tty is woken for writing
    48	 * - should be equal to WAKEUP_CHARS in drivers/tty/n_tty.c because
    49	 *   even if the writer is woken, n_tty_poll() won't set POLLOUT until
    50	 *   our fifo is below this level
    51	 */
    52	#define WAKEUP_CHARS             256
    53	
    54	/**
    55	 * fwserial_list: list of every fw_serial created for each fw_card
    56	 * See discussion in fwserial_probe.
    57	 */
    58	static LIST_HEAD(fwserial_list);
    59	static DEFINE_MUTEX(fwserial_list_mutex);
    60	
    61	/**
    62	 * port_table: array of tty ports allocated to each fw_card
    63	 *
    64	 * tty ports are allocated during probe when an fw_serial is first
    65	 * created for a given fw_card. Ports are allocated in a contiguous block,
    66	 * each block consisting of 'num_ports' ports.
    67	 */
    68	static struct fwtty_port *port_table[MAX_TOTAL_PORTS];
    69	static DEFINE_MUTEX(port_table_lock);
    70	static bool port_table_corrupt;
    71	#define FWTTY_INVALID_INDEX  MAX_TOTAL_PORTS
    72	
    73	#define loop_idx(port)	(((port)->index) / num_ports)
    74	#define table_idx(loop)	((loop) * num_ports + num_ttys)
    75	
    76	/* total # of tty ports created per fw_card */
    77	static int num_ports;
    78	
    79	/* slab used as pool for struct fwtty_transactions */
    80	static struct kmem_cache *fwtty_txn_cache;
    81	
    82	struct tty_driver *fwtty_driver;
    83	static struct tty_driver *fwloop_driver;
    84	
    85	static struct dentry *fwserial_debugfs;
    86	
    87	struct fwtty_transaction;
    88	typedef void (*fwtty_transaction_cb)(struct fw_card *card, int rcode,
    89					     void *data, size_t length,
    90					     struct fwtty_transaction *txn);
    91	
    92	struct fwtty_transaction {
    93		struct fw_transaction      fw_txn;
    94		fwtty_transaction_cb       callback;
    95		struct fwtty_port	   *port;
    96		union {
    97			struct dma_pending dma_pended;
    98		};
    99	};
   100	
 > 101	#define to_device(a, b)			((a)->(b))
   102	#define fwtty_err(p, fmt, ...)						\
   103		dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
   104	#define fwtty_info(p, fmt, ...)						\

---
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: 38845 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
  2017-03-14  4:52 mshan
  2017-03-14  5:47 ` Greg KH
@ 2017-03-14  9:40 ` Dan Carpenter
  1 sibling, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2017-03-14  9:40 UTC (permalink / raw)
  To: mshan
  Cc: gregkh, domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter,
	devel, linux-kernel

On Mon, Mar 13, 2017 at 09:52:14PM -0700, mshan wrote:
> Signed-off-by: mshan <mohsinshan1k@gmail.com>
> ---
>  drivers/staging/fwserial/fwserial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
> index 41a49c8..d693c03 100644
> --- a/drivers/staging/fwserial/fwserial.c
> +++ b/drivers/staging/fwserial/fwserial.c
> @@ -98,7 +98,7 @@ struct fwtty_transaction {
>  	};
>  };
>  
> -#define to_device(a, b)			(a->b)
> +#define to_device(a, b)			((a)->(b))

This macro is silly.  Just delete it.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
  2017-03-14  4:52 mshan
@ 2017-03-14  5:47 ` Greg KH
  2017-03-14  9:40 ` Dan Carpenter
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-03-14  5:47 UTC (permalink / raw)
  To: mshan
  Cc: domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter, devel,
	linux-kernel

On Mon, Mar 13, 2017 at 09:52:14PM -0700, mshan wrote:
> Signed-off-by: mshan <mohsinshan1k@gmail.com>
> ---
>  drivers/staging/fwserial/fwserial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
@ 2017-03-14  4:52 mshan
  2017-03-14  5:47 ` Greg KH
  2017-03-14  9:40 ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: mshan @ 2017-03-14  4:52 UTC (permalink / raw)
  To: gregkh, domdevlin, bhumirks, chopin.simon, mohsinshan1k, peter,
	devel, linux-kernel

Signed-off-by: mshan <mohsinshan1k@gmail.com>
---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 41a49c8..d693c03 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -98,7 +98,7 @@ struct fwtty_transaction {
 	};
 };
 
-#define to_device(a, b)			(a->b)
+#define to_device(a, b)			((a)->(b))
 #define fwtty_err(p, fmt, ...)						\
 	dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
 #define fwtty_info(p, fmt, ...)						\
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-15  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14  6:02 Coding Style fix in drivers/staging/fwserial mshan
2017-03-14  6:02 ` [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues mshan
2017-03-14  9:46   ` Dan Carpenter
2017-03-15  4:00   ` kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2017-03-14  4:52 mshan
2017-03-14  5:47 ` Greg KH
2017-03-14  9:40 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).