Re: [PATCH v2] ACPI: platform_profile: Add support for notification chains

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

 



Hi Mario,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on linus/master v5.15-rc7 next-20211028]
[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/Mario-Limonciello/ACPI-platform_profile-Add-support-for-notification-chains/20211026-050443
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-a013-20211028 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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/753ef2d5047b65eb707df546173703ca66305f95
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mario-Limonciello/ACPI-platform_profile-Add-support-for-notification-chains/20211026-050443
        git checkout 753ef2d5047b65eb707df546173703ca66305f95
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/platform/x86/asus-wmi.c:2172:12: error: static declaration of 'platform_profile_get' follows non-static declaration
   static int platform_profile_get(struct platform_profile_handler *pprof,
              ^
   include/linux/platform_profile.h:42:5: note: previous declaration is here
   int platform_profile_get(enum platform_profile_option *profile);
       ^
>> drivers/platform/x86/asus-wmi.c:2239:45: error: incompatible function pointer types assigning to 'int (*)(struct platform_profile_handler *, enum platform_profile_option *)' from 'int (enum platform_profile_option *)' [-Werror,-Wincompatible-function-pointer-types]
           asus->platform_profile_handler.profile_get = platform_profile_get;
                                                      ^ ~~~~~~~~~~~~~~~~~~~~
   2 errors generated.


vim +/platform_profile_get +2172 drivers/platform/x86/asus-wmi.c

2daa86e78c494d Leonid Maksymchuk 2019-12-15  2170  
c63d44ae602419 Luke D. Jones     2021-08-19  2171  /* Platform profile ***********************************************************/
c63d44ae602419 Luke D. Jones     2021-08-19 @2172  static int platform_profile_get(struct platform_profile_handler *pprof,
c63d44ae602419 Luke D. Jones     2021-08-19  2173  				enum platform_profile_option *profile)
c63d44ae602419 Luke D. Jones     2021-08-19  2174  {
c63d44ae602419 Luke D. Jones     2021-08-19  2175  	struct asus_wmi *asus;
c63d44ae602419 Luke D. Jones     2021-08-19  2176  	int tp;
c63d44ae602419 Luke D. Jones     2021-08-19  2177  
c63d44ae602419 Luke D. Jones     2021-08-19  2178  	asus = container_of(pprof, struct asus_wmi, platform_profile_handler);
c63d44ae602419 Luke D. Jones     2021-08-19  2179  
c63d44ae602419 Luke D. Jones     2021-08-19  2180  	tp = asus->throttle_thermal_policy_mode;
c63d44ae602419 Luke D. Jones     2021-08-19  2181  
c63d44ae602419 Luke D. Jones     2021-08-19  2182  	switch (tp) {
c63d44ae602419 Luke D. Jones     2021-08-19  2183  	case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
c63d44ae602419 Luke D. Jones     2021-08-19  2184  		*profile = PLATFORM_PROFILE_BALANCED;
c63d44ae602419 Luke D. Jones     2021-08-19  2185  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2186  	case ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST:
c63d44ae602419 Luke D. Jones     2021-08-19  2187  		*profile = PLATFORM_PROFILE_PERFORMANCE;
c63d44ae602419 Luke D. Jones     2021-08-19  2188  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2189  	case ASUS_THROTTLE_THERMAL_POLICY_SILENT:
c63d44ae602419 Luke D. Jones     2021-08-19  2190  		*profile = PLATFORM_PROFILE_QUIET;
c63d44ae602419 Luke D. Jones     2021-08-19  2191  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2192  	default:
c63d44ae602419 Luke D. Jones     2021-08-19  2193  		return -EINVAL;
c63d44ae602419 Luke D. Jones     2021-08-19  2194  	}
c63d44ae602419 Luke D. Jones     2021-08-19  2195  
c63d44ae602419 Luke D. Jones     2021-08-19  2196  	return 0;
c63d44ae602419 Luke D. Jones     2021-08-19  2197  }
c63d44ae602419 Luke D. Jones     2021-08-19  2198  
c63d44ae602419 Luke D. Jones     2021-08-19  2199  static int platform_profile_set(struct platform_profile_handler *pprof,
c63d44ae602419 Luke D. Jones     2021-08-19  2200  				enum platform_profile_option profile)
c63d44ae602419 Luke D. Jones     2021-08-19  2201  {
c63d44ae602419 Luke D. Jones     2021-08-19  2202  	struct asus_wmi *asus;
c63d44ae602419 Luke D. Jones     2021-08-19  2203  	int tp;
c63d44ae602419 Luke D. Jones     2021-08-19  2204  
c63d44ae602419 Luke D. Jones     2021-08-19  2205  	asus = container_of(pprof, struct asus_wmi, platform_profile_handler);
c63d44ae602419 Luke D. Jones     2021-08-19  2206  
c63d44ae602419 Luke D. Jones     2021-08-19  2207  	switch (profile) {
c63d44ae602419 Luke D. Jones     2021-08-19  2208  	case PLATFORM_PROFILE_PERFORMANCE:
c63d44ae602419 Luke D. Jones     2021-08-19  2209  		tp = ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST;
c63d44ae602419 Luke D. Jones     2021-08-19  2210  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2211  	case PLATFORM_PROFILE_BALANCED:
c63d44ae602419 Luke D. Jones     2021-08-19  2212  		tp = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
c63d44ae602419 Luke D. Jones     2021-08-19  2213  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2214  	case PLATFORM_PROFILE_QUIET:
c63d44ae602419 Luke D. Jones     2021-08-19  2215  		tp = ASUS_THROTTLE_THERMAL_POLICY_SILENT;
c63d44ae602419 Luke D. Jones     2021-08-19  2216  		break;
c63d44ae602419 Luke D. Jones     2021-08-19  2217  	default:
c63d44ae602419 Luke D. Jones     2021-08-19  2218  		return -EOPNOTSUPP;
c63d44ae602419 Luke D. Jones     2021-08-19  2219  	}
c63d44ae602419 Luke D. Jones     2021-08-19  2220  
c63d44ae602419 Luke D. Jones     2021-08-19  2221  	asus->throttle_thermal_policy_mode = tp;
c63d44ae602419 Luke D. Jones     2021-08-19  2222  	return throttle_thermal_policy_write(asus);
c63d44ae602419 Luke D. Jones     2021-08-19  2223  }
c63d44ae602419 Luke D. Jones     2021-08-19  2224  
c63d44ae602419 Luke D. Jones     2021-08-19  2225  static int platform_profile_setup(struct asus_wmi *asus)
c63d44ae602419 Luke D. Jones     2021-08-19  2226  {
c63d44ae602419 Luke D. Jones     2021-08-19  2227  	struct device *dev = &asus->platform_device->dev;
c63d44ae602419 Luke D. Jones     2021-08-19  2228  	int err;
c63d44ae602419 Luke D. Jones     2021-08-19  2229  
c63d44ae602419 Luke D. Jones     2021-08-19  2230  	/*
c63d44ae602419 Luke D. Jones     2021-08-19  2231  	 * Not an error if a component platform_profile relies on is unavailable
c63d44ae602419 Luke D. Jones     2021-08-19  2232  	 * so early return, skipping the setup of platform_profile.
c63d44ae602419 Luke D. Jones     2021-08-19  2233  	 */
c63d44ae602419 Luke D. Jones     2021-08-19  2234  	if (!asus->throttle_thermal_policy_available)
c63d44ae602419 Luke D. Jones     2021-08-19  2235  		return 0;
c63d44ae602419 Luke D. Jones     2021-08-19  2236  
c63d44ae602419 Luke D. Jones     2021-08-19  2237  	dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n");
c63d44ae602419 Luke D. Jones     2021-08-19  2238  
c63d44ae602419 Luke D. Jones     2021-08-19 @2239  	asus->platform_profile_handler.profile_get = platform_profile_get;
c63d44ae602419 Luke D. Jones     2021-08-19  2240  	asus->platform_profile_handler.profile_set = platform_profile_set;
c63d44ae602419 Luke D. Jones     2021-08-19  2241  
c63d44ae602419 Luke D. Jones     2021-08-19  2242  	set_bit(PLATFORM_PROFILE_QUIET, asus->platform_profile_handler.choices);
c63d44ae602419 Luke D. Jones     2021-08-19  2243  	set_bit(PLATFORM_PROFILE_BALANCED,
c63d44ae602419 Luke D. Jones     2021-08-19  2244  		asus->platform_profile_handler.choices);
c63d44ae602419 Luke D. Jones     2021-08-19  2245  	set_bit(PLATFORM_PROFILE_PERFORMANCE,
c63d44ae602419 Luke D. Jones     2021-08-19  2246  		asus->platform_profile_handler.choices);
c63d44ae602419 Luke D. Jones     2021-08-19  2247  
c63d44ae602419 Luke D. Jones     2021-08-19  2248  	err = platform_profile_register(&asus->platform_profile_handler);
c63d44ae602419 Luke D. Jones     2021-08-19  2249  	if (err)
c63d44ae602419 Luke D. Jones     2021-08-19  2250  		return err;
c63d44ae602419 Luke D. Jones     2021-08-19  2251  
c63d44ae602419 Luke D. Jones     2021-08-19  2252  	asus->platform_profile_support = true;
c63d44ae602419 Luke D. Jones     2021-08-19  2253  	return 0;
c63d44ae602419 Luke D. Jones     2021-08-19  2254  }
c63d44ae602419 Luke D. Jones     2021-08-19  2255  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux