lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 15 Mar 2017 12:00:02 +0800
From:   kbuild test robot <lkp@...el.com>
To:     mshan <educha997@...il.com>
Cc:     kbuild-all@...org, gregkh@...uxfoundation.org, domdevlin@...e.fr,
        bhumirks@...il.com, chopin.simon@...il.com, mohsinshan1k@...il.com,
        peter@...leysoftware.com, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fixed a minor coding style warning. Arguments in the
 macros should be coverd in brackets to aviod any precedence issues.

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

Download attachment ".config.gz" of type "application/gzip" (38845 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