[ulf.hansson-mmc:acpi_pm_domain_wip 7/9] drivers/acpi/acpi_lpss.c:1044:0: error: unterminated argument list invoking macro "if"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git acpi_pm_domain_wip
head:   bc3f10d6d60972e92bdaf1696669aa6679f0fff1
commit: bb07d8dee211eb570c780cda9c1d47b66de278e0 [7/9] PM / ACPI: Enable the runtime PM centric approach for system sleep
config: i386-randconfig-x008-201725 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout bb07d8dee211eb570c780cda9c1d47b66de278e0
        # save the attached .config to linux build tree
        make ARCH=i386 

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

   drivers/acpi/acpi_lpss.c: In function 'acpi_lpss_runtime_suspend':
>> drivers/acpi/acpi_lpss.c:1044:0: error: unterminated argument list invoking macro "if"
    #endif /* CONFIG_X86_INTEL_LPSS */
    
>> drivers/acpi/acpi_lpss.c:860:2: error: expected '(' at end of input
     if (!pm_runtime_enabled(dev)
     ^~
>> drivers/acpi/acpi_lpss.c:860:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   drivers/acpi/acpi_lpss.c:1044:0: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
    #endif /* CONFIG_X86_INTEL_LPSS */
    
>> drivers/acpi/acpi_lpss.c:860:2: error: expected declaration or statement at end of input
     if (!pm_runtime_enabled(dev)
     ^~
   drivers/acpi/acpi_lpss.c:853:28: warning: unused variable 'pdata' [-Wunused-variable]
     struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
                               ^~~~~
   At top level:
   drivers/acpi/acpi_lpss.c:851:12: warning: 'acpi_lpss_runtime_suspend' defined but not used [-Wunused-function]
    static int acpi_lpss_runtime_suspend(struct device *dev)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:829:13: warning: 'lpss_iosf_exit_d3_state' defined but not used [-Wunused-function]
    static void lpss_iosf_exit_d3_state(void)
                ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:784:13: warning: 'lpss_iosf_enter_d3_state' defined but not used [-Wunused-function]
    static void lpss_iosf_enter_d3_state(void)
                ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:744:12: warning: 'acpi_lpss_resume_early' defined but not used [-Wunused-function]
    static int acpi_lpss_resume_early(struct device *dev)
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:715:12: warning: 'acpi_lpss_suspend_late' defined but not used [-Wunused-function]
    static int acpi_lpss_suspend_late(struct device *dev)
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:699:13: warning: 'acpi_lpss_dismiss' defined but not used [-Wunused-function]
    static void acpi_lpss_dismiss(struct device *dev)
                ^~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:676:12: warning: 'acpi_lpss_activate' defined but not used [-Wunused-function]
    static int acpi_lpss_activate(struct device *dev)
               ^~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:584:13: warning: 'acpi_lpss_set_ltr' defined but not used [-Wunused-function]
    static void acpi_lpss_set_ltr(struct device *dev, s32 val)
                ^~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:579:31: warning: 'lpss_attr_group' defined but not used [-Wunused-variable]
    static struct attribute_group lpss_attr_group = {
                                  ^~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:417:12: warning: 'acpi_lpss_create_device' defined but not used [-Wunused-function]
    static int acpi_lpss_create_device(struct acpi_device *adev,
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpi_lpss.c:97:21: warning: 'lpss_quirks' defined but not used [-Wunused-variable]
    static unsigned int lpss_quirks;
                        ^~~~~~~~~~~

vim +/if +1044 drivers/acpi/acpi_lpss.c

cb39dcdd4 Andy Shevchenko   2014-11-05   854  	int ret;
c78b08306 Heikki Krogerus   2014-05-23   855  
cb39dcdd4 Andy Shevchenko   2014-11-05   856  	ret = pm_generic_runtime_suspend(dev);
c78b08306 Heikki Krogerus   2014-05-23   857  	if (ret)
c78b08306 Heikki Krogerus   2014-05-23   858  		return ret;
c78b08306 Heikki Krogerus   2014-05-23   859  
bb07d8dee Ulf Hansson       2017-06-19  @860  	if (!pm_runtime_enabled(dev)
bb07d8dee Ulf Hansson       2017-06-19   861  		return lpss_suspend_late(dev);
bb07d8dee Ulf Hansson       2017-06-19   862  
cb39dcdd4 Andy Shevchenko   2014-11-05   863  	if (pdata->dev_desc->flags & LPSS_SAVE_CTX)
cb39dcdd4 Andy Shevchenko   2014-11-05   864  		acpi_lpss_save_ctx(dev, pdata);
cb39dcdd4 Andy Shevchenko   2014-11-05   865  
eebb3e8d8 Andy Shevchenko   2015-12-12   866  	ret = acpi_dev_runtime_suspend(dev);
eebb3e8d8 Andy Shevchenko   2015-12-12   867  
eebb3e8d8 Andy Shevchenko   2015-12-12   868  	/*
eebb3e8d8 Andy Shevchenko   2015-12-12   869  	 * This call must be last in the sequence, otherwise PMC will return
eebb3e8d8 Andy Shevchenko   2015-12-12   870  	 * wrong status for devices being about to be powered off. See
eebb3e8d8 Andy Shevchenko   2015-12-12   871  	 * lpss_iosf_enter_d3_state() for further information.
eebb3e8d8 Andy Shevchenko   2015-12-12   872  	 */
eebb3e8d8 Andy Shevchenko   2015-12-12   873  	if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
eebb3e8d8 Andy Shevchenko   2015-12-12   874  		lpss_iosf_enter_d3_state();
eebb3e8d8 Andy Shevchenko   2015-12-12   875  
eebb3e8d8 Andy Shevchenko   2015-12-12   876  	return ret;
c78b08306 Heikki Krogerus   2014-05-23   877  }
c78b08306 Heikki Krogerus   2014-05-23   878  
c78b08306 Heikki Krogerus   2014-05-23   879  static int acpi_lpss_runtime_resume(struct device *dev)
c78b08306 Heikki Krogerus   2014-05-23   880  {
cb39dcdd4 Andy Shevchenko   2014-11-05   881  	struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
cb39dcdd4 Andy Shevchenko   2014-11-05   882  	int ret;
c78b08306 Heikki Krogerus   2014-05-23   883  
bb07d8dee Ulf Hansson       2017-06-19   884  	if (pm_runtime_enabled(dev)) {
eebb3e8d8 Andy Shevchenko   2015-12-12   885  		/*
eebb3e8d8 Andy Shevchenko   2015-12-12   886  		 * This call is kept first to be in symmetry with
eebb3e8d8 Andy Shevchenko   2015-12-12   887  		 * acpi_lpss_runtime_suspend() one.
eebb3e8d8 Andy Shevchenko   2015-12-12   888  		 */
bb07d8dee Ulf Hansson       2017-06-19   889  		if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON &&
bb07d8dee Ulf Hansson       2017-06-19   890  		    iosf_mbi_available())
eebb3e8d8 Andy Shevchenko   2015-12-12   891  			lpss_iosf_exit_d3_state();
eebb3e8d8 Andy Shevchenko   2015-12-12   892  
cb39dcdd4 Andy Shevchenko   2014-11-05   893  		ret = acpi_dev_runtime_resume(dev);
c78b08306 Heikki Krogerus   2014-05-23   894  		if (ret)
c78b08306 Heikki Krogerus   2014-05-23   895  			return ret;
c78b08306 Heikki Krogerus   2014-05-23   896  
02b985404 Andy Shevchenko   2015-12-04   897  		acpi_lpss_d3_to_d0_delay(pdata);
02b985404 Andy Shevchenko   2015-12-04   898  
cb39dcdd4 Andy Shevchenko   2014-11-05   899  		if (pdata->dev_desc->flags & LPSS_SAVE_CTX)
cb39dcdd4 Andy Shevchenko   2014-11-05   900  			acpi_lpss_restore_ctx(dev, pdata);
cb39dcdd4 Andy Shevchenko   2014-11-05   901  
bb07d8dee Ulf Hansson       2017-06-19   902  	} else {
bb07d8dee Ulf Hansson       2017-06-19   903  		ret = lpss_resume_early(dev);
bb07d8dee Ulf Hansson       2017-06-19   904  		if (ret)
bb07d8dee Ulf Hansson       2017-06-19   905  			return ret;
bb07d8dee Ulf Hansson       2017-06-19   906  	}
bb07d8dee Ulf Hansson       2017-06-19   907  
c78b08306 Heikki Krogerus   2014-05-23   908  	return pm_generic_runtime_resume(dev);
c78b08306 Heikki Krogerus   2014-05-23   909  }
c78b08306 Heikki Krogerus   2014-05-23   910  #endif /* CONFIG_PM */
c78b08306 Heikki Krogerus   2014-05-23   911  
c78b08306 Heikki Krogerus   2014-05-23   912  static struct dev_pm_domain acpi_lpss_pm_domain = {
c3a49cf35 Andy Shevchenko   2015-12-04   913  #ifdef CONFIG_PM
c3a49cf35 Andy Shevchenko   2015-12-04   914  	.activate = acpi_lpss_activate,
c3a49cf35 Andy Shevchenko   2015-12-04   915  	.dismiss = acpi_lpss_dismiss,
c3a49cf35 Andy Shevchenko   2015-12-04   916  #endif
c78b08306 Heikki Krogerus   2014-05-23   917  	.ops = {
5de21bb99 Rafael J. Wysocki 2014-11-27   918  #ifdef CONFIG_PM
c78b08306 Heikki Krogerus   2014-05-23   919  #ifdef CONFIG_PM_SLEEP
c78b08306 Heikki Krogerus   2014-05-23   920  		.prepare = acpi_subsys_prepare,
0ccc14c35 Ulf Hansson       2017-06-15   921  		.complete = acpi_subsys_complete,
c78b08306 Heikki Krogerus   2014-05-23   922  		.suspend = acpi_subsys_suspend,
f4168b617 Fu Zhonghui       2014-09-09   923  		.suspend_late = acpi_lpss_suspend_late,
f4168b617 Fu Zhonghui       2014-09-09   924  		.resume_early = acpi_lpss_resume_early,
c78b08306 Heikki Krogerus   2014-05-23   925  		.freeze = acpi_subsys_freeze,
c78b08306 Heikki Krogerus   2014-05-23   926  		.poweroff = acpi_subsys_suspend,
f4168b617 Fu Zhonghui       2014-09-09   927  		.poweroff_late = acpi_lpss_suspend_late,
f4168b617 Fu Zhonghui       2014-09-09   928  		.restore_early = acpi_lpss_resume_early,
c78b08306 Heikki Krogerus   2014-05-23   929  #endif
c78b08306 Heikki Krogerus   2014-05-23   930  		.runtime_suspend = acpi_lpss_runtime_suspend,
c78b08306 Heikki Krogerus   2014-05-23   931  		.runtime_resume = acpi_lpss_runtime_resume,
c78b08306 Heikki Krogerus   2014-05-23   932  #endif
c78b08306 Heikki Krogerus   2014-05-23   933  	},
c78b08306 Heikki Krogerus   2014-05-23   934  };
c78b08306 Heikki Krogerus   2014-05-23   935  
2e0f8822d Rafael J. Wysocki 2013-03-06   936  static int acpi_lpss_platform_notify(struct notifier_block *nb,
2e0f8822d Rafael J. Wysocki 2013-03-06   937  				     unsigned long action, void *data)
2e0f8822d Rafael J. Wysocki 2013-03-06   938  {
2e0f8822d Rafael J. Wysocki 2013-03-06   939  	struct platform_device *pdev = to_platform_device(data);
2e0f8822d Rafael J. Wysocki 2013-03-06   940  	struct lpss_private_data *pdata;
2e0f8822d Rafael J. Wysocki 2013-03-06   941  	struct acpi_device *adev;
2e0f8822d Rafael J. Wysocki 2013-03-06   942  	const struct acpi_device_id *id;
2e0f8822d Rafael J. Wysocki 2013-03-06   943  
2e0f8822d Rafael J. Wysocki 2013-03-06   944  	id = acpi_match_device(acpi_lpss_device_ids, &pdev->dev);
2e0f8822d Rafael J. Wysocki 2013-03-06   945  	if (!id || !id->driver_data)
2e0f8822d Rafael J. Wysocki 2013-03-06   946  		return 0;
2e0f8822d Rafael J. Wysocki 2013-03-06   947  
2e0f8822d Rafael J. Wysocki 2013-03-06   948  	if (acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
2e0f8822d Rafael J. Wysocki 2013-03-06   949  		return 0;
2e0f8822d Rafael J. Wysocki 2013-03-06   950  
2e0f8822d Rafael J. Wysocki 2013-03-06   951  	pdata = acpi_driver_data(adev);
cb39dcdd4 Andy Shevchenko   2014-11-05   952  	if (!pdata)
2e0f8822d Rafael J. Wysocki 2013-03-06   953  		return 0;
2e0f8822d Rafael J. Wysocki 2013-03-06   954  
cb39dcdd4 Andy Shevchenko   2014-11-05   955  	if (pdata->mmio_base &&
cb39dcdd4 Andy Shevchenko   2014-11-05   956  	    pdata->mmio_size < pdata->dev_desc->prv_offset + LPSS_LTR_SIZE) {
2e0f8822d Rafael J. Wysocki 2013-03-06   957  		dev_err(&pdev->dev, "MMIO size insufficient to access LTR\n");
2e0f8822d Rafael J. Wysocki 2013-03-06   958  		return 0;
2e0f8822d Rafael J. Wysocki 2013-03-06   959  	}
2e0f8822d Rafael J. Wysocki 2013-03-06   960  
c78b08306 Heikki Krogerus   2014-05-23   961  	switch (action) {
de16d5520 Andy Shevchenko   2015-12-04   962  	case BUS_NOTIFY_BIND_DRIVER:
989561de9 Tomeu Vizoso      2016-01-07   963  		dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain);
b5f88dd1d Andy Shevchenko   2015-12-04   964  		break;
de16d5520 Andy Shevchenko   2015-12-04   965  	case BUS_NOTIFY_DRIVER_NOT_BOUND:
b5f88dd1d Andy Shevchenko   2015-12-04   966  	case BUS_NOTIFY_UNBOUND_DRIVER:
5be6ada39 Andy Shevchenko   2016-02-01   967  		dev_pm_domain_set(&pdev->dev, NULL);
b5f88dd1d Andy Shevchenko   2015-12-04   968  		break;
b5f88dd1d Andy Shevchenko   2015-12-04   969  	case BUS_NOTIFY_ADD_DEVICE:
989561de9 Tomeu Vizoso      2016-01-07   970  		dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain);
ff8c1af5e Heikki Krogerus   2014-09-02   971  		if (pdata->dev_desc->flags & LPSS_LTR)
c78b08306 Heikki Krogerus   2014-05-23   972  			return sysfs_create_group(&pdev->dev.kobj,
c78b08306 Heikki Krogerus   2014-05-23   973  						  &lpss_attr_group);
01ac170ba Andy Shevchenko   2014-11-05   974  		break;
c78b08306 Heikki Krogerus   2014-05-23   975  	case BUS_NOTIFY_DEL_DEVICE:
ff8c1af5e Heikki Krogerus   2014-09-02   976  		if (pdata->dev_desc->flags & LPSS_LTR)
2e0f8822d Rafael J. Wysocki 2013-03-06   977  			sysfs_remove_group(&pdev->dev.kobj, &lpss_attr_group);
989561de9 Tomeu Vizoso      2016-01-07   978  		dev_pm_domain_set(&pdev->dev, NULL);
01ac170ba Andy Shevchenko   2014-11-05   979  		break;
c78b08306 Heikki Krogerus   2014-05-23   980  	default:
c78b08306 Heikki Krogerus   2014-05-23   981  		break;
c78b08306 Heikki Krogerus   2014-05-23   982  	}
2e0f8822d Rafael J. Wysocki 2013-03-06   983  
c78b08306 Heikki Krogerus   2014-05-23   984  	return 0;
2e0f8822d Rafael J. Wysocki 2013-03-06   985  }
2e0f8822d Rafael J. Wysocki 2013-03-06   986  
2e0f8822d Rafael J. Wysocki 2013-03-06   987  static struct notifier_block acpi_lpss_nb = {
2e0f8822d Rafael J. Wysocki 2013-03-06   988  	.notifier_call = acpi_lpss_platform_notify,
2e0f8822d Rafael J. Wysocki 2013-03-06   989  };
2e0f8822d Rafael J. Wysocki 2013-03-06   990  
1a8f83515 Rafael J. Wysocki 2014-02-11   991  static void acpi_lpss_bind(struct device *dev)
1a8f83515 Rafael J. Wysocki 2014-02-11   992  {
1a8f83515 Rafael J. Wysocki 2014-02-11   993  	struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
1a8f83515 Rafael J. Wysocki 2014-02-11   994  
ff8c1af5e Heikki Krogerus   2014-09-02   995  	if (!pdata || !pdata->mmio_base || !(pdata->dev_desc->flags & LPSS_LTR))
1a8f83515 Rafael J. Wysocki 2014-02-11   996  		return;
1a8f83515 Rafael J. Wysocki 2014-02-11   997  
1a8f83515 Rafael J. Wysocki 2014-02-11   998  	if (pdata->mmio_size >= pdata->dev_desc->prv_offset + LPSS_LTR_SIZE)
1a8f83515 Rafael J. Wysocki 2014-02-11   999  		dev->power.set_latency_tolerance = acpi_lpss_set_ltr;
1a8f83515 Rafael J. Wysocki 2014-02-11  1000  	else
1a8f83515 Rafael J. Wysocki 2014-02-11  1001  		dev_err(dev, "MMIO size insufficient to access LTR\n");
1a8f83515 Rafael J. Wysocki 2014-02-11  1002  }
1a8f83515 Rafael J. Wysocki 2014-02-11  1003  
1a8f83515 Rafael J. Wysocki 2014-02-11  1004  static void acpi_lpss_unbind(struct device *dev)
1a8f83515 Rafael J. Wysocki 2014-02-11  1005  {
1a8f83515 Rafael J. Wysocki 2014-02-11  1006  	dev->power.set_latency_tolerance = NULL;
1a8f83515 Rafael J. Wysocki 2014-02-11  1007  }
1a8f83515 Rafael J. Wysocki 2014-02-11  1008  
f58b082ae Rafael J. Wysocki 2013-03-06  1009  static struct acpi_scan_handler lpss_handler = {
f58b082ae Rafael J. Wysocki 2013-03-06  1010  	.ids = acpi_lpss_device_ids,
f58b082ae Rafael J. Wysocki 2013-03-06  1011  	.attach = acpi_lpss_create_device,
1a8f83515 Rafael J. Wysocki 2014-02-11  1012  	.bind = acpi_lpss_bind,
1a8f83515 Rafael J. Wysocki 2014-02-11  1013  	.unbind = acpi_lpss_unbind,
f58b082ae Rafael J. Wysocki 2013-03-06  1014  };
f58b082ae Rafael J. Wysocki 2013-03-06  1015  
f58b082ae Rafael J. Wysocki 2013-03-06  1016  void __init acpi_lpss_init(void)
f58b082ae Rafael J. Wysocki 2013-03-06  1017  {
eebb3e8d8 Andy Shevchenko   2015-12-12  1018  	const struct x86_cpu_id *id;
eebb3e8d8 Andy Shevchenko   2015-12-12  1019  	int ret;
eebb3e8d8 Andy Shevchenko   2015-12-12  1020  
eebb3e8d8 Andy Shevchenko   2015-12-12  1021  	ret = lpt_clk_init();
eebb3e8d8 Andy Shevchenko   2015-12-12  1022  	if (ret)
eebb3e8d8 Andy Shevchenko   2015-12-12  1023  		return;
eebb3e8d8 Andy Shevchenko   2015-12-12  1024  
eebb3e8d8 Andy Shevchenko   2015-12-12  1025  	id = x86_match_cpu(lpss_cpu_ids);
eebb3e8d8 Andy Shevchenko   2015-12-12  1026  	if (id)
eebb3e8d8 Andy Shevchenko   2015-12-12  1027  		lpss_quirks |= LPSS_QUIRK_ALWAYS_POWER_ON;
eebb3e8d8 Andy Shevchenko   2015-12-12  1028  
2e0f8822d Rafael J. Wysocki 2013-03-06  1029  	bus_register_notifier(&platform_bus_type, &acpi_lpss_nb);
f58b082ae Rafael J. Wysocki 2013-03-06  1030  	acpi_scan_add_handler(&lpss_handler);
f58b082ae Rafael J. Wysocki 2013-03-06  1031  }
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1032  
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1033  #else
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1034  
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1035  static struct acpi_scan_handler lpss_handler = {
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1036  	.ids = acpi_lpss_device_ids,
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1037  };
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1038  
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1039  void __init acpi_lpss_init(void)
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1040  {
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1041  	acpi_scan_add_handler(&lpss_handler);
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1042  }
d6ddaaac8 Rafael J. Wysocki 2014-05-30  1043  
d6ddaaac8 Rafael J. Wysocki 2014-05-30 @1044  #endif /* CONFIG_X86_INTEL_LPSS */

:::::: The code at line 1044 was first introduced by commit
:::::: d6ddaaac8f5c37ad84db3e6e019981f392389cf0 ACPI / scan: always register ACPI LPSS scan handler

:::::: TO: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux