[riscv:for-next 17/18] arch/riscv/kernel/unaligned_access_speed.c:291:13: warning: 'check_unaligned_access_speed' defined but not used

kernel test robot <[email protected]> Thu, 30 Jul 2026 17:07:29 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head:   03ececaea90889587dac37c802f02a1ea8b61d51
commit: d91f147112ba46e443aac2d45777824362365dcb [17/18] riscv: unaligned: stop using kthread for check_vector_unaligned_access()
config: riscv-randconfig-002-20260730 (https://download.01.org/0day-ci/archive/20260730/[email protected]/config)
compiler: riscv64-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260730/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   arch/riscv/kernel/unaligned_access_speed.c: In function 'check_unaligned_access_all_cpus':
   arch/riscv/kernel/unaligned_access_speed.c:380:24: error: 'check_vector_unaligned_access' undeclared (first use in this function); did you mean 'check_unaligned_access'?
     380 |   schedule_on_each_cpu(check_vector_unaligned_access);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                        check_unaligned_access
   arch/riscv/kernel/unaligned_access_speed.c:380:24: note: each undeclared identifier is reported only once for each function it appears in
   At top level:
>> arch/riscv/kernel/unaligned_access_speed.c:291:13: warning: 'check_unaligned_access_speed' defined but not used [-Wunused-function]
     291 | static void check_unaligned_access_speed(struct work_struct *work __always_unused)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/check_unaligned_access_speed +291 arch/riscv/kernel/unaligned_access_speed.c

   289	
   290	#else /* CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS */
 > 291	static void check_unaligned_access_speed(struct work_struct *work __always_unused)
   292	{
   293	}
   294	#endif
   295	
   296	static int riscv_online_cpu_vec(unsigned int cpu)
   297	{
   298		if (unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN) {
   299			per_cpu(vector_misaligned_access, cpu) = unaligned_vector_speed_param;
   300			return 0;
   301		}
   302	
   303	#ifdef CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS
   304		if (per_cpu(vector_misaligned_access, cpu) != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN)
   305			return 0;
   306	
   307		check_vector_unaligned_access_emulated(NULL);
   308		check_vector_unaligned_access(NULL);
   309	#endif
   310	
   311		return 0;
   312	}
   313	
   314	static const char * const speed_str[] __initconst = { NULL, NULL, "slow", "fast", "unsupported" };
   315	
   316	static int __init set_unaligned_scalar_speed_param(char *str)
   317	{
   318		if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_SCALAR_SLOW]))
   319			unaligned_scalar_speed_param = RISCV_HWPROBE_MISALIGNED_SCALAR_SLOW;
   320		else if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_SCALAR_FAST]))
   321			unaligned_scalar_speed_param = RISCV_HWPROBE_MISALIGNED_SCALAR_FAST;
   322		else if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED]))
   323			unaligned_scalar_speed_param = RISCV_HWPROBE_MISALIGNED_SCALAR_UNSUPPORTED;
   324		else
   325			return -EINVAL;
   326	
   327		return 1;
   328	}
   329	__setup("unaligned_scalar_speed=", set_unaligned_scalar_speed_param);
   330	
   331	static int __init set_unaligned_vector_speed_param(char *str)
   332	{
   333		if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW]))
   334			unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW;
   335		else if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_VECTOR_FAST]))
   336			unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_FAST;
   337		else if (!strcmp(str, speed_str[RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED]))
   338			unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED;
   339		else
   340			return -EINVAL;
   341	
   342		return 1;
   343	}
   344	__setup("unaligned_vector_speed=", set_unaligned_vector_speed_param);
   345	
   346	static int __init check_unaligned_access_all_cpus(void)
   347	{
   348		int cpu;
   349	
   350		unaligned_access_init();
   351	
   352		if (unaligned_scalar_speed_param != RISCV_HWPROBE_MISALIGNED_SCALAR_UNKNOWN) {
   353			pr_info("scalar unaligned access speed set to '%s' (%lu) by command line\n",
   354				speed_str[unaligned_scalar_speed_param], unaligned_scalar_speed_param);
   355			for_each_online_cpu(cpu)
   356				per_cpu(misaligned_access_speed, cpu) = unaligned_scalar_speed_param;
   357		} else if (!check_unaligned_access_emulated_all_cpus()) {
   358			check_unaligned_access_speed_all_cpus();
   359		}
   360	
   361		if (unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN) {
   362			if (!has_vector() &&
   363			    unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED) {
   364				pr_warn("vector support is not available, ignoring unaligned_vector_speed=%s\n",
   365					speed_str[unaligned_vector_speed_param]);
   366			} else {
   367				pr_info("vector unaligned access speed set to '%s' (%lu) by command line\n",
   368					speed_str[unaligned_vector_speed_param], unaligned_vector_speed_param);
   369			}
   370		}
   371	
   372		if (!has_vector())
   373			unaligned_vector_speed_param = RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED;
   374	
   375		if (unaligned_vector_speed_param != RISCV_HWPROBE_MISALIGNED_VECTOR_UNKNOWN) {
   376			for_each_online_cpu(cpu)
   377				per_cpu(vector_misaligned_access, cpu) = unaligned_vector_speed_param;
   378		} else if (!check_vector_unaligned_access_emulated_all_cpus() &&
   379			   IS_ENABLED(CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS)) {
 > 380			schedule_on_each_cpu(check_vector_unaligned_access);
   381		}
   382	
   383		/*
   384		 * Setup hotplug callbacks for any new CPUs that come online or go
   385		 * offline.
   386		 */
   387		cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "riscv:online",
   388					  riscv_online_cpu, riscv_offline_cpu);
   389		cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "riscv:online",
   390					  riscv_online_cpu_vec, NULL);
   391	
   392		cpus_read_lock();
   393		modify_unaligned_access_branches(cpu_online_mask);
   394		cpus_read_unlock();
   395	
   396		return 0;
   397	}
   398	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki