Re: [PATCH net-next v2 1/2] of: net: pass the dst buffer to of_get_mac_address()
by Dan Carpenter
Hi Michael,
url: https://github.com/0day-ci/linux/commits/Michael-Walle/of-net-support-non...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git cc0626c2aaed8e475efdd85fa374b497a7192e35
config: x86_64-randconfig-m001-20210406 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2069 axienet_probe() warn: passing a valid pointer to 'PTR_ERR'
vim +/PTR_ERR +2069 drivers/net/ethernet/xilinx/xilinx_axienet_main.c
522856cefaf09d Robert Hancock 2019-06-06 2060 /* Check for Ethernet core IRQ (optional) */
522856cefaf09d Robert Hancock 2019-06-06 2061 if (lp->eth_irq <= 0)
522856cefaf09d Robert Hancock 2019-06-06 2062 dev_info(&pdev->dev, "Ethernet core IRQ not defined\n");
522856cefaf09d Robert Hancock 2019-06-06 2063
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2064 /* Retrieve the MAC address */
411b125c6ace1f Michael Walle 2021-04-06 2065 ret = of_get_mac_address(pdev->dev.of_node, mac_addr);
411b125c6ace1f Michael Walle 2021-04-06 2066 if (!ret) {
411b125c6ace1f Michael Walle 2021-04-06 2067 axienet_set_mac_address(ndev, mac_addr);
411b125c6ace1f Michael Walle 2021-04-06 2068 } else {
d05a9ed5c3a773 Robert Hancock 2019-06-06 @2069 dev_warn(&pdev->dev, "could not find MAC address property: %ld\n",
d05a9ed5c3a773 Robert Hancock 2019-06-06 2070 PTR_ERR(mac_addr));
^^^^^^^^^^^^^^^^^
This should print "ret".
411b125c6ace1f Michael Walle 2021-04-06 2071 axienet_set_mac_address(ndev, NULL);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2072 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2073
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2074 lp->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 2075 lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD;
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[lee-mfd:ib-mfd-clk-gpio-regulator-rtc-5.13 12/16] drivers/regulator/bd71828-regulator.c:191:24: warning: initialization of 'unsigned int' from 'const unsigned int *' makes integer from pointer without a cast
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-clk-gpio-regulator-rtc-5.13
head: 5a8a64d9a38b9d3794f9f5e153fc0358b858cc24
commit: 18f3c62586f7b4e1f038f570acda61a25c97c4ee [12/16] regulator: bd718x7, bd71828: Use ramp-delay helper
config: i386-randconfig-s001-20210414 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/commit/?id=18...
git remote add lee-mfd https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
git fetch --no-tags lee-mfd ib-mfd-clk-gpio-regulator-rtc-5.13
git checkout 18f3c62586f7b4e1f038f570acda61a25c97c4ee
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' 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/regulator/bd71828-regulator.c:157:20: error: 'regulator_set_ramp_delay_regmap' undeclared here (not in a function); did you mean 'regulator_set_pull_down_regmap'?
157 | .set_ramp_delay = regulator_set_ramp_delay_regmap,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| regulator_set_pull_down_regmap
drivers/regulator/bd71828-regulator.c:191:5: error: 'struct regulator_desc' has no member named 'ramp_delay_table'; did you mean 'ramp_delay'?
191 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~
| ramp_delay
>> drivers/regulator/bd71828-regulator.c:191:24: warning: initialization of 'unsigned int' from 'const unsigned int *' makes integer from pointer without a cast [-Wint-conversion]
191 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:191:24: note: (near initialization for 'bd71828_rdata[0].desc.vsel_step')
drivers/regulator/bd71828-regulator.c:192:5: error: 'struct regulator_desc' has no member named 'n_ramp_values'
192 | .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
| ^~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:193:5: error: 'struct regulator_desc' has no member named 'ramp_reg'; did you mean 'ramp_delay'?
193 | .ramp_reg = BD71828_REG_BUCK1_MODE,
| ^~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:194:5: error: 'struct regulator_desc' has no member named 'ramp_mask'
194 | .ramp_mask = BD71828_MASK_RAMP_DELAY,
| ^~~~~~~~~
drivers/regulator/bd71828-regulator.c:237:5: error: 'struct regulator_desc' has no member named 'ramp_delay_table'; did you mean 'ramp_delay'?
237 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:237:24: warning: initialization of 'unsigned int' from 'const unsigned int *' makes integer from pointer without a cast [-Wint-conversion]
237 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:237:24: note: (near initialization for 'bd71828_rdata[1].desc.vsel_step')
drivers/regulator/bd71828-regulator.c:238:5: error: 'struct regulator_desc' has no member named 'n_ramp_values'
238 | .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
| ^~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:239:5: error: 'struct regulator_desc' has no member named 'ramp_reg'; did you mean 'ramp_delay'?
239 | .ramp_reg = BD71828_REG_BUCK2_MODE,
| ^~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:240:5: error: 'struct regulator_desc' has no member named 'ramp_mask'
240 | .ramp_mask = BD71828_MASK_RAMP_DELAY,
| ^~~~~~~~~
drivers/regulator/bd71828-regulator.c:401:5: error: 'struct regulator_desc' has no member named 'ramp_delay_table'; did you mean 'ramp_delay'?
401 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:401:24: warning: initialization of 'unsigned int' from 'const unsigned int *' makes integer from pointer without a cast [-Wint-conversion]
401 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:401:24: note: (near initialization for 'bd71828_rdata[5].desc.vsel_step')
drivers/regulator/bd71828-regulator.c:402:5: error: 'struct regulator_desc' has no member named 'n_ramp_values'
402 | .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
| ^~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:403:5: error: 'struct regulator_desc' has no member named 'ramp_reg'; did you mean 'ramp_delay'?
403 | .ramp_reg = BD71828_REG_BUCK6_MODE,
| ^~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:404:5: error: 'struct regulator_desc' has no member named 'ramp_mask'
404 | .ramp_mask = BD71828_MASK_RAMP_DELAY,
| ^~~~~~~~~
drivers/regulator/bd71828-regulator.c:442:5: error: 'struct regulator_desc' has no member named 'ramp_delay_table'; did you mean 'ramp_delay'?
442 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:442:24: warning: initialization of 'unsigned int' from 'const unsigned int *' makes integer from pointer without a cast [-Wint-conversion]
442 | .ramp_delay_table = bd71828_ramp_delay,
| ^~~~~~~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:442:24: note: (near initialization for 'bd71828_rdata[6].desc.vsel_step')
drivers/regulator/bd71828-regulator.c:443:5: error: 'struct regulator_desc' has no member named 'n_ramp_values'
443 | .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
| ^~~~~~~~~~~~~
drivers/regulator/bd71828-regulator.c:444:5: error: 'struct regulator_desc' has no member named 'ramp_reg'; did you mean 'ramp_delay'?
444 | .ramp_reg = BD71828_REG_BUCK7_MODE,
| ^~~~~~~~
| ramp_delay
drivers/regulator/bd71828-regulator.c:445:5: error: 'struct regulator_desc' has no member named 'ramp_mask'
445 | .ramp_mask = BD71828_MASK_RAMP_DELAY,
| ^~~~~~~~~
vim +191 drivers/regulator/bd71828-regulator.c
174
175 static const struct bd71828_regulator_data bd71828_rdata[] = {
176 {
177 .desc = {
178 .name = "buck1",
179 .of_match = of_match_ptr("BUCK1"),
180 .regulators_node = of_match_ptr("regulators"),
181 .id = BD71828_BUCK1,
182 .ops = &bd71828_dvs_buck_ops,
183 .type = REGULATOR_VOLTAGE,
184 .linear_ranges = bd71828_buck1267_volts,
185 .n_linear_ranges = ARRAY_SIZE(bd71828_buck1267_volts),
186 .n_voltages = BD71828_BUCK1267_VOLTS,
187 .enable_reg = BD71828_REG_BUCK1_EN,
188 .enable_mask = BD71828_MASK_RUN_EN,
189 .vsel_reg = BD71828_REG_BUCK1_VOLT,
190 .vsel_mask = BD71828_MASK_BUCK1267_VOLT,
> 191 .ramp_delay_table = bd71828_ramp_delay,
192 .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
193 .ramp_reg = BD71828_REG_BUCK1_MODE,
194 .ramp_mask = BD71828_MASK_RAMP_DELAY,
195 .owner = THIS_MODULE,
196 .of_parse_cb = buck_set_hw_dvs_levels,
197 },
198 .dvs = {
199 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
200 ROHM_DVS_LEVEL_SUSPEND |
201 ROHM_DVS_LEVEL_LPSR,
202 .run_reg = BD71828_REG_BUCK1_VOLT,
203 .run_mask = BD71828_MASK_BUCK1267_VOLT,
204 .idle_reg = BD71828_REG_BUCK1_IDLE_VOLT,
205 .idle_mask = BD71828_MASK_BUCK1267_VOLT,
206 .idle_on_mask = BD71828_MASK_IDLE_EN,
207 .suspend_reg = BD71828_REG_BUCK1_SUSP_VOLT,
208 .suspend_mask = BD71828_MASK_BUCK1267_VOLT,
209 .suspend_on_mask = BD71828_MASK_SUSP_EN,
210 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
211 /*
212 * LPSR voltage is same as SUSPEND voltage. Allow
213 * setting it so that regulator can be set enabled at
214 * LPSR state
215 */
216 .lpsr_reg = BD71828_REG_BUCK1_SUSP_VOLT,
217 .lpsr_mask = BD71828_MASK_BUCK1267_VOLT,
218 },
219 .reg_inits = buck1_inits,
220 .reg_init_amnt = ARRAY_SIZE(buck1_inits),
221 },
222 {
223 .desc = {
224 .name = "buck2",
225 .of_match = of_match_ptr("BUCK2"),
226 .regulators_node = of_match_ptr("regulators"),
227 .id = BD71828_BUCK2,
228 .ops = &bd71828_dvs_buck_ops,
229 .type = REGULATOR_VOLTAGE,
230 .linear_ranges = bd71828_buck1267_volts,
231 .n_linear_ranges = ARRAY_SIZE(bd71828_buck1267_volts),
232 .n_voltages = BD71828_BUCK1267_VOLTS,
233 .enable_reg = BD71828_REG_BUCK2_EN,
234 .enable_mask = BD71828_MASK_RUN_EN,
235 .vsel_reg = BD71828_REG_BUCK2_VOLT,
236 .vsel_mask = BD71828_MASK_BUCK1267_VOLT,
237 .ramp_delay_table = bd71828_ramp_delay,
238 .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
239 .ramp_reg = BD71828_REG_BUCK2_MODE,
240 .ramp_mask = BD71828_MASK_RAMP_DELAY,
241 .owner = THIS_MODULE,
242 .of_parse_cb = buck_set_hw_dvs_levels,
243 },
244 .dvs = {
245 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
246 ROHM_DVS_LEVEL_SUSPEND |
247 ROHM_DVS_LEVEL_LPSR,
248 .run_reg = BD71828_REG_BUCK2_VOLT,
249 .run_mask = BD71828_MASK_BUCK1267_VOLT,
250 .idle_reg = BD71828_REG_BUCK2_IDLE_VOLT,
251 .idle_mask = BD71828_MASK_BUCK1267_VOLT,
252 .idle_on_mask = BD71828_MASK_IDLE_EN,
253 .suspend_reg = BD71828_REG_BUCK2_SUSP_VOLT,
254 .suspend_mask = BD71828_MASK_BUCK1267_VOLT,
255 .suspend_on_mask = BD71828_MASK_SUSP_EN,
256 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
257 .lpsr_reg = BD71828_REG_BUCK2_SUSP_VOLT,
258 .lpsr_mask = BD71828_MASK_BUCK1267_VOLT,
259 },
260 .reg_inits = buck2_inits,
261 .reg_init_amnt = ARRAY_SIZE(buck2_inits),
262 },
263 {
264 .desc = {
265 .name = "buck3",
266 .of_match = of_match_ptr("BUCK3"),
267 .regulators_node = of_match_ptr("regulators"),
268 .id = BD71828_BUCK3,
269 .ops = &bd71828_buck_ops,
270 .type = REGULATOR_VOLTAGE,
271 .linear_ranges = bd71828_buck3_volts,
272 .n_linear_ranges = ARRAY_SIZE(bd71828_buck3_volts),
273 .n_voltages = BD71828_BUCK3_VOLTS,
274 .enable_reg = BD71828_REG_BUCK3_EN,
275 .enable_mask = BD71828_MASK_RUN_EN,
276 .vsel_reg = BD71828_REG_BUCK3_VOLT,
277 .vsel_mask = BD71828_MASK_BUCK3_VOLT,
278 .owner = THIS_MODULE,
279 .of_parse_cb = buck_set_hw_dvs_levels,
280 },
281 .dvs = {
282 /*
283 * BUCK3 only supports single voltage for all states.
284 * voltage can be individually enabled for each state
285 * though => allow setting all states to support
286 * enabling power rail on different states.
287 */
288 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
289 ROHM_DVS_LEVEL_SUSPEND |
290 ROHM_DVS_LEVEL_LPSR,
291 .run_reg = BD71828_REG_BUCK3_VOLT,
292 .idle_reg = BD71828_REG_BUCK3_VOLT,
293 .suspend_reg = BD71828_REG_BUCK3_VOLT,
294 .lpsr_reg = BD71828_REG_BUCK3_VOLT,
295 .run_mask = BD71828_MASK_BUCK3_VOLT,
296 .idle_mask = BD71828_MASK_BUCK3_VOLT,
297 .suspend_mask = BD71828_MASK_BUCK3_VOLT,
298 .lpsr_mask = BD71828_MASK_BUCK3_VOLT,
299 .idle_on_mask = BD71828_MASK_IDLE_EN,
300 .suspend_on_mask = BD71828_MASK_SUSP_EN,
301 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
302 },
303 },
304 {
305 .desc = {
306 .name = "buck4",
307 .of_match = of_match_ptr("BUCK4"),
308 .regulators_node = of_match_ptr("regulators"),
309 .id = BD71828_BUCK4,
310 .ops = &bd71828_buck_ops,
311 .type = REGULATOR_VOLTAGE,
312 .linear_ranges = bd71828_buck4_volts,
313 .n_linear_ranges = ARRAY_SIZE(bd71828_buck4_volts),
314 .n_voltages = BD71828_BUCK4_VOLTS,
315 .enable_reg = BD71828_REG_BUCK4_EN,
316 .enable_mask = BD71828_MASK_RUN_EN,
317 .vsel_reg = BD71828_REG_BUCK4_VOLT,
318 .vsel_mask = BD71828_MASK_BUCK4_VOLT,
319 .owner = THIS_MODULE,
320 .of_parse_cb = buck_set_hw_dvs_levels,
321 },
322 .dvs = {
323 /*
324 * BUCK4 only supports single voltage for all states.
325 * voltage can be individually enabled for each state
326 * though => allow setting all states to support
327 * enabling power rail on different states.
328 */
329 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
330 ROHM_DVS_LEVEL_SUSPEND |
331 ROHM_DVS_LEVEL_LPSR,
332 .run_reg = BD71828_REG_BUCK4_VOLT,
333 .idle_reg = BD71828_REG_BUCK4_VOLT,
334 .suspend_reg = BD71828_REG_BUCK4_VOLT,
335 .lpsr_reg = BD71828_REG_BUCK4_VOLT,
336 .run_mask = BD71828_MASK_BUCK4_VOLT,
337 .idle_mask = BD71828_MASK_BUCK4_VOLT,
338 .suspend_mask = BD71828_MASK_BUCK4_VOLT,
339 .lpsr_mask = BD71828_MASK_BUCK4_VOLT,
340 .idle_on_mask = BD71828_MASK_IDLE_EN,
341 .suspend_on_mask = BD71828_MASK_SUSP_EN,
342 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
343 },
344 },
345 {
346 .desc = {
347 .name = "buck5",
348 .of_match = of_match_ptr("BUCK5"),
349 .regulators_node = of_match_ptr("regulators"),
350 .id = BD71828_BUCK5,
351 .ops = &bd71828_buck_ops,
352 .type = REGULATOR_VOLTAGE,
353 .linear_ranges = bd71828_buck5_volts,
354 .n_linear_ranges = ARRAY_SIZE(bd71828_buck5_volts),
355 .n_voltages = BD71828_BUCK5_VOLTS,
356 .enable_reg = BD71828_REG_BUCK5_EN,
357 .enable_mask = BD71828_MASK_RUN_EN,
358 .vsel_reg = BD71828_REG_BUCK5_VOLT,
359 .vsel_mask = BD71828_MASK_BUCK5_VOLT,
360 .owner = THIS_MODULE,
361 .of_parse_cb = buck_set_hw_dvs_levels,
362 },
363 .dvs = {
364 /*
365 * BUCK5 only supports single voltage for all states.
366 * voltage can be individually enabled for each state
367 * though => allow setting all states to support
368 * enabling power rail on different states.
369 */
370 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
371 ROHM_DVS_LEVEL_SUSPEND |
372 ROHM_DVS_LEVEL_LPSR,
373 .run_reg = BD71828_REG_BUCK5_VOLT,
374 .idle_reg = BD71828_REG_BUCK5_VOLT,
375 .suspend_reg = BD71828_REG_BUCK5_VOLT,
376 .lpsr_reg = BD71828_REG_BUCK5_VOLT,
377 .run_mask = BD71828_MASK_BUCK5_VOLT,
378 .idle_mask = BD71828_MASK_BUCK5_VOLT,
379 .suspend_mask = BD71828_MASK_BUCK5_VOLT,
380 .lpsr_mask = BD71828_MASK_BUCK5_VOLT,
381 .idle_on_mask = BD71828_MASK_IDLE_EN,
382 .suspend_on_mask = BD71828_MASK_SUSP_EN,
383 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
384 },
385 },
386 {
387 .desc = {
388 .name = "buck6",
389 .of_match = of_match_ptr("BUCK6"),
390 .regulators_node = of_match_ptr("regulators"),
391 .id = BD71828_BUCK6,
392 .ops = &bd71828_dvs_buck_ops,
393 .type = REGULATOR_VOLTAGE,
394 .linear_ranges = bd71828_buck1267_volts,
395 .n_linear_ranges = ARRAY_SIZE(bd71828_buck1267_volts),
396 .n_voltages = BD71828_BUCK1267_VOLTS,
397 .enable_reg = BD71828_REG_BUCK6_EN,
398 .enable_mask = BD71828_MASK_RUN_EN,
399 .vsel_reg = BD71828_REG_BUCK6_VOLT,
400 .vsel_mask = BD71828_MASK_BUCK1267_VOLT,
401 .ramp_delay_table = bd71828_ramp_delay,
402 .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
403 .ramp_reg = BD71828_REG_BUCK6_MODE,
404 .ramp_mask = BD71828_MASK_RAMP_DELAY,
405 .owner = THIS_MODULE,
406 .of_parse_cb = buck_set_hw_dvs_levels,
407 },
408 .dvs = {
409 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
410 ROHM_DVS_LEVEL_SUSPEND |
411 ROHM_DVS_LEVEL_LPSR,
412 .run_reg = BD71828_REG_BUCK6_VOLT,
413 .run_mask = BD71828_MASK_BUCK1267_VOLT,
414 .idle_reg = BD71828_REG_BUCK6_IDLE_VOLT,
415 .idle_mask = BD71828_MASK_BUCK1267_VOLT,
416 .idle_on_mask = BD71828_MASK_IDLE_EN,
417 .suspend_reg = BD71828_REG_BUCK6_SUSP_VOLT,
418 .suspend_mask = BD71828_MASK_BUCK1267_VOLT,
419 .suspend_on_mask = BD71828_MASK_SUSP_EN,
420 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
421 .lpsr_reg = BD71828_REG_BUCK6_SUSP_VOLT,
422 .lpsr_mask = BD71828_MASK_BUCK1267_VOLT,
423 },
424 .reg_inits = buck6_inits,
425 .reg_init_amnt = ARRAY_SIZE(buck6_inits),
426 },
427 {
428 .desc = {
429 .name = "buck7",
430 .of_match = of_match_ptr("BUCK7"),
431 .regulators_node = of_match_ptr("regulators"),
432 .id = BD71828_BUCK7,
433 .ops = &bd71828_dvs_buck_ops,
434 .type = REGULATOR_VOLTAGE,
435 .linear_ranges = bd71828_buck1267_volts,
436 .n_linear_ranges = ARRAY_SIZE(bd71828_buck1267_volts),
437 .n_voltages = BD71828_BUCK1267_VOLTS,
438 .enable_reg = BD71828_REG_BUCK7_EN,
439 .enable_mask = BD71828_MASK_RUN_EN,
440 .vsel_reg = BD71828_REG_BUCK7_VOLT,
441 .vsel_mask = BD71828_MASK_BUCK1267_VOLT,
442 .ramp_delay_table = bd71828_ramp_delay,
443 .n_ramp_values = ARRAY_SIZE(bd71828_ramp_delay),
444 .ramp_reg = BD71828_REG_BUCK7_MODE,
445 .ramp_mask = BD71828_MASK_RAMP_DELAY,
446 .owner = THIS_MODULE,
447 .of_parse_cb = buck_set_hw_dvs_levels,
448 },
449 .dvs = {
450 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
451 ROHM_DVS_LEVEL_SUSPEND |
452 ROHM_DVS_LEVEL_LPSR,
453 .run_reg = BD71828_REG_BUCK7_VOLT,
454 .run_mask = BD71828_MASK_BUCK1267_VOLT,
455 .idle_reg = BD71828_REG_BUCK7_IDLE_VOLT,
456 .idle_mask = BD71828_MASK_BUCK1267_VOLT,
457 .idle_on_mask = BD71828_MASK_IDLE_EN,
458 .suspend_reg = BD71828_REG_BUCK7_SUSP_VOLT,
459 .suspend_mask = BD71828_MASK_BUCK1267_VOLT,
460 .suspend_on_mask = BD71828_MASK_SUSP_EN,
461 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
462 .lpsr_reg = BD71828_REG_BUCK7_SUSP_VOLT,
463 .lpsr_mask = BD71828_MASK_BUCK1267_VOLT,
464 },
465 .reg_inits = buck7_inits,
466 .reg_init_amnt = ARRAY_SIZE(buck7_inits),
467 },
468 {
469 .desc = {
470 .name = "ldo1",
471 .of_match = of_match_ptr("LDO1"),
472 .regulators_node = of_match_ptr("regulators"),
473 .id = BD71828_LDO1,
474 .ops = &bd71828_ldo_ops,
475 .type = REGULATOR_VOLTAGE,
476 .linear_ranges = bd71828_ldo_volts,
477 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
478 .n_voltages = BD71828_LDO_VOLTS,
479 .enable_reg = BD71828_REG_LDO1_EN,
480 .enable_mask = BD71828_MASK_RUN_EN,
481 .vsel_reg = BD71828_REG_LDO1_VOLT,
482 .vsel_mask = BD71828_MASK_LDO_VOLT,
483 .owner = THIS_MODULE,
484 .of_parse_cb = buck_set_hw_dvs_levels,
485 },
486 .dvs = {
487 /*
488 * LDO1 only supports single voltage for all states.
489 * voltage can be individually enabled for each state
490 * though => allow setting all states to support
491 * enabling power rail on different states.
492 */
493 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
494 ROHM_DVS_LEVEL_SUSPEND |
495 ROHM_DVS_LEVEL_LPSR,
496 .run_reg = BD71828_REG_LDO1_VOLT,
497 .idle_reg = BD71828_REG_LDO1_VOLT,
498 .suspend_reg = BD71828_REG_LDO1_VOLT,
499 .lpsr_reg = BD71828_REG_LDO1_VOLT,
500 .run_mask = BD71828_MASK_LDO_VOLT,
501 .idle_mask = BD71828_MASK_LDO_VOLT,
502 .suspend_mask = BD71828_MASK_LDO_VOLT,
503 .lpsr_mask = BD71828_MASK_LDO_VOLT,
504 .idle_on_mask = BD71828_MASK_IDLE_EN,
505 .suspend_on_mask = BD71828_MASK_SUSP_EN,
506 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
507 },
508 }, {
509 .desc = {
510 .name = "ldo2",
511 .of_match = of_match_ptr("LDO2"),
512 .regulators_node = of_match_ptr("regulators"),
513 .id = BD71828_LDO2,
514 .ops = &bd71828_ldo_ops,
515 .type = REGULATOR_VOLTAGE,
516 .linear_ranges = bd71828_ldo_volts,
517 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
518 .n_voltages = BD71828_LDO_VOLTS,
519 .enable_reg = BD71828_REG_LDO2_EN,
520 .enable_mask = BD71828_MASK_RUN_EN,
521 .vsel_reg = BD71828_REG_LDO2_VOLT,
522 .vsel_mask = BD71828_MASK_LDO_VOLT,
523 .owner = THIS_MODULE,
524 .of_parse_cb = buck_set_hw_dvs_levels,
525 },
526 .dvs = {
527 /*
528 * LDO2 only supports single voltage for all states.
529 * voltage can be individually enabled for each state
530 * though => allow setting all states to support
531 * enabling power rail on different states.
532 */
533 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
534 ROHM_DVS_LEVEL_SUSPEND |
535 ROHM_DVS_LEVEL_LPSR,
536 .run_reg = BD71828_REG_LDO2_VOLT,
537 .idle_reg = BD71828_REG_LDO2_VOLT,
538 .suspend_reg = BD71828_REG_LDO2_VOLT,
539 .lpsr_reg = BD71828_REG_LDO2_VOLT,
540 .run_mask = BD71828_MASK_LDO_VOLT,
541 .idle_mask = BD71828_MASK_LDO_VOLT,
542 .suspend_mask = BD71828_MASK_LDO_VOLT,
543 .lpsr_mask = BD71828_MASK_LDO_VOLT,
544 .idle_on_mask = BD71828_MASK_IDLE_EN,
545 .suspend_on_mask = BD71828_MASK_SUSP_EN,
546 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
547 },
548 }, {
549 .desc = {
550 .name = "ldo3",
551 .of_match = of_match_ptr("LDO3"),
552 .regulators_node = of_match_ptr("regulators"),
553 .id = BD71828_LDO3,
554 .ops = &bd71828_ldo_ops,
555 .type = REGULATOR_VOLTAGE,
556 .linear_ranges = bd71828_ldo_volts,
557 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
558 .n_voltages = BD71828_LDO_VOLTS,
559 .enable_reg = BD71828_REG_LDO3_EN,
560 .enable_mask = BD71828_MASK_RUN_EN,
561 .vsel_reg = BD71828_REG_LDO3_VOLT,
562 .vsel_mask = BD71828_MASK_LDO_VOLT,
563 .owner = THIS_MODULE,
564 .of_parse_cb = buck_set_hw_dvs_levels,
565 },
566 .dvs = {
567 /*
568 * LDO3 only supports single voltage for all states.
569 * voltage can be individually enabled for each state
570 * though => allow setting all states to support
571 * enabling power rail on different states.
572 */
573 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
574 ROHM_DVS_LEVEL_SUSPEND |
575 ROHM_DVS_LEVEL_LPSR,
576 .run_reg = BD71828_REG_LDO3_VOLT,
577 .idle_reg = BD71828_REG_LDO3_VOLT,
578 .suspend_reg = BD71828_REG_LDO3_VOLT,
579 .lpsr_reg = BD71828_REG_LDO3_VOLT,
580 .run_mask = BD71828_MASK_LDO_VOLT,
581 .idle_mask = BD71828_MASK_LDO_VOLT,
582 .suspend_mask = BD71828_MASK_LDO_VOLT,
583 .lpsr_mask = BD71828_MASK_LDO_VOLT,
584 .idle_on_mask = BD71828_MASK_IDLE_EN,
585 .suspend_on_mask = BD71828_MASK_SUSP_EN,
586 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
587 },
588
589 }, {
590 .desc = {
591 .name = "ldo4",
592 .of_match = of_match_ptr("LDO4"),
593 .regulators_node = of_match_ptr("regulators"),
594 .id = BD71828_LDO4,
595 .ops = &bd71828_ldo_ops,
596 .type = REGULATOR_VOLTAGE,
597 .linear_ranges = bd71828_ldo_volts,
598 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
599 .n_voltages = BD71828_LDO_VOLTS,
600 .enable_reg = BD71828_REG_LDO4_EN,
601 .enable_mask = BD71828_MASK_RUN_EN,
602 .vsel_reg = BD71828_REG_LDO4_VOLT,
603 .vsel_mask = BD71828_MASK_LDO_VOLT,
604 .owner = THIS_MODULE,
605 .of_parse_cb = buck_set_hw_dvs_levels,
606 },
607 .dvs = {
608 /*
609 * LDO1 only supports single voltage for all states.
610 * voltage can be individually enabled for each state
611 * though => allow setting all states to support
612 * enabling power rail on different states.
613 */
614 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
615 ROHM_DVS_LEVEL_SUSPEND |
616 ROHM_DVS_LEVEL_LPSR,
617 .run_reg = BD71828_REG_LDO4_VOLT,
618 .idle_reg = BD71828_REG_LDO4_VOLT,
619 .suspend_reg = BD71828_REG_LDO4_VOLT,
620 .lpsr_reg = BD71828_REG_LDO4_VOLT,
621 .run_mask = BD71828_MASK_LDO_VOLT,
622 .idle_mask = BD71828_MASK_LDO_VOLT,
623 .suspend_mask = BD71828_MASK_LDO_VOLT,
624 .lpsr_mask = BD71828_MASK_LDO_VOLT,
625 .idle_on_mask = BD71828_MASK_IDLE_EN,
626 .suspend_on_mask = BD71828_MASK_SUSP_EN,
627 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
628 },
629 }, {
630 .desc = {
631 .name = "ldo5",
632 .of_match = of_match_ptr("LDO5"),
633 .regulators_node = of_match_ptr("regulators"),
634 .id = BD71828_LDO5,
635 .ops = &bd71828_ldo_ops,
636 .type = REGULATOR_VOLTAGE,
637 .linear_ranges = bd71828_ldo_volts,
638 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
639 .n_voltages = BD71828_LDO_VOLTS,
640 .enable_reg = BD71828_REG_LDO5_EN,
641 .enable_mask = BD71828_MASK_RUN_EN,
642 .vsel_reg = BD71828_REG_LDO5_VOLT,
643 .vsel_mask = BD71828_MASK_LDO_VOLT,
644 .of_parse_cb = buck_set_hw_dvs_levels,
645 .owner = THIS_MODULE,
646 },
647 /*
648 * LDO5 is special. It can choose vsel settings to be configured
649 * from 2 different registers (by GPIO).
650 *
651 * This driver supports only configuration where
652 * BD71828_REG_LDO5_VOLT_L is used.
653 */
654 .dvs = {
655 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
656 ROHM_DVS_LEVEL_SUSPEND |
657 ROHM_DVS_LEVEL_LPSR,
658 .run_reg = BD71828_REG_LDO5_VOLT,
659 .idle_reg = BD71828_REG_LDO5_VOLT,
660 .suspend_reg = BD71828_REG_LDO5_VOLT,
661 .lpsr_reg = BD71828_REG_LDO5_VOLT,
662 .run_mask = BD71828_MASK_LDO_VOLT,
663 .idle_mask = BD71828_MASK_LDO_VOLT,
664 .suspend_mask = BD71828_MASK_LDO_VOLT,
665 .lpsr_mask = BD71828_MASK_LDO_VOLT,
666 .idle_on_mask = BD71828_MASK_IDLE_EN,
667 .suspend_on_mask = BD71828_MASK_SUSP_EN,
668 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
669 },
670
671 }, {
672 .desc = {
673 .name = "ldo6",
674 .of_match = of_match_ptr("LDO6"),
675 .regulators_node = of_match_ptr("regulators"),
676 .id = BD71828_LDO6,
677 .ops = &bd71828_ldo6_ops,
678 .type = REGULATOR_VOLTAGE,
679 .fixed_uV = BD71828_LDO_6_VOLTAGE,
680 .n_voltages = 1,
681 .enable_reg = BD71828_REG_LDO6_EN,
682 .enable_mask = BD71828_MASK_RUN_EN,
683 .owner = THIS_MODULE,
684 /*
685 * LDO6 only supports enable/disable for all states.
686 * Voltage for LDO6 is fixed.
687 */
688 .of_parse_cb = ldo6_parse_dt,
689 },
690 }, {
691 .desc = {
692 /* SNVS LDO in data-sheet */
693 .name = "ldo7",
694 .of_match = of_match_ptr("LDO7"),
695 .regulators_node = of_match_ptr("regulators"),
696 .id = BD71828_LDO_SNVS,
697 .ops = &bd71828_ldo_ops,
698 .type = REGULATOR_VOLTAGE,
699 .linear_ranges = bd71828_ldo_volts,
700 .n_linear_ranges = ARRAY_SIZE(bd71828_ldo_volts),
701 .n_voltages = BD71828_LDO_VOLTS,
702 .enable_reg = BD71828_REG_LDO7_EN,
703 .enable_mask = BD71828_MASK_RUN_EN,
704 .vsel_reg = BD71828_REG_LDO7_VOLT,
705 .vsel_mask = BD71828_MASK_LDO_VOLT,
706 .owner = THIS_MODULE,
707 .of_parse_cb = buck_set_hw_dvs_levels,
708 },
709 .dvs = {
710 /*
711 * LDO7 only supports single voltage for all states.
712 * voltage can be individually enabled for each state
713 * though => allow setting all states to support
714 * enabling power rail on different states.
715 */
716 .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE |
717 ROHM_DVS_LEVEL_SUSPEND |
718 ROHM_DVS_LEVEL_LPSR,
719 .run_reg = BD71828_REG_LDO7_VOLT,
720 .idle_reg = BD71828_REG_LDO7_VOLT,
721 .suspend_reg = BD71828_REG_LDO7_VOLT,
722 .lpsr_reg = BD71828_REG_LDO7_VOLT,
723 .run_mask = BD71828_MASK_LDO_VOLT,
724 .idle_mask = BD71828_MASK_LDO_VOLT,
725 .suspend_mask = BD71828_MASK_LDO_VOLT,
726 .lpsr_mask = BD71828_MASK_LDO_VOLT,
727 .idle_on_mask = BD71828_MASK_IDLE_EN,
728 .suspend_on_mask = BD71828_MASK_SUSP_EN,
729 .lpsr_on_mask = BD71828_MASK_LPSR_EN,
730 },
731
732 },
733 };
734
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[linuxppc:next-test 150/209] arch/powerpc/mm/book3s64/radix_pgtable.c:183:6: error: no previous prototype for 'radix__change_memory_range'
by kernel test robot
tree: https://github.com/linuxppc/linux next-test
head: 7626ae32a84371a7790955cc086d1f570b2e14ba
commit: bd573a81312fd9d6520b1cc81a88fd29e670e1ff [150/209] powerpc/mm/64s: Allow STRICT_KERNEL_RWX again
config: powerpc-skiroot_defconfig (attached as .config)
compiler: powerpc64le-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
# https://github.com/linuxppc/linux/commit/bd573a81312fd9d6520b1cc81a88fd29...
git remote add linuxppc https://github.com/linuxppc/linux
git fetch --no-tags linuxppc next-test
git checkout bd573a81312fd9d6520b1cc81a88fd29e670e1ff
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/powerpc/mm/book3s64/radix_pgtable.c:183:6: error: no previous prototype for 'radix__change_memory_range' [-Werror=missing-prototypes]
183 | void radix__change_memory_range(unsigned long start, unsigned long end,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/radix__change_memory_range +183 arch/powerpc/mm/book3s64/radix_pgtable.c
2ad452ffaaa8d2 arch/powerpc/mm/pgtable-radix.c Nicholas Piggin 2018-02-14 181
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 182 #ifdef CONFIG_STRICT_KERNEL_RWX
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 @183 void radix__change_memory_range(unsigned long start, unsigned long end,
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 184 unsigned long clear)
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 185 {
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 186 unsigned long idx;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 187 pgd_t *pgdp;
2fb4706057bcf8 arch/powerpc/mm/book3s64/radix_pgtable.c Mike Rapoport 2020-06-04 188 p4d_t *p4dp;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 189 pud_t *pudp;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 190 pmd_t *pmdp;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 191 pte_t *ptep;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 192
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 193 start = ALIGN_DOWN(start, PAGE_SIZE);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 194 end = PAGE_ALIGN(end); // aligns up
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 195
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 196 pr_debug("Changing flags on range %lx-%lx removing 0x%lx\n",
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 197 start, end, clear);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 198
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 199 for (idx = start; idx < end; idx += PAGE_SIZE) {
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 200 pgdp = pgd_offset_k(idx);
2fb4706057bcf8 arch/powerpc/mm/book3s64/radix_pgtable.c Mike Rapoport 2020-06-04 201 p4dp = p4d_offset(pgdp, idx);
2fb4706057bcf8 arch/powerpc/mm/book3s64/radix_pgtable.c Mike Rapoport 2020-06-04 202 pudp = pud_alloc(&init_mm, p4dp, idx);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 203 if (!pudp)
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 204 continue;
d6eacedd1f0ebf arch/powerpc/mm/book3s64/radix_pgtable.c Aneesh Kumar K.V 2019-05-14 205 if (pud_is_leaf(*pudp)) {
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 206 ptep = (pte_t *)pudp;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 207 goto update_the_pte;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 208 }
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 209 pmdp = pmd_alloc(&init_mm, pudp, idx);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 210 if (!pmdp)
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 211 continue;
d6eacedd1f0ebf arch/powerpc/mm/book3s64/radix_pgtable.c Aneesh Kumar K.V 2019-05-14 212 if (pmd_is_leaf(*pmdp)) {
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 213 ptep = pmdp_ptep(pmdp);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 214 goto update_the_pte;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 215 }
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 216 ptep = pte_alloc_kernel(pmdp, idx);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 217 if (!ptep)
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 218 continue;
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 219 update_the_pte:
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 220 radix__pte_update(&init_mm, idx, ptep, clear, 0, 0);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 221 }
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 222
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 223 radix__flush_tlb_kernel_range(start, end);
7614ff3272a115 arch/powerpc/mm/pgtable-radix.c Balbir Singh 2017-06-29 224 }
b134bd90286dc9 arch/powerpc/mm/pgtable-radix.c Michael Ellerman 2017-07-14 225
:::::: The code at line 183 was first introduced by commit
:::::: b134bd90286dc9f2952c35a91ab405474ca9374c powerpc/mm/radix: Refactor radix__mark_rodata_ro()
:::::: TO: Michael Ellerman <mpe(a)ellerman.id.au>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[linux-next:master 10444/12404] security/keys/trusted-keys/trusted_tpm2.c:38:25: warning: Either the condition '!scratch' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: dcf1b51d6b2ac5da234ae6883ed0e9422c339588
commit: 14676f1eb79660b6ee262644fa788a5c42ac19e4 [10444/12404] security: keys: trusted: use ASN.1 TPM2 key format for the blobs
compiler: hppa64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> security/keys/trusted-keys/trusted_tpm2.c:38:25: warning: Either the condition '!scratch' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
u8 *end_work = scratch + SCRATCH_SIZE;
^
security/keys/trusted-keys/trusted_tpm2.c:50:6: note: Assuming that condition '!scratch' is not redundant
if (!scratch)
^
security/keys/trusted-keys/trusted_tpm2.c:38:25: note: Null pointer addition
u8 *end_work = scratch + SCRATCH_SIZE;
^
vim +38 security/keys/trusted-keys/trusted_tpm2.c
14676f1eb79660 James Bottomley 2021-01-27 30
14676f1eb79660 James Bottomley 2021-01-27 31 static int tpm2_key_encode(struct trusted_key_payload *payload,
14676f1eb79660 James Bottomley 2021-01-27 32 struct trusted_key_options *options,
14676f1eb79660 James Bottomley 2021-01-27 33 u8 *src, u32 len)
14676f1eb79660 James Bottomley 2021-01-27 34 {
14676f1eb79660 James Bottomley 2021-01-27 35 const int SCRATCH_SIZE = PAGE_SIZE;
14676f1eb79660 James Bottomley 2021-01-27 36 u8 *scratch = kmalloc(SCRATCH_SIZE, GFP_KERNEL);
14676f1eb79660 James Bottomley 2021-01-27 37 u8 *work = scratch, *work1;
14676f1eb79660 James Bottomley 2021-01-27 @38 u8 *end_work = scratch + SCRATCH_SIZE;
14676f1eb79660 James Bottomley 2021-01-27 39 u8 *priv, *pub;
14676f1eb79660 James Bottomley 2021-01-27 40 u16 priv_len, pub_len;
14676f1eb79660 James Bottomley 2021-01-27 41
14676f1eb79660 James Bottomley 2021-01-27 42 priv_len = get_unaligned_be16(src) + 2;
14676f1eb79660 James Bottomley 2021-01-27 43 priv = src;
14676f1eb79660 James Bottomley 2021-01-27 44
14676f1eb79660 James Bottomley 2021-01-27 45 src += priv_len;
14676f1eb79660 James Bottomley 2021-01-27 46
14676f1eb79660 James Bottomley 2021-01-27 47 pub_len = get_unaligned_be16(src) + 2;
14676f1eb79660 James Bottomley 2021-01-27 48 pub = src;
14676f1eb79660 James Bottomley 2021-01-27 49
14676f1eb79660 James Bottomley 2021-01-27 50 if (!scratch)
14676f1eb79660 James Bottomley 2021-01-27 51 return -ENOMEM;
14676f1eb79660 James Bottomley 2021-01-27 52
14676f1eb79660 James Bottomley 2021-01-27 53 work = asn1_encode_oid(work, end_work, tpm2key_oid,
14676f1eb79660 James Bottomley 2021-01-27 54 asn1_oid_len(tpm2key_oid));
14676f1eb79660 James Bottomley 2021-01-27 55
14676f1eb79660 James Bottomley 2021-01-27 56 if (options->blobauth_len == 0) {
14676f1eb79660 James Bottomley 2021-01-27 57 unsigned char bool[3], *w = bool;
14676f1eb79660 James Bottomley 2021-01-27 58 /* tag 0 is emptyAuth */
14676f1eb79660 James Bottomley 2021-01-27 59 w = asn1_encode_boolean(w, w + sizeof(bool), true);
14676f1eb79660 James Bottomley 2021-01-27 60 if (WARN(IS_ERR(w), "BUG: Boolean failed to encode"))
14676f1eb79660 James Bottomley 2021-01-27 61 return PTR_ERR(w);
14676f1eb79660 James Bottomley 2021-01-27 62 work = asn1_encode_tag(work, end_work, 0, bool, w - bool);
14676f1eb79660 James Bottomley 2021-01-27 63 }
14676f1eb79660 James Bottomley 2021-01-27 64
14676f1eb79660 James Bottomley 2021-01-27 65 /*
14676f1eb79660 James Bottomley 2021-01-27 66 * Assume both octet strings will encode to a 2 byte definite length
14676f1eb79660 James Bottomley 2021-01-27 67 *
14676f1eb79660 James Bottomley 2021-01-27 68 * Note: For a well behaved TPM, this warning should never
14676f1eb79660 James Bottomley 2021-01-27 69 * trigger, so if it does there's something nefarious going on
14676f1eb79660 James Bottomley 2021-01-27 70 */
14676f1eb79660 James Bottomley 2021-01-27 71 if (WARN(work - scratch + pub_len + priv_len + 14 > SCRATCH_SIZE,
14676f1eb79660 James Bottomley 2021-01-27 72 "BUG: scratch buffer is too small"))
14676f1eb79660 James Bottomley 2021-01-27 73 return -EINVAL;
14676f1eb79660 James Bottomley 2021-01-27 74
14676f1eb79660 James Bottomley 2021-01-27 75 work = asn1_encode_integer(work, end_work, options->keyhandle);
14676f1eb79660 James Bottomley 2021-01-27 76 work = asn1_encode_octet_string(work, end_work, pub, pub_len);
14676f1eb79660 James Bottomley 2021-01-27 77 work = asn1_encode_octet_string(work, end_work, priv, priv_len);
14676f1eb79660 James Bottomley 2021-01-27 78
14676f1eb79660 James Bottomley 2021-01-27 79 work1 = payload->blob;
14676f1eb79660 James Bottomley 2021-01-27 80 work1 = asn1_encode_sequence(work1, work1 + sizeof(payload->blob),
14676f1eb79660 James Bottomley 2021-01-27 81 scratch, work - scratch);
14676f1eb79660 James Bottomley 2021-01-27 82 if (WARN(IS_ERR(work1), "BUG: ASN.1 encoder failed"))
14676f1eb79660 James Bottomley 2021-01-27 83 return PTR_ERR(work1);
14676f1eb79660 James Bottomley 2021-01-27 84
14676f1eb79660 James Bottomley 2021-01-27 85 return work1 - payload->blob;
14676f1eb79660 James Bottomley 2021-01-27 86 }
14676f1eb79660 James Bottomley 2021-01-27 87
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[mkp-scsi:for-next 304/324] drivers/scsi/smartpqi/smartpqi_sas_transport.c:97 pqi_sas_port_add_rphy() warn: variable dereferenced before check 'pqi_sas_port->device' (see line 95)
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head: 857a80bbd7321161f986588160d97815d1b1206a
commit: ec504b23df9d33260602affc50389cf070707c9b [304/324] scsi: smartpqi: Add phy ID support for the physical drives
config: i386-randconfig-m021-20210406 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/scsi/smartpqi/smartpqi_sas_transport.c:97 pqi_sas_port_add_rphy() warn: variable dereferenced before check 'pqi_sas_port->device' (see line 95)
vim +97 drivers/scsi/smartpqi/smartpqi_sas_transport.c
6c223761eb5482 Kevin Barnett 2016-06-27 87
6c223761eb5482 Kevin Barnett 2016-06-27 88 static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port,
6c223761eb5482 Kevin Barnett 2016-06-27 89 struct sas_rphy *rphy)
6c223761eb5482 Kevin Barnett 2016-06-27 90 {
6c223761eb5482 Kevin Barnett 2016-06-27 91 struct sas_identify *identify;
6c223761eb5482 Kevin Barnett 2016-06-27 92
6c223761eb5482 Kevin Barnett 2016-06-27 93 identify = &rphy->identify;
6c223761eb5482 Kevin Barnett 2016-06-27 94 identify->sas_address = pqi_sas_port->sas_address;
ec504b23df9d33 Murthy Bhat 2021-03-11 @95 identify->phy_identifier = pqi_sas_port->device->phy_id;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dereference
3d46a59a191e81 Don Brace 2018-12-07 96
3d46a59a191e81 Don Brace 2018-12-07 @97 if (pqi_sas_port->device &&
^^^^^^^^^^^^^^^^^^^^
Checked too late.
3d46a59a191e81 Don Brace 2018-12-07 98 pqi_sas_port->device->is_expander_smp_device) {
3d46a59a191e81 Don Brace 2018-12-07 99 identify->initiator_port_protocols = SAS_PROTOCOL_SMP;
3d46a59a191e81 Don Brace 2018-12-07 100 identify->target_port_protocols = SAS_PROTOCOL_SMP;
3d46a59a191e81 Don Brace 2018-12-07 101 } else {
6c223761eb5482 Kevin Barnett 2016-06-27 102 identify->initiator_port_protocols = SAS_PROTOCOL_STP;
6c223761eb5482 Kevin Barnett 2016-06-27 103 identify->target_port_protocols = SAS_PROTOCOL_STP;
3d46a59a191e81 Don Brace 2018-12-07 104 }
6c223761eb5482 Kevin Barnett 2016-06-27 105
6c223761eb5482 Kevin Barnett 2016-06-27 106 return sas_rphy_add(rphy);
6c223761eb5482 Kevin Barnett 2016-06-27 107 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[PATCH] perf/core: fix memdup_user.cocci warnings
by kernel test robot
From: kernel test robot <lkp(a)intel.com>
kernel/events/core.c:5925:13-20: WARNING opportunity for memdup_user
Use memdup_user rather than duplicating its implementation
This is a little bit restricted to reduce false positives
Generated by: scripts/coccinelle/api/memdup_user.cocci
CC: Namhyung Kim <namhyung(a)kernel.org>
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
url: https://github.com/0day-ci/linux/commits/Namhyung-Kim/perf-core-Sharing-e...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git cface0326a6c2ae5c8f47bd466f07624b3e348a7
core.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5922,15 +5922,9 @@ static long _perf_ioctl(struct perf_even
cgrp_bufsz = nr_cgrps * sizeof(*cgrp_buf);
- cgrp_buf = kmalloc(cgrp_bufsz, GFP_KERNEL);
- if (cgrp_buf == NULL)
- return -ENOMEM;
-
- if (copy_from_user(cgrp_buf, (u64 __user *)(arg + 8),
- cgrp_bufsz)) {
- kfree(cgrp_buf);
- return -EFAULT;
- }
+ cgrp_buf = memdup_user((u64 __user *)(arg + 8), cgrp_bufsz);
+ if (IS_ERR(cgrp_buf))
+ return PTR_ERR(cgrp_buf);
ret = perf_event_attach_cgroup_node(event, nr_cgrps, cgrp_buf);
1 year, 5 months
Re: [PATCH v2 15/16] mm: multigenerational lru: Kconfig
by kernel test robot
Hi Yu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/x86/core]
[also build test ERROR on cgroup/for-next tip/x86/mm fuse/for-next tip/perf/core tip/sched/core linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210413]
[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/Yu-Zhao/Multigenerational-LRU-Fr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 99cb64de36d5c9397a664808b92943e35bdce25e
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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
# https://github.com/0day-ci/linux/commit/f05f4c64bb8f0b8bcc40c9931f51bffdb...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
git checkout f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> mm/vmscan.c:4704:16: error: variably modified 'bitmap' at file scope
4704 | unsigned long bitmap[BITS_TO_LONGS(PTRS_PER_PMD)];
| ^~~~~~
vim +/bitmap +4704 mm/vmscan.c
46b27b9e9608eb Yu Zhao 2021-04-13 4691
46b27b9e9608eb Yu Zhao 2021-04-13 4692 struct mm_walk_args {
46b27b9e9608eb Yu Zhao 2021-04-13 4693 struct mem_cgroup *memcg;
46b27b9e9608eb Yu Zhao 2021-04-13 4694 unsigned long max_seq;
46b27b9e9608eb Yu Zhao 2021-04-13 4695 unsigned long next_addr;
46b27b9e9608eb Yu Zhao 2021-04-13 4696 unsigned long start_pfn;
46b27b9e9608eb Yu Zhao 2021-04-13 4697 unsigned long end_pfn;
46b27b9e9608eb Yu Zhao 2021-04-13 4698 int node_id;
46b27b9e9608eb Yu Zhao 2021-04-13 4699 int batch_size;
46b27b9e9608eb Yu Zhao 2021-04-13 4700 int mm_stats[NR_MM_STATS];
46b27b9e9608eb Yu Zhao 2021-04-13 4701 int nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES];
46b27b9e9608eb Yu Zhao 2021-04-13 4702 bool should_walk[ANON_AND_FILE];
46b27b9e9608eb Yu Zhao 2021-04-13 4703 #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG)
46b27b9e9608eb Yu Zhao 2021-04-13 @4704 unsigned long bitmap[BITS_TO_LONGS(PTRS_PER_PMD)];
46b27b9e9608eb Yu Zhao 2021-04-13 4705 #endif
46b27b9e9608eb Yu Zhao 2021-04-13 4706 };
46b27b9e9608eb Yu Zhao 2021-04-13 4707
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months