Message ID | 1523242375-3937-1-git-send-email-srplinux2008@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Eduardo Valentin |
Headers | show |
Hi srp, Thank you for the patch! Yet something to improve: [auto build test ERROR on thermal/next] [also build test ERROR on v4.16 next-20180406] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/srplinux2008/thermal-devfreq_cooling-add-const-to-struct-thermal_cooling_device_ops/20180409-105457 base: https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git next config: x86_64-randconfig-x010-201814 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers//thermal/devfreq_cooling.c: In function 'of_devfreq_cooling_register_power': >> drivers//thermal/devfreq_cooling.c:522:43: error: assignment of member 'get_requested_power' in read-only object devfreq_cooling_ops.get_requested_power = ^ >> drivers//thermal/devfreq_cooling.c:524:35: error: assignment of member 'state2power' in read-only object devfreq_cooling_ops.state2power = devfreq_cooling_state2power; ^ >> drivers//thermal/devfreq_cooling.c:525:35: error: assignment of member 'power2state' in read-only object devfreq_cooling_ops.power2state = devfreq_cooling_power2state; ^ vim +/get_requested_power +522 drivers//thermal/devfreq_cooling.c a76caf55 Ørjan Eide 2015-09-10 488 a76caf55 Ørjan Eide 2015-09-10 489 /** a76caf55 Ørjan Eide 2015-09-10 490 * of_devfreq_cooling_register_power() - Register devfreq cooling device, a76caf55 Ørjan Eide 2015-09-10 491 * with OF and power information. a76caf55 Ørjan Eide 2015-09-10 492 * @np: Pointer to OF device_node. a76caf55 Ørjan Eide 2015-09-10 493 * @df: Pointer to devfreq device. a76caf55 Ørjan Eide 2015-09-10 494 * @dfc_power: Pointer to devfreq_cooling_power. a76caf55 Ørjan Eide 2015-09-10 495 * a76caf55 Ørjan Eide 2015-09-10 496 * Register a devfreq cooling device. The available OPPs must be a76caf55 Ørjan Eide 2015-09-10 497 * registered on the device. a76caf55 Ørjan Eide 2015-09-10 498 * a76caf55 Ørjan Eide 2015-09-10 499 * If @dfc_power is provided, the cooling device is registered with the a76caf55 Ørjan Eide 2015-09-10 500 * power extensions. For the power extensions to work correctly, a76caf55 Ørjan Eide 2015-09-10 501 * devfreq should use the simple_ondemand governor, other governors a76caf55 Ørjan Eide 2015-09-10 502 * are not currently supported. a76caf55 Ørjan Eide 2015-09-10 503 */ 3c99c2ce Javi Merino 2015-11-02 504 struct thermal_cooling_device * a76caf55 Ørjan Eide 2015-09-10 505 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, a76caf55 Ørjan Eide 2015-09-10 506 struct devfreq_cooling_power *dfc_power) a76caf55 Ørjan Eide 2015-09-10 507 { a76caf55 Ørjan Eide 2015-09-10 508 struct thermal_cooling_device *cdev; a76caf55 Ørjan Eide 2015-09-10 509 struct devfreq_cooling_device *dfc; a76caf55 Ørjan Eide 2015-09-10 510 char dev_name[THERMAL_NAME_LENGTH]; a76caf55 Ørjan Eide 2015-09-10 511 int err; a76caf55 Ørjan Eide 2015-09-10 512 a76caf55 Ørjan Eide 2015-09-10 513 dfc = kzalloc(sizeof(*dfc), GFP_KERNEL); a76caf55 Ørjan Eide 2015-09-10 514 if (!dfc) a76caf55 Ørjan Eide 2015-09-10 515 return ERR_PTR(-ENOMEM); a76caf55 Ørjan Eide 2015-09-10 516 a76caf55 Ørjan Eide 2015-09-10 517 dfc->devfreq = df; a76caf55 Ørjan Eide 2015-09-10 518 a76caf55 Ørjan Eide 2015-09-10 519 if (dfc_power) { a76caf55 Ørjan Eide 2015-09-10 520 dfc->power_ops = dfc_power; a76caf55 Ørjan Eide 2015-09-10 521 a76caf55 Ørjan Eide 2015-09-10 @522 devfreq_cooling_ops.get_requested_power = a76caf55 Ørjan Eide 2015-09-10 523 devfreq_cooling_get_requested_power; a76caf55 Ørjan Eide 2015-09-10 @524 devfreq_cooling_ops.state2power = devfreq_cooling_state2power; a76caf55 Ørjan Eide 2015-09-10 @525 devfreq_cooling_ops.power2state = devfreq_cooling_power2state; a76caf55 Ørjan Eide 2015-09-10 526 } a76caf55 Ørjan Eide 2015-09-10 527 a76caf55 Ørjan Eide 2015-09-10 528 err = devfreq_cooling_gen_tables(dfc); a76caf55 Ørjan Eide 2015-09-10 529 if (err) a76caf55 Ørjan Eide 2015-09-10 530 goto free_dfc; a76caf55 Ørjan Eide 2015-09-10 531 2f96c035 Matthew Wilcox 2016-12-21 532 err = ida_simple_get(&devfreq_ida, 0, 0, GFP_KERNEL); 2f96c035 Matthew Wilcox 2016-12-21 533 if (err < 0) a76caf55 Ørjan Eide 2015-09-10 534 goto free_tables; 2f96c035 Matthew Wilcox 2016-12-21 535 dfc->id = err; a76caf55 Ørjan Eide 2015-09-10 536 a76caf55 Ørjan Eide 2015-09-10 537 snprintf(dev_name, sizeof(dev_name), "thermal-devfreq-%d", dfc->id); a76caf55 Ørjan Eide 2015-09-10 538 a76caf55 Ørjan Eide 2015-09-10 539 cdev = thermal_of_cooling_device_register(np, dev_name, dfc, a76caf55 Ørjan Eide 2015-09-10 540 &devfreq_cooling_ops); a76caf55 Ørjan Eide 2015-09-10 541 if (IS_ERR(cdev)) { a76caf55 Ørjan Eide 2015-09-10 542 err = PTR_ERR(cdev); a76caf55 Ørjan Eide 2015-09-10 543 dev_err(df->dev.parent, a76caf55 Ørjan Eide 2015-09-10 544 "Failed to register devfreq cooling device (%d)\n", a76caf55 Ørjan Eide 2015-09-10 545 err); 2f96c035 Matthew Wilcox 2016-12-21 546 goto release_ida; a76caf55 Ørjan Eide 2015-09-10 547 } a76caf55 Ørjan Eide 2015-09-10 548 a76caf55 Ørjan Eide 2015-09-10 549 dfc->cdev = cdev; a76caf55 Ørjan Eide 2015-09-10 550 3c99c2ce Javi Merino 2015-11-02 551 return cdev; a76caf55 Ørjan Eide 2015-09-10 552 2f96c035 Matthew Wilcox 2016-12-21 553 release_ida: 2f96c035 Matthew Wilcox 2016-12-21 554 ida_simple_remove(&devfreq_ida, dfc->id); a76caf55 Ørjan Eide 2015-09-10 555 free_tables: a76caf55 Ørjan Eide 2015-09-10 556 kfree(dfc->power_table); a76caf55 Ørjan Eide 2015-09-10 557 kfree(dfc->freq_table); a76caf55 Ørjan Eide 2015-09-10 558 free_dfc: a76caf55 Ørjan Eide 2015-09-10 559 kfree(dfc); a76caf55 Ørjan Eide 2015-09-10 560 a76caf55 Ørjan Eide 2015-09-10 561 return ERR_PTR(err); a76caf55 Ørjan Eide 2015-09-10 562 } a76caf55 Ørjan Eide 2015-09-10 563 EXPORT_SYMBOL_GPL(of_devfreq_cooling_register_power); a76caf55 Ørjan Eide 2015-09-10 564 :::::: The code at line 522 was first introduced by commit :::::: a76caf55e5b356ba20a5a43ac4d9f7a04b20941d thermal: Add devfreq cooling :::::: TO: Ørjan Eide <orjan.eide@arm.com> :::::: CC: Eduardo Valentin <edubezval@gmail.com> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index ef59256..80efc4e 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -392,7 +392,7 @@ static int devfreq_cooling_power2state(struct thermal_cooling_device *cdev, return 0; } -static struct thermal_cooling_device_ops devfreq_cooling_ops = { +static const struct thermal_cooling_device_ops devfreq_cooling_ops = { .get_max_state = devfreq_cooling_get_max_state, .get_cur_state = devfreq_cooling_get_cur_state, .set_cur_state = devfreq_cooling_set_cur_state,