platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [platform-drivers-x86:review-andy 43/55] drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for 'dytc_profile_get'
@ 2021-02-03 20:01 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-03 20:01 UTC (permalink / raw)
  To: Mark Pearson
  Cc: kbuild-all, platform-driver-x86, Darren Hart, Andy Shevchenko,
	Hans de Goede

[-- Attachment #1: Type: text/plain, Size: 4581 bytes --]

tree:   git://git.infradead.org/linux-platform-drivers-x86.git review-andy
head:   60accc011af0ff869875b1ded81cbd0948267f05
commit: c3bfcd4c676238e198d5a798b50e5d424bf05497 [43/55] platform/x86: thinkpad_acpi: Add platform profile support
config: i386-randconfig-r021-20210203 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        git remote add platform-drivers-x86 git://git.infradead.org/linux-platform-drivers-x86.git
        git fetch --no-tags platform-drivers-x86 review-andy
        git checkout c3bfcd4c676238e198d5a798b50e5d424bf05497
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for 'dytc_profile_get' [-Wmissing-prototypes]
   10081 | int dytc_profile_get(struct platform_profile_handler *pprof,
         |     ^~~~~~~~~~~~~~~~
>> drivers/platform/x86/thinkpad_acpi.c:10095:5: warning: no previous prototype for 'dytc_cql_command' [-Wmissing-prototypes]
   10095 | int dytc_cql_command(int command, int *output)
         |     ^~~~~~~~~~~~~~~~
>> drivers/platform/x86/thinkpad_acpi.c:10133:5: warning: no previous prototype for 'dytc_profile_set' [-Wmissing-prototypes]
   10133 | int dytc_profile_set(struct platform_profile_handler *pprof,
         |     ^~~~~~~~~~~~~~~~


vim +/dytc_profile_get +10081 drivers/platform/x86/thinkpad_acpi.c

 10076	
 10077	/*
 10078	 * dytc_profile_get: Function to register with platform_profile
 10079	 * handler. Returns current platform profile.
 10080	 */
 10081	int dytc_profile_get(struct platform_profile_handler *pprof,
 10082				enum platform_profile_option *profile)
 10083	{
 10084		*profile = dytc_current_profile;
 10085		return 0;
 10086	}
 10087	
 10088	/*
 10089	 * Helper function - check if we are in CQL mode and if we are
 10090	 *  -  disable CQL,
 10091	 *  - run the command
 10092	 *  - enable CQL
 10093	 *  If not in CQL mode, just run the command
 10094	 */
 10095	int dytc_cql_command(int command, int *output)
 10096	{
 10097		int err, cmd_err, dummy;
 10098		int cur_funcmode;
 10099	
 10100		/* Determine if we are in CQL mode. This alters the commands we do */
 10101		err = dytc_command(DYTC_CMD_GET, output);
 10102		if (err)
 10103			return err;
 10104	
 10105		cur_funcmode = (*output >> DYTC_GET_FUNCTION_BIT) & 0xF;
 10106		/* Check if we're OK to return immediately */
 10107		if ((command == DYTC_CMD_GET) && (cur_funcmode != DYTC_FUNCTION_CQL))
 10108			return 0;
 10109	
 10110		if (cur_funcmode == DYTC_FUNCTION_CQL) {
 10111			atomic_inc(&dytc_ignore_event);
 10112			err = dytc_command(DYTC_DISABLE_CQL, &dummy);
 10113			if (err)
 10114				return err;
 10115		}
 10116	
 10117		cmd_err = dytc_command(command,	output);
 10118		/* Check return condition after we've restored CQL state */
 10119	
 10120		if (cur_funcmode == DYTC_FUNCTION_CQL) {
 10121			err = dytc_command(DYTC_ENABLE_CQL, &dummy);
 10122			if (err)
 10123				return err;
 10124		}
 10125	
 10126		return cmd_err;
 10127	}
 10128	
 10129	/*
 10130	 * dytc_profile_set: Function to register with platform_profile
 10131	 * handler. Sets current platform profile.
 10132	 */
 10133	int dytc_profile_set(struct platform_profile_handler *pprof,
 10134				enum platform_profile_option profile)
 10135	{
 10136		int output;
 10137		int err;
 10138	
 10139		if (!dytc_profile_available)
 10140			return -ENODEV;
 10141	
 10142		err = mutex_lock_interruptible(&dytc_mutex);
 10143		if (err)
 10144			return err;
 10145	
 10146		if (profile == PLATFORM_PROFILE_BALANCED) {
 10147			/* To get back to balanced mode we just issue a reset command */
 10148			err = dytc_command(DYTC_CMD_RESET, &output);
 10149			if (err)
 10150				goto unlock;
 10151		} else {
 10152			int perfmode;
 10153	
 10154			err = convert_profile_to_dytc(profile, &perfmode);
 10155			if (err)
 10156				goto unlock;
 10157	
 10158			/* Determine if we are in CQL mode. This alters the commands we do */
 10159			err = dytc_cql_command(DYTC_SET_COMMAND(DYTC_FUNCTION_MMC, perfmode, 1), &output);
 10160			if (err)
 10161				goto unlock;
 10162		}
 10163		/* Success - update current profile */
 10164		dytc_current_profile = profile;
 10165	unlock:
 10166		mutex_unlock(&dytc_mutex);
 10167		return err;
 10168	}
 10169	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45760 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-03 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 20:01 [platform-drivers-x86:review-andy 43/55] drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for 'dytc_profile_get' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).