[gpio:gpio-descriptors-extcon-cleanup 3/4] drivers/extcon/extcon-gpio.c:85: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/linusw/linux-gpio.git gpio-descriptors-extcon-cleanup
head:   9409cd9bbfba06ffdeea264f2376f7bd0baee63a
commit: ab984ecf4e32c42e497dc38bb06d68b005c7e4d0 [3/4] extcon: gpio: Get connector type from device property
config: parisc-randconfig-a001-20200210 (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout ab984ecf4e32c42e497dc38bb06d68b005c7e4d0
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from include/linux/dev_printk.h:14:0,
                    from include/linux/device.h:15,
                    from include/linux/extcon.h:21,
                    from include/linux/extcon-provider.h:13,
                    from drivers/extcon/extcon-gpio.c:12:
   drivers/extcon/extcon-gpio.c: In function 'gpio_extcon_probe':
   drivers/extcon/extcon-gpio.c:85:10: error: 'struct gpio_extcon_data' has no member named 'extcon_id'
     if (data->extcon_id > EXTCON_NONE)
             ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/extcon/extcon-gpio.c:85:2: note: in expansion of macro 'if'
     if (data->extcon_id > EXTCON_NONE)
     ^~
   drivers/extcon/extcon-gpio.c:85:10: error: 'struct gpio_extcon_data' has no member named 'extcon_id'
     if (data->extcon_id > EXTCON_NONE)
             ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers/extcon/extcon-gpio.c:85:2: note: in expansion of macro 'if'
     if (data->extcon_id > EXTCON_NONE)
     ^~
   drivers/extcon/extcon-gpio.c:85:10: error: 'struct gpio_extcon_data' has no member named 'extcon_id'
     if (data->extcon_id > EXTCON_NONE)
             ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers/extcon/extcon-gpio.c:85:2: note: in expansion of macro 'if'
     if (data->extcon_id > EXTCON_NONE)
     ^~

vim +/if +85 drivers/extcon/extcon-gpio.c

176aa36012135d drivers/extcon/extcon-gpio.c Chanwoo Choi   2017-09-21  @12  #include <linux/extcon-provider.h>
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30   13  #include <linux/gpio/consumer.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   14  #include <linux/init.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   15  #include <linux/interrupt.h>
62364357c184db drivers/extcon/extcon-gpio.c George Cherian 2014-09-09   16  #include <linux/kernel.h>
62364357c184db drivers/extcon/extcon-gpio.c George Cherian 2014-09-09   17  #include <linux/module.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   18  #include <linux/platform_device.h>
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   19  #include <linux/property.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   20  #include <linux/slab.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   21  #include <linux/workqueue.h>
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   22  
66afdedf269cf4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   23  /**
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   24   * struct gpio_extcon_data - A simple GPIO-controlled extcon device state container.
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   25   * @edev:		Extcon device.
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   26   * @work:		Work fired by the interrupt.
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   27   * @debounce_jiffies:	Number of jiffies to wait for the GPIO to stabilize, from the debounce
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   28   *			value.
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   29   * @gpiod:		GPIO descriptor for this external connector.
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   30   * @connector_type:	The connector type we're detecting on this extcon, terminated with EXTCON_NONE
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   31   *			One GPIO is one cable, so one type only.
66afdedf269cf4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   32   * @check_on_resume:	Boolean describing whether to check the state of gpio
66afdedf269cf4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   33   *			while resuming from sleep.
66afdedf269cf4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   34   */
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   35  struct gpio_extcon_data {
60cd62d4f7d681 drivers/extcon/extcon-gpio.c Chanwoo Choi   2014-04-21   36  	struct extcon_dev *edev;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   37  	struct delayed_work work;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   38  	unsigned long debounce_jiffies;
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   39  	struct gpio_desc *gpiod;
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   40  	unsigned int connector_type[2];
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   41  	bool check_on_resume;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   42  };
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   43  
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   44  static void gpio_extcon_work(struct work_struct *work)
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   45  {
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   46  	int state;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   47  	struct gpio_extcon_data	*data =
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   48  		container_of(to_delayed_work(work), struct gpio_extcon_data,
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   49  			     work);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   50  
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   51  	state = gpiod_get_value_cansleep(data->gpiod);
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   52  	extcon_set_state_sync(data->edev, data->connector_type[0], state);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   53  }
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   54  
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   55  static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   56  {
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29   57  	struct gpio_extcon_data *data = dev_id;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   58  
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29   59  	queue_delayed_work(system_power_efficient_wq, &data->work,
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29   60  			      data->debounce_jiffies);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   61  	return IRQ_HANDLED;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   62  }
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   63  
44f34fd4a7f804 drivers/extcon/extcon-gpio.c Bill Pemberton 2012-11-19   64  static int gpio_extcon_probe(struct platform_device *pdev)
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   65  {
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29   66  	struct gpio_extcon_data *data;
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   67  	struct device *dev = &pdev->dev;
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   68  	unsigned long irq_flags;
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   69  	u32 debounce_usecs;
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24   70  	u32 connector_type;
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   71  	int irq;
1073514b11c221 drivers/extcon/extcon-gpio.c Guenter Roeck  2013-08-29   72  	int ret;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   73  
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   74  	data = devm_kzalloc(dev, sizeof(struct gpio_extcon_data), GFP_KERNEL);
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29   75  	if (!data)
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20   76  		return -ENOMEM;
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   77  
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   78  	/*
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   79  	 * FIXME: extcon_id represents the unique identifier of external
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   80  	 * connectors such as EXTCON_USB, EXTCON_DISP_HDMI and so on. extcon_id
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   81  	 * is necessary to register the extcon device. But, it's not yet
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   82  	 * developed to get the extcon id from device-tree or others.
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   83  	 * On later, it have to be solved.
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   84  	 */
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  @85  	if (data->extcon_id > EXTCON_NONE)
a62300d99f15c4 drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   86  		return -EINVAL;
60cd62d4f7d681 drivers/extcon/extcon-gpio.c Chanwoo Choi   2014-04-21   87  
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   88  	data->gpiod = devm_gpiod_get(dev, "extcon", GPIOD_IN);
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   89  	if (IS_ERR(data->gpiod))
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12   90  		return PTR_ERR(data->gpiod);
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   91  	irq = gpiod_to_irq(data->gpiod);
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   92  	if (irq <= 0)
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   93  		return irq;
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   94  
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   95  	/*
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   96  	 * It is unlikely that this is an acknowledged interrupt that goes
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   97  	 * away after handling, what we are looking for are falling edges
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   98  	 * if the signal is active low, and rising edges if the signal is
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30   99  	 * active high.
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  100  	 */
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  101  	if (gpiod_is_active_low(data->gpiod))
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  102  		irq_flags = IRQF_TRIGGER_FALLING;
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  103  	else
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  104  		irq_flags = IRQF_TRIGGER_RISING;
4288d9b8edcec7 drivers/extcon/extcon-gpio.c Guenter Roeck  2013-11-22  105  
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  106  	ret = device_property_read_u32(dev, "extcon-connector-types", &connector_type);
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  107  	if (ret || !connector_type) {
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  108  		dev_err(dev, "illegal cable type or undefined cable type\n");
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  109  		return -EINVAL;
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  110  	}
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  111  	data->connector_type[0] = connector_type;
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  112  	data->connector_type[1] = EXTCON_NONE;
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  113  
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  114  	/* Allocate the memory of extcon devie and register extcon device */
ab984ecf4e32c4 drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  115  	data->edev = devm_extcon_dev_allocate(dev, data->connector_type);
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  116  	if (IS_ERR(data->edev)) {
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12  117  		dev_err(dev, "failed to allocate extcon device\n");
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  118  		return -ENOMEM;
338de0ca682ca9 drivers/extcon/extcon-gpio.c Guenter Roeck  2013-09-10  119  	}
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  120  
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  121  	ret = device_property_read_u32(dev, "input-debounce", &debounce_usecs);
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  122  	if (ret || !debounce_usecs) {
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  123  		dev_err(dev, "illegal debounce value, set to 20 ms\n");
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  124  		debounce_usecs = 20000;
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  125  	}
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  126  	ret = gpiod_set_debounce(data->gpiod, debounce_usecs);
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  127  	if (ret)
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  128  		data->debounce_jiffies = msecs_to_jiffies(debounce_usecs * 1000);
17ca6c83c514ff drivers/extcon/extcon-gpio.c Linus Walleij  2017-09-24  129  
d368e7de5e8bac drivers/extcon/extcon-gpio.c Linus Walleij  2018-02-12  130  	ret = devm_extcon_dev_register(dev, data->edev);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  131  	if (ret < 0)
01eaf2458773b2 drivers/extcon/extcon_gpio.c Axel Lin       2012-06-16  132  		return ret;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  133  
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29  134  	INIT_DELAYED_WORK(&data->work, gpio_extcon_work);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  135  
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  136  	/*
b51b387020ee1c drivers/extcon/extcon-gpio.c Moritz Fischer 2015-12-23  137  	 * Request the interrupt of gpio to detect whether external connector
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  138  	 * is attached or detached.
de992acb93df41 drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-30  139  	 */
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  140  	ret = devm_request_any_context_irq(dev, irq,
8bc4810b435a33 drivers/extcon/extcon-gpio.c Linus Walleij  2019-05-30  141  					gpio_irq_handler, irq_flags,
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29  142  					pdev->name, data);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  143  	if (ret < 0)
d92c2f12f8a940 drivers/extcon/extcon-gpio.c Sangjung Woo   2014-04-21  144  		return ret;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  145  
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29  146  	platform_set_drvdata(pdev, data);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  147  	/* Perform initial detection */
60f9b9e65c82cc drivers/extcon/extcon-gpio.c Chanwoo Choi   2015-09-29  148  	gpio_extcon_work(&data->work.work);
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  149  
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  150  	return 0;
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  151  }
be48308a24c765 drivers/extcon/extcon_gpio.c MyungJoo Ham   2012-04-20  152  

:::::: The code at line 85 was first introduced by commit
:::::: 8bc4810b435a3338346efd70e94c4d6fd0863635 extcon: gpio: Request reasonable interrupts

:::::: TO: Linus Walleij <linus.walleij@xxxxxxxxxx>
:::::: CC: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux