[bluetooth-next:master 20/21] drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
head:   0435605289298a7311f78d02eb6a015cae7dbaf7
commit: 8a92056837fd5168fce730c5e21eaf3af7cf0b16 [20/21] Bluetooth: hci_bcm: Add (runtime)pm support to the serdev driver
config: i386-randconfig-b0-10070747 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
        git checkout 8a92056837fd5168fce730c5e21eaf3af7cf0b16
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from drivers/bluetooth/hci_bcm.c:24:
   drivers/bluetooth/hci_bcm.c: In function 'bcm_device_exists':
   drivers/bluetooth/hci_bcm.c:156:22: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                         ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c:156:36: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                                       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c:156:22: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                         ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c:156:36: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                                       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c:156:22: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                         ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c:156:36: error: 'struct bcm_device' has no member named 'hu'
     if (device && device->hu && device->hu->serdev)
                                       ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> drivers/bluetooth/hci_bcm.c:156:2: note: in expansion of macro 'if'
     if (device && device->hu && device->hu->serdev)
     ^
   drivers/bluetooth/hci_bcm.c: In function 'bcm_serdev_probe':
   drivers/bluetooth/hci_bcm.c:968:8: error: 'struct bcm_device' has no member named 'hu'
     bcmdev->hu = &bcmdev->serdev_hu;
           ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from drivers/bluetooth/hci_bcm.c:24:
   drivers/bluetooth/hci_bcm.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:379:2: note: in expansion of macro 'if'
     if (p_size < size || q_size < size)
     ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:376:3: note: in expansion of macro 'if'
      if (q_size < size)
      ^
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^
   include/linux/string.h:374:3: note: in expansion of macro 'if'
      if (p_size < size)
      ^

vim +/if +156 drivers/bluetooth/hci_bcm.c

  > 24	#include <linux/kernel.h>
    25	#include <linux/errno.h>
    26	#include <linux/skbuff.h>
    27	#include <linux/firmware.h>
    28	#include <linux/module.h>
    29	#include <linux/acpi.h>
    30	#include <linux/of.h>
    31	#include <linux/property.h>
    32	#include <linux/platform_device.h>
    33	#include <linux/clk.h>
    34	#include <linux/gpio/consumer.h>
    35	#include <linux/tty.h>
    36	#include <linux/interrupt.h>
    37	#include <linux/dmi.h>
    38	#include <linux/pm_runtime.h>
    39	#include <linux/serdev.h>
    40	
    41	#include <net/bluetooth/bluetooth.h>
    42	#include <net/bluetooth/hci_core.h>
    43	
    44	#include "btbcm.h"
    45	#include "hci_uart.h"
    46	
    47	#define BCM_NULL_PKT 0x00
    48	#define BCM_NULL_SIZE 0
    49	
    50	#define BCM_LM_DIAG_PKT 0x07
    51	#define BCM_LM_DIAG_SIZE 63
    52	
    53	#define BCM_AUTOSUSPEND_DELAY	5000 /* default autosleep delay */
    54	
    55	/* device driver resources */
    56	struct bcm_device {
    57		/* Must be the first member, hci_serdev.c expects this. */
    58		struct hci_uart		serdev_hu;
    59		struct list_head	list;
    60	
    61		struct device		*dev;
    62	
    63		const char		*name;
    64		struct gpio_desc	*device_wakeup;
    65		struct gpio_desc	*shutdown;
    66	
    67		struct clk		*clk;
    68		bool			clk_enabled;
    69	
    70		u32			init_speed;
    71		u32			oper_speed;
    72		int			irq;
    73		bool			irq_active_low;
    74	
    75	#ifdef CONFIG_PM
    76		struct hci_uart		*hu;
    77		bool			is_suspended; /* suspend/resume flag */
    78	#endif
    79	};
    80	
    81	/* generic bcm uart resources */
    82	struct bcm_data {
    83		struct sk_buff		*rx_skb;
    84		struct sk_buff_head	txq;
    85	
    86		struct bcm_device	*dev;
    87	};
    88	
    89	/* List of BCM BT UART devices */
    90	static DEFINE_MUTEX(bcm_device_lock);
    91	static LIST_HEAD(bcm_device_list);
    92	
    93	static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
    94	{
    95		if (hu->serdev)
    96			serdev_device_set_baudrate(hu->serdev, speed);
    97		else
    98			hci_uart_set_baudrate(hu, speed);
    99	}
   100	
   101	static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
   102	{
   103		struct hci_dev *hdev = hu->hdev;
   104		struct sk_buff *skb;
   105		struct bcm_update_uart_baud_rate param;
   106	
   107		if (speed > 3000000) {
   108			struct bcm_write_uart_clock_setting clock;
   109	
   110			clock.type = BCM_UART_CLOCK_48MHZ;
   111	
   112			bt_dev_dbg(hdev, "Set Controller clock (%d)", clock.type);
   113	
   114			/* This Broadcom specific command changes the UART's controller
   115			 * clock for baud rate > 3000000.
   116			 */
   117			skb = __hci_cmd_sync(hdev, 0xfc45, 1, &clock, HCI_INIT_TIMEOUT);
   118			if (IS_ERR(skb)) {
   119				int err = PTR_ERR(skb);
   120				bt_dev_err(hdev, "BCM: failed to write clock (%d)",
   121					   err);
   122				return err;
   123			}
   124	
   125			kfree_skb(skb);
   126		}
   127	
   128		bt_dev_dbg(hdev, "Set Controller UART speed to %d bit/s", speed);
   129	
   130		param.zero = cpu_to_le16(0);
   131		param.baud_rate = cpu_to_le32(speed);
   132	
   133		/* This Broadcom specific command changes the UART's controller baud
   134		 * rate.
   135		 */
   136		skb = __hci_cmd_sync(hdev, 0xfc18, sizeof(param), &param,
   137				     HCI_INIT_TIMEOUT);
   138		if (IS_ERR(skb)) {
   139			int err = PTR_ERR(skb);
   140			bt_dev_err(hdev, "BCM: failed to write update baudrate (%d)",
   141				   err);
   142			return err;
   143		}
   144	
   145		kfree_skb(skb);
   146	
   147		return 0;
   148	}
   149	
   150	/* bcm_device_exists should be protected by bcm_device_lock */
   151	static bool bcm_device_exists(struct bcm_device *device)
   152	{
   153		struct list_head *p;
   154	
   155		/* Devices using serdev always exist */
 > 156		if (device && device->hu && device->hu->serdev)
   157			return true;
   158	
   159		list_for_each(p, &bcm_device_list) {
   160			struct bcm_device *dev = list_entry(p, struct bcm_device, list);
   161	
   162			if (device == dev)
   163				return true;
   164		}
   165	
   166		return false;
   167	}
   168	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux