Hi Ansuel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on clk/clk-next linus/master v5.8-rc5 next-20200715]
[cannot apply to thermal/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Ansuel-Smith/Add-support-for-ipq...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
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 >>):
In file included from include/linux/dev_printk.h:14,
from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/thermal/qcom/tsens-8960.c:6:
drivers/thermal/qcom/tsens-8960.c: In function 'tsens_scheduler_fn':
drivers/thermal/qcom/tsens-8960.c:124:41: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
124 | container_of(work, struct tsens_priv, tsens_work);
| ^~~~~~~~~~
include/linux/compiler.h:372:9: note: in definition of macro
'__compiletime_assert'
372 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler.h:392:2: note: in expansion of macro
'_compiletime_assert'
392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
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:1003:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
1003 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~~~~~~
include/linux/kernel.h:1003:20: note: in expansion of macro '__same_type'
1003 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:124:3: note: in expansion of macro
'container_of'
124 | container_of(work, struct tsens_priv, tsens_work);
| ^~~~~~~~~~~~
In file included from <command-line>:
drivers/thermal/qcom/tsens-8960.c:124:41: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
124 | container_of(work, struct tsens_priv, tsens_work);
| ^~~~~~~~~~
include/linux/compiler_types.h:133:57: note: in definition of macro
'__compiler_offsetof'
133 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
| ^
include/linux/kernel.h:1006:21: note: in expansion of macro 'offsetof'
1006 | ((type *)(__mptr - offsetof(type, member))); })
| ^~~~~~~~
drivers/thermal/qcom/tsens-8960.c:124:3: note: in expansion of macro
'container_of'
124 | container_of(work, struct tsens_priv, tsens_work);
| ^~~~~~~~~~~~
> drivers/thermal/qcom/tsens-8960.c:137:9: warning: conversion from
'long unsigned int' to 'unsigned int' changes value from
'18446744073709551609' to '4294967289' [-Woverflow]
137 | mask
= ~(LOWER_STATUS_CLR | UPPER_STATUS_CLR);
| ^
drivers/thermal/qcom/tsens-8960.c: In function 'tsens_isr':
drivers/thermal/qcom/tsens-8960.c:187:23: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
187 | schedule_work(&priv->tsens_work);
| ^~~~~~~~~~
| sensor
drivers/thermal/qcom/tsens-8960.c: In function 'hw_init':
drivers/thermal/qcom/tsens-8960.c:225:40: error: 'struct tsens_priv' has no
member named 'tsens_irq'
225 | ret = devm_request_irq(priv->dev, priv->tsens_irq, tsens_isr,
| ^~
In file included from include/linux/rhashtable-types.h:15,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/thermal/qcom/tsens-8960.c:6:
drivers/thermal/qcom/tsens-8960.c:232:19: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~~
include/linux/workqueue.h:242:16: note: in definition of macro '__INIT_WORK'
242 | __init_work((_work), _onstack); \
| ^~~~~
drivers/thermal/qcom/tsens-8960.c:232:2: note: in expansion of macro
'INIT_WORK'
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:232:19: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~~
include/linux/workqueue.h:243:4: note: in definition of macro '__INIT_WORK'
243 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
| ^~~~~
drivers/thermal/qcom/tsens-8960.c:232:2: note: in expansion of macro
'INIT_WORK'
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:232:19: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~~
include/linux/workqueue.h:244:20: note: in definition of macro '__INIT_WORK'
244 | INIT_LIST_HEAD(&(_work)->entry); \
| ^~~~~
drivers/thermal/qcom/tsens-8960.c:232:2: note: in expansion of macro
'INIT_WORK'
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:232:19: error: 'struct tsens_priv' has no
member named 'tsens_work'; did you mean 'sensor'?
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~~
include/linux/workqueue.h:245:4: note: in definition of macro '__INIT_WORK'
245 | (_work)->func = (_func); \
| ^~~~~
drivers/thermal/qcom/tsens-8960.c:232:2: note: in expansion of macro
'INIT_WORK'
232 | INIT_WORK(&priv->tsens_work, tsens_scheduler_fn);
| ^~~~~~~~~
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/asm-generic/bug.h:19,
from arch/riscv/include/asm/bug.h:83,
from include/linux/bug.h:5,
from arch/riscv/include/asm/current.h:13,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/thermal/qcom/tsens-8960.c:6:
drivers/thermal/qcom/tsens-8960.c: In function 'disable_8960':
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always
false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro
'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:323:9: note: in expansion of macro 'GENMASK'
323 | mask = GENMASK(priv->num_sensors - 1, 0);
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always
false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro
'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens-8960.c:323:9: note: in expansion of macro 'GENMASK'
323 | mask = GENMASK(priv->num_sensors - 1, 0);
| ^~~~~~~
drivers/thermal/qcom/tsens-8960.c: In function 'init_8960':
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always
false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro
'BUILD_BUG_ON_ZERO'
vim +137 drivers/thermal/qcom/tsens-8960.c
120
121 static void tsens_scheduler_fn(struct work_struct *work)
122 {
123 struct tsens_priv *priv =
124 container_of(work, struct tsens_priv, tsens_work);
125 unsigned int threshold, threshold_low, code, reg, sensor, mask;
126 bool upper_th_x, lower_th_x;
127 int ret;
128
129 ret = regmap_read(priv->tm_map, STATUS_CNTL_ADDR_8064, ®);
130 if (ret)
131 return;
132 reg = reg | LOWER_STATUS_CLR | UPPER_STATUS_CLR;
133 ret = regmap_write(priv->tm_map, STATUS_CNTL_ADDR_8064, reg);
134 if (ret)
135 return;
136
137 mask = ~(LOWER_STATUS_CLR | UPPER_STATUS_CLR);
138 ret
= regmap_read(priv->tm_map, THRESHOLD_ADDR, &threshold);
139 if (ret)
140 return;
141 threshold_low = (threshold & THRESHOLD_LOWER_LIMIT_MASK) >>
142 THRESHOLD_LOWER_LIMIT_SHIFT;
143 threshold = (threshold & THRESHOLD_UPPER_LIMIT_MASK) >>
144 THRESHOLD_UPPER_LIMIT_SHIFT;
145
146 ret = regmap_read(priv->tm_map, STATUS_CNTL_ADDR_8064, ®);
147 if (ret)
148 return;
149
150 ret = regmap_read(priv->tm_map, CNTL_ADDR, &sensor);
151 if (ret)
152 return;
153 sensor &= (uint32_t)TSENS_8064_SENSORS_EN;
154 sensor >>= SENSOR0_SHIFT;
155
156 /* Constraint: There is only 1 interrupt control register for all
157 * 11 temperature sensor. So monitoring more than 1 sensor based
158 * on interrupts will yield inconsistent result. To overcome this
159 * issue we will monitor only sensor 0 which is the master sensor.
160 */
161
162 /* Skip if the sensor is disabled */
163 if (sensor & 1) {
164 ret = regmap_read(priv->tm_map, priv->sensor[0].status, &code);
165 if (ret)
166 return;
167 upper_th_x = code >= threshold;
168 lower_th_x = code <= threshold_low;
169 if (upper_th_x)
170 mask |= UPPER_STATUS_CLR;
171 if (lower_th_x)
172 mask |= LOWER_STATUS_CLR;
173 if (upper_th_x || lower_th_x) {
174 /* Notify user space */
175 schedule_work(&priv->sensor[0].notify_work);
176 pr_debug("Trigger (%d degrees) for sensor %d\n",
177 code_to_mdegC(code, &priv->sensor[0]), 0);
178 }
179 }
180 regmap_write(priv->tm_map, STATUS_CNTL_ADDR_8064, reg & mask);
181 }
182
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org