[gpio:devel-cleanup-irqchip-threaded 1/1] include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast

[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 devel-cleanup-irqchip-threaded
head:   bf5b241314ea9d338b03df6f54b7c02113ab0f87
commit: bf5b241314ea9d338b03df6f54b7c02113ab0f87 [1/1] gpio: Handle generic and threaded IRQs on gpio irqchips
config: openrisc-or1ksim_defconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.2.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 bf5b241314ea9d338b03df6f54b7c02113ab0f87
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=openrisc 

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

All error/warnings (new ones prefixed by >>):

   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib.c:13:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib.c:13:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib.c:17:
   include/linux/gpio/driver.h: At top level:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from drivers/gpio/gpiolib.h:12,
                    from drivers/gpio/gpiolib.c:31:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   drivers/gpio/gpiolib.c: In function 'gpiochip_get_desc':
   drivers/gpio/gpiolib.c:145:33: error: dereferencing pointer to incomplete type 'struct gpio_chip'
     145 |  struct gpio_device *gdev = chip->gpiodev;
         |                                 ^~
   drivers/gpio/gpiolib.c: At top level:
   drivers/gpio/gpiolib.c:174:19: error: conflicting types for 'gpiod_to_chip'
     174 | struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
         |                   ^~~~~~~~~~~~~
   In file included from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib.c:13:
   include/asm-generic/gpio.h:61:9: note: previous implicit declaration of 'gpiod_to_chip' was here
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
   In file included from arch/openrisc/include/asm/bitops.h:25,
                    from include/linux/bitops.h:29,
                    from include/linux/bitmap.h:8,
                    from drivers/gpio/gpiolib.c:2:
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_valid':
   drivers/gpio/gpiolib.c:413:22: error: dereferencing pointer to incomplete type 'const struct gpio_chip'
     413 |  if (likely(!gpiochip->valid_mask))
         |                      ^~
   include/linux/compiler.h:77:40: note: in definition of macro 'likely'
      77 | # define likely(x) __builtin_expect(!!(x), 1)
         |                                        ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_add_data_with_key':
   drivers/gpio/gpiolib.c:1571:2: error: implicit declaration of function 'gpiochip_remove_pin_ranges'; did you mean 'gpiochip_add_pin_ranges'? [-Werror=implicit-function-declaration]
    1571 |  gpiochip_remove_pin_ranges(chip);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
         |  gpiochip_add_pin_ranges
   drivers/gpio/gpiolib.c: In function 'devm_gpiochip_add_data':
   drivers/gpio/gpiolib.c:1692:8: error: implicit declaration of function 'gpiochip_add_data'; did you mean 'gpiochip_get_data'? [-Werror=implicit-function-declaration]
    1692 |  ret = gpiochip_add_data(chip, data);
         |        ^~~~~~~~~~~~~~~~~
         |        gpiochip_get_data
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_valid':
   drivers/gpio/gpiolib.c:416:1: warning: control reaches end of non-void function [-Wreturn-type]
     416 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_get_data':
   drivers/gpio/gpiolib.c:1603:1: warning: control reaches end of non-void function [-Wreturn-type]
    1603 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_generic_request':
   drivers/gpio/gpiolib.c:2610:1: warning: control reaches end of non-void function [-Wreturn-type]
    2610 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_generic_config':
   drivers/gpio/gpiolib.c:2634:1: warning: control reaches end of non-void function [-Wreturn-type]
    2634 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpio_set_config':
   drivers/gpio/gpiolib.c:3045:1: warning: control reaches end of non-void function [-Wreturn-type]
    3045 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiod_cansleep':
   drivers/gpio/gpiolib.c:3912:1: warning: control reaches end of non-void function [-Wreturn-type]
    3912 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_irq':
   drivers/gpio/gpiolib.c:4076:1: warning: control reaches end of non-void function [-Wreturn-type]
    4076 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_open_drain':
   drivers/gpio/gpiolib.c:4109:1: warning: control reaches end of non-void function [-Wreturn-type]
    4109 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_open_source':
   drivers/gpio/gpiolib.c:4118:1: warning: control reaches end of non-void function [-Wreturn-type]
    4118 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_line_is_persistent':
   drivers/gpio/gpiolib.c:4127:1: warning: control reaches end of non-void function [-Wreturn-type]
    4127 | }
         | ^
   drivers/gpio/gpiolib.c: In function 'gpiochip_match_name':
   drivers/gpio/gpiolib.c:1742:1: warning: control reaches end of non-void function [-Wreturn-type]
    1742 | }
         | ^
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib-devres.c:11:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib.h:12,
                    from drivers/gpio/gpiolib-devres.c:16:
   include/linux/gpio/driver.h: At top level:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   cc1: some warnings being treated as errors
--
   In file included from drivers/gpio/gpiolib-legacy.c:3:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib-legacy.c:5:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from drivers/gpio/gpiolib-legacy.c:5:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib.h:12,
                    from drivers/gpio/gpiolib-legacy.c:7:
   include/linux/gpio/driver.h: At top level:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from include/linux/of_gpio.h:16,
                    from drivers/gpio/gpiolib-of.c:18:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from include/linux/of_gpio.h:16,
                    from drivers/gpio/gpiolib-of.c:18:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib-of.c:18:
   include/linux/of_gpio.h: At top level:
   include/linux/of_gpio.h:41:19: error: field 'gc' has incomplete type
      41 |  struct gpio_chip gc;
         |                   ^~
   In file included from include/linux/dev_printk.h:14,
                    from include/linux/device.h:15,
                    from drivers/gpio/gpiolib-of.c:10:
   include/linux/of_gpio.h: In function 'to_of_mm_gpio_chip':
   include/linux/kernel.h:987:32: error: dereferencing pointer to incomplete type 'struct gpio_chip'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                                ^~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
     330 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |  ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                    ^~~~~~~~~~~
   include/linux/of_gpio.h:48:9: note: in expansion of macro 'container_of'
      48 |  return container_of(gc, struct of_mm_gpio_chip, gc);
         |         ^~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib.h:12,
                    from drivers/gpio/gpiolib-of.c:23:
   include/linux/gpio/driver.h: At top level:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   drivers/gpio/gpiolib-of.c: In function 'of_find_gpiochip_by_xlate':
