tree:
https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 5342fd3d769c58688aad5088b77b3c9f44438ef7
commit: e3b73159b8cfd2c940dd6e55702754c16f1f3923 [5/10] mfd: intel-ehl-gpio: Introduce MFD
framework to PSE GPIO/TGPIO
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/intel/linux-intel-lts/commit/e3b73159b8cfd2c940dd6e557...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout e3b73159b8cfd2c940dd6e55702754c16f1f3923
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/gpio/gpio-ehl-pse-plat.c:79:6: warning: no previous
prototype for 'ehl_pse_gpio_free' [-Wmissing-prototypes]
79 | void
ehl_pse_gpio_free(struct gpio_chip *chip, unsigned int offset)
| ^~~~~~~~~~~~~~~~~
drivers/gpio/gpio-ehl-pse-plat.c: In function 'ehl_pse_gpio_get_direction':
> drivers/gpio/gpio-ehl-pse-plat.c:175:2: warning: ISO C90 forbids
mixed declarations and code [-Wdeclaration-after-statement]
175 | u32 reg_gpdr
= intel_gpio_readl(priv->reg_base, GPDR);
| ^~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/compiler.h:180,
from include/linux/ioport.h:13,
from include/linux/acpi.h:12,
from drivers/gpio/gpio-ehl-pse-plat.c:9:
drivers/gpio/gpio-ehl-pse-plat.c: In function 'ehl_pse_gpio_probe':
> include/linux/stddef.h:8:14: warning: returning 'void *'
from a function with return type 'int' makes integer from pointer without a cast
[-Wint-conversion]
8 | #define NULL ((void *)0)
| ^
drivers/gpio/gpio-ehl-pse-plat.c:378:10: note: in expansion of macro 'NULL'
378 | return NULL;
| ^~~~
drivers/gpio/gpio-ehl-pse-plat.c:381:10: warning: comparison of unsigned expression
< 0 is always false [-Wtype-limits]
381 | if (irq < 0)
| ^
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/compiler.h:180,
from include/linux/ioport.h:13,
from include/linux/acpi.h:12,
from drivers/gpio/gpio-ehl-pse-plat.c:9:
> include/linux/stddef.h:8:14: warning: returning 'void *'
from a function with return type 'int' makes integer from pointer without a cast
[-Wint-conversion]
8 | #define NULL ((void *)0)
| ^
drivers/gpio/gpio-ehl-pse-plat.c:382:10: note: in expansion of macro 'NULL'
382 | return NULL;
| ^~~~
drivers/gpio/gpio-ehl-pse-plat.c:365:16: warning: unused variable 'base'
[-Wunused-variable]
365 | void __iomem *base;
| ^~~~
--
drivers/mfd/intel-ehl-gpio.c: In function 'intel_ehl_pse_gpio_mfd_suspend':
drivers/mfd/intel-ehl-gpio.c:135:6: warning: unused variable 'i'
[-Wunused-variable]
135 | int i = 0;
| ^
drivers/mfd/intel-ehl-gpio.c: In function
'intel_ehl_pse_gpio_mfd_runtime_suspend':
drivers/mfd/intel-ehl-gpio.c:184:6: warning: unused variable 'i'
[-Wunused-variable]
184 | int i = 0;
| ^
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/limits.h:6,
from include/linux/kernel.h:7,
from drivers/mfd/intel-ehl-gpio.c:14:
drivers/mfd/intel-ehl-gpio.c: At top level:
> include/linux/stddef.h:8:14: warning: initialization of 'long
unsigned int' from 'void *' makes integer from pointer without a cast
[-Wint-conversion]
8 | #define NULL ((void *)0)
| ^
drivers/mfd/intel-ehl-gpio.c:236:32: note: in expansion of macro 'NULL'
236 | { PCI_VDEVICE(INTEL, 0x4b88), NULL},
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for
'intel_ehl_pse_gpio_mfd_ids[0].driver_data')
8 | #define NULL ((void *)0)
| ^
drivers/mfd/intel-ehl-gpio.c:236:32: note: in expansion of macro 'NULL'
236 | { PCI_VDEVICE(INTEL, 0x4b88), NULL},
| ^~~~
> include/linux/stddef.h:8:14: warning: initialization of 'long
unsigned int' from 'void *' makes integer from pointer without a cast
[-Wint-conversion]
8 | #define NULL ((void *)0)
| ^
drivers/mfd/intel-ehl-gpio.c:237:32: note: in expansion of macro 'NULL'
237 | { PCI_VDEVICE(INTEL, 0x4b89), NULL},
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for
'intel_ehl_pse_gpio_mfd_ids[1].driver_data')
8 | #define NULL ((void *)0)
| ^
drivers/mfd/intel-ehl-gpio.c:237:32: note: in expansion of macro 'NULL'
237 | { PCI_VDEVICE(INTEL, 0x4b89), NULL},
| ^~~~
vim +/ehl_pse_gpio_free +79 drivers/gpio/gpio-ehl-pse-plat.c
78
79 void ehl_pse_gpio_free(struct gpio_chip *chip, unsigned int
offset)
80 {
81 /* decrease runtime_usage counter */
82 pm_runtime_put_sync(chip->parent);
83 }
84
85 static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned int offset,
86 unsigned int reg_type_offset)
87 {
88 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
89 u8 reg = offset / 32;
90
91 return priv->reg_base + reg_type_offset + reg * 4;
92 }
93
94 static int ehl_pse_gpio_get(struct gpio_chip *chip, unsigned int offset)
95 {
96 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
97 u32 reg_gplr;
98
99 reg_gplr = intel_gpio_readl(priv->reg_base, GPLR);
100
101 return !!(reg_gplr & BIT(offset));
102 }
103
104 static void ehl_pse_gpio_set(struct gpio_chip *chip, unsigned int offset,
105 int value)
106 {
107 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
108 unsigned long flags;
109
110 raw_spin_lock_irqsave(&priv->lock, flags);
111
112 if (value)
113 intel_gpio_writel(priv->reg_base, GPSR, BIT(offset));
114
115 else
116 intel_gpio_writel(priv->reg_base, GPCR, BIT(offset));
117
118
119 raw_spin_unlock_irqrestore(&priv->lock, flags);
120 }
121
122 static int ehl_pse_gpio_direction_input(struct gpio_chip *chip,
123 unsigned int offset)
124 {
125 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
126 unsigned long flags;
127 u32 value;
128
129 pm_runtime_get_sync(priv->dev->parent);
130
131 raw_spin_lock_irqsave(&priv->lock, flags);
132
133 value = intel_gpio_readl(priv->reg_base, GPDR);
134 value &= ~BIT(offset);
135 intel_gpio_writel(priv->reg_base, GPDR, value);
136
137 raw_spin_unlock_irqrestore(&priv->lock, flags);
138
139 pm_runtime_put(priv->dev->parent);
140
141 return 0;
142 }
143
144 static int ehl_pse_gpio_direction_output(struct gpio_chip *chip,
145 unsigned int offset, int value)
146 {
147 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
148 unsigned long flags;
149
150 pm_runtime_get_sync(priv->dev->parent);
151
152 ehl_pse_gpio_set(chip, offset, value);
153
154 raw_spin_lock_irqsave(&priv->lock, flags);
155
156 value = intel_gpio_readl(priv->reg_base, GPDR);
157 value |= BIT(offset);
158 intel_gpio_writel(priv->reg_base, GPDR, value);
159
160 raw_spin_unlock_irqrestore(&priv->lock, flags);
161
162 pm_runtime_put(priv->dev->parent);
163
164 return 0;
165 }
166
167 static int ehl_pse_gpio_get_direction(struct gpio_chip *chip,
168 unsigned int offset)
169 {
170 struct ehl_pse_gpio *priv = gpiochip_get_data(chip);
171 int direction = 0;
172
173 pm_runtime_get_sync(priv->dev->parent);
174
175 u32 reg_gpdr = intel_gpio_readl(priv->reg_base, GPDR);
176
177 direction = !(reg_gpdr & BIT(offset));
178
179 pm_runtime_put(priv->dev->parent);
180
181 return direction;
182 }
183
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org