All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:4.19/android 16527/21826] drivers/cpufreq/cpufreq_times.c:354:5: warning: no previous prototype for function 'cpufreq_table_get_closed_index'
@ 2021-09-06  6:23 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-09-06  6:23 UTC (permalink / raw)
  To: kbuild-all

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

Hi Junxiao,

FYI, the error/warning still remains.

tree:   https://github.com/intel/linux-intel-lts.git 4.19/android
head:   f452756fecf51b010bff31c58c0f5789633ad852
commit: 045c4cc9854e44be23f27501c397c8d1783a0708 [16527/21826] cpufreq statistics: support cpufreq driver without freq table
config: x86_64-randconfig-a013-20210906 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6fe2beba7d2a41964af658c8c59dd172683ef739)
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/intel/linux-intel-lts/commit/045c4cc9854e44be23f27501c397c8d1783a0708
        git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
        git fetch --no-tags intel-linux-intel-lts 4.19/android
        git checkout 045c4cc9854e44be23f27501c397c8d1783a0708
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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/cpufreq/cpufreq_times.c:354:5: warning: no previous prototype for function 'cpufreq_table_get_closed_index' [-Wmissing-prototypes]
   int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
       ^
   drivers/cpufreq/cpufreq_times.c:354:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
   ^
   static 
>> drivers/cpufreq/cpufreq_times.c:367:6: warning: no previous prototype for function 'cpufreq_times_create_policy_no_freq_table' [-Wmissing-prototypes]
   void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
        ^
   drivers/cpufreq/cpufreq_times.c:367:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
   ^
   static 
   2 warnings generated.


vim +/cpufreq_table_get_closed_index +354 drivers/cpufreq/cpufreq_times.c

   350	
   351	#define CPU_FREQ_STEPS 100000
   352	// Suppose all cores have same freq count
   353	static int all_freq_count;
 > 354	int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
   355	{
   356		int i;
   357		unsigned int rounded_freq;
   358	
   359		rounded_freq = freq + CPU_FREQ_STEPS / 2;
   360		for (i = 0; i < all_freq_count; i++) {
   361			if ((rounded_freq - all_freqs[cpu]->freq_table[i]) / CPU_FREQ_STEPS == 0)
   362				return i;
   363		}
   364		return -1;
   365	}
   366	
 > 367	void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
   368	{
   369		int cpu, index, i;
   370		unsigned int count = 0;
   371		struct cpu_freqs *freqs;
   372		void *tmp;
   373	
   374		if (all_freqs[policy->cpu])
   375			return;
   376	
   377		count = (policy->max - policy->min) / CPU_FREQ_STEPS + 1;
   378		if ((policy->max - policy->min) % CPU_FREQ_STEPS)
   379			count++;
   380	
   381		if (count > 100)
   382			return;
   383	
   384		tmp =  kzalloc(sizeof(*freqs) + sizeof(freqs->freq_table[0]) * count,
   385			       GFP_KERNEL);
   386		if (!tmp)
   387			return;
   388	
   389		freqs = tmp;
   390		freqs->max_state = count;
   391		all_freq_count = count;
   392	
   393		freqs->freq_table[0] = policy->min;
   394		freqs->freq_table[count - 1] = policy->max;
   395		for (i = 1; i < count - 1; i++)
   396			freqs->freq_table[i] = policy->min + i * CPU_FREQ_STEPS;
   397		freqs->offset = next_offset;
   398		WRITE_ONCE(next_offset, freqs->offset + count);
   399		for_each_cpu(cpu, policy->related_cpus)
   400			all_freqs[cpu] = freqs;
   401	
   402		index = cpufreq_table_get_closed_index(policy->cpu, policy->cur);
   403		if (index >= 0)
   404			WRITE_ONCE(freqs->last_index, index);
   405	}
   406	

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

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

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

only message in thread, other threads:[~2021-09-06  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  6:23 [intel-linux-intel-lts:4.19/android 16527/21826] drivers/cpufreq/cpufreq_times.c:354:5: warning: no previous prototype for function 'cpufreq_table_get_closed_index' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.