>> drivers/gpio/gpiolib-of.c:92:9: error: implicit declaration of function 'gpiochip_find' [-Werror=implicit-function-declaration]
      92 |  return gpiochip_find(gpiospec, of_gpiochip_match_node_and_xlate);
         |         ^~~~~~~~~~~~~
>> drivers/gpio/gpiolib-of.c:92:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      92 |  return gpiochip_find(gpiospec, of_gpiochip_match_node_and_xlate);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpio/gpiolib-of.c: In function 'of_gpio_need_valid_mask':
   drivers/gpio/gpiolib-of.c:121:29: error: dereferencing pointer to incomplete type 'const struct gpio_chip'
     121 |  struct device_node *np = gc->of_node;
         |                             ^~
   drivers/gpio/gpiolib-of.c: In function 'of_mm_gpiochip_add_data':
>> drivers/gpio/gpiolib-of.c:725:8: error: implicit declaration of function 'gpiochip_add_data' [-Werror=implicit-function-declaration]
     725 |  ret = gpiochip_add_data(gc, data);
         |        ^~~~~~~~~~~~~~~~~
   drivers/gpio/gpiolib-of.c: In function 'of_mm_gpiochip_remove':
   drivers/gpio/gpiolib-of.c:751:2: error: implicit declaration of function 'gpiochip_remove'; did you mean 'of_gpiochip_remove'? [-Werror=implicit-function-declaration]
     751 |  gpiochip_remove(gc);
         |  ^~~~~~~~~~~~~~~
         |  of_gpiochip_remove
   drivers/gpio/gpiolib-of.c: In function 'of_gpiochip_add':
>> drivers/gpio/gpiolib-of.c:888:3: error: implicit declaration of function 'devprop_gpiochip_set_names' [-Werror=implicit-function-declaration]
     888 |   devprop_gpiochip_set_names(chip,
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpio/gpiolib-of.c:16:
   include/linux/of.h:175:28: error: invalid type argument of '->' (have 'int')
     175 |    &__of_fwnode_handle_node->fwnode : NULL; \
         |                            ^~
   drivers/gpio/gpiolib-of.c:889:9: note: in expansion of macro 'of_fwnode_handle'
     889 |         of_fwnode_handle(chip->of_node));
         |         ^~~~~~~~~~~~~~~~
   drivers/gpio/gpiolib-of.c: In function 'of_gpiochip_match_node_and_xlate':
   drivers/gpio/gpiolib-of.c:87:1: warning: control reaches end of non-void function [-Wreturn-type]
      87 | }
         | ^
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from drivers/net/phy/mdio_bus.c:20:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from drivers/net/phy/mdio_bus.c:20:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/net/phy/mdio_bus.c:24:
   include/linux/of_gpio.h: At top level:
   include/linux/of_gpio.h:41:19: error: field 'gc' has incomplete type
      41 |  struct gpio_chip gc;
         |                   ^~
   In file included from include/linux/kernel.h:11,
                    from drivers/net/phy/mdio_bus.c:11:
   include/linux/of_gpio.h: In function 'to_of_mm_gpio_chip':
   include/linux/kernel.h:987:32: error: dereferencing pointer to incomplete type 'struct gpio_chip'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                                ^~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
     330 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |  ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                    ^~~~~~~~~~~
   include/linux/of_gpio.h:48:9: note: in expansion of macro 'container_of'
      48 |  return container_of(gc, struct of_mm_gpio_chip, gc);
         |         ^~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/asm-generic/gpio.h:13,
                    from include/linux/gpio.h:62,
                    from drivers/net/phy/mdio_device.c:10:
   include/linux/gpio/driver.h:2: error: unterminated #ifndef
       2 | #ifndef __LINUX_GPIO_DRIVER_H
         | 
   In file included from include/linux/gpio.h:62,
                    from drivers/net/phy/mdio_device.c:10:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:61:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~
         |         gpio_to_chip
>> include/asm-generic/gpio.h:61:9: warning: returning 'int' from a function with return type 'struct gpio_chip *' makes pointer from integer without a cast [-Wint-conversion]
      61 |  return gpiod_to_chip(gpio_to_desc(gpio));
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
..

vim +61 include/asm-generic/gpio.h

d2876d08d86f22 David Brownell    2008-02-04  57  
79a9becda8940d Alexandre Courbot 2013-10-17  58  /* caller holds gpio_lock *OR* gpio is marked as requested */
79a9becda8940d Alexandre Courbot 2013-10-17  59  static inline struct gpio_chip *gpio_to_chip(unsigned gpio)
79a9becda8940d Alexandre Courbot 2013-10-17  60  {
79a9becda8940d Alexandre Courbot 2013-10-17 @61  	return gpiod_to_chip(gpio_to_desc(gpio));
79a9becda8940d Alexandre Courbot 2013-10-17  62  }
d2876d08d86f22 David Brownell    2008-02-04  63  

:::::: The code at line 61 was first introduced by commit
:::::: 79a9becda8940deb2274b5aa4577c86d52ee7ecb gpiolib: export descriptor-based GPIO interface

:::::: TO: Alexandre Courbot <acourbot@xxxxxxxxxx>
:::::: CC: Linus Walleij <linus.walleij@xxxxxxxxxx>

---
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