All of lore.kernel.org
 help / color / mirror / Atom feed
* [asahilinux:bits/070-audio 69/104] sound/soc/apple/macaudio.c:198:6: sparse: sparse: symbol 'macaudio_vlimit_unlock' was not declared. Should it be static?
@ 2023-12-07  0:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-07  0:59 UTC (permalink / raw)
  To: Hector Martin; +Cc: oe-kbuild-all

tree:   https://github.com/AsahiLinux/linux bits/070-audio
head:   88e53b5c13659b0092bc49020fbc8ebbfc1abfa6
commit: 4a448b9f1c264f3e73a32e569b519d3b0054ad30 [69/104] macaudio: speaker volume safety interlocks
config: openrisc-randconfig-r132-20231207 (https://download.01.org/0day-ci/archive/20231207/202312070802.02VteWB1-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231207/202312070802.02VteWB1-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312070802.02VteWB1-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> sound/soc/apple/macaudio.c:198:6: sparse: sparse: symbol 'macaudio_vlimit_unlock' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:220:6: sparse: sparse: symbol 'macaudio_vlimit_update' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1111:30: sparse: sparse: symbol 'macaudio_j274_cfg' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1147:30: sparse: sparse: symbol 'macaudio_j313_cfg' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1192:30: sparse: sparse: symbol 'macaudio_j314_cfg' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1200:30: sparse: sparse: symbol 'macaudio_j413_cfg' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1210:30: sparse: sparse: symbol 'macaudio_j415_cfg' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1237:30: sparse: sparse: symbol 'macaudio_j375_cfg' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1259:30: sparse: sparse: symbol 'macaudio_j493_cfg' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1275:30: sparse: sparse: symbol 'macaudio_fallback_cfg' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1286:1: sparse: sparse: symbol 'macaudio_spk_mux_enum' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1296:1: sparse: sparse: symbol 'macaudio_hp_mux_enum' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1317:5: sparse: sparse: symbol 'macaudio_sss_info' was not declared. Should it be static?
   sound/soc/apple/macaudio.c:1327:5: sparse: sparse: symbol 'macaudio_sss_get' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1342:5: sparse: sparse: symbol 'macaudio_slk_info' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1352:5: sparse: sparse: symbol 'macaudio_slk_put' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1384:5: sparse: sparse: symbol 'macaudio_slk_lock' was not declared. Should it be static?
>> sound/soc/apple/macaudio.c:1403:6: sparse: sparse: symbol 'macaudio_slk_unlock' was not declared. Should it be static?

vim +/macaudio_vlimit_unlock +198 sound/soc/apple/macaudio.c

   197	
 > 198	void macaudio_vlimit_unlock(struct macaudio_snd_data *ma, bool unlock)
   199	{
   200		int i, ret, max;
   201	
   202		for (i = 0; i < ARRAY_SIZE(ma->cfg->limits); i++) {
   203			const struct macaudio_limit_cfg *limit = &ma->cfg->limits[i];
   204	
   205			if (!limit->match)
   206				break;
   207	
   208			if (unlock)
   209				max = limit->max_unlimited;
   210			else
   211				max = limit->max_limited;
   212	
   213			ret = snd_soc_limit_volume(&ma->card, limit->match, max);
   214			if (ret < 0)
   215				dev_err(ma->card.dev, "Failed to %slock volume %s: %d\n",
   216					unlock ? "un" : "", limit->match, ret);
   217		}
   218	}
   219	
 > 220	void macaudio_vlimit_update(struct macaudio_snd_data *ma)
   221	{
   222		int i;
   223		bool unlock = true;
   224		struct snd_kcontrol *kctl;
   225		const char *reason;
   226	
   227		/* Do nothing if there are no limits configured */
   228		if (!ma->cfg->limits[0].match)
   229			return;
   230	
   231		/* Check that someone is holding the main lock */
   232		if (!ma->speaker_lock_owner) {
   233			reason = "Main control not locked";
   234			unlock = false;
   235		}
   236	
   237		/* Check that the control has been pinged within the timeout */
   238		if (ma->speaker_lock_remain <= 0) {
   239			reason = "Lock timeout";
   240			unlock = false;
   241		}
   242	
   243		/* Check that *every* limited control is locked by the same owner */
   244		list_for_each_entry(kctl, &ma->card.snd_card->controls, list) {
   245			bool is_limit = false;
   246	
   247			for (i = 0; i < ARRAY_SIZE(ma->cfg->limits); i++) {
   248				const struct macaudio_limit_cfg *limit = &ma->cfg->limits[i];
   249				if (!limit->match)
   250					break;
   251	
   252				is_limit = snd_soc_control_matches(kctl, limit->match);
   253				if (is_limit)
   254					break;
   255			}
   256	
   257			if (!is_limit)
   258				continue;
   259	
   260			for (i = 0; i < kctl->count; i++) {
   261				if (kctl->vd[i].owner != ma->speaker_lock_owner) {
   262					reason = "Not all child controls locked by the same process";
   263					unlock = false;
   264				}
   265			}
   266		}
   267	
   268	
   269		if (unlock != ma->speaker_volume_unlocked) {
   270			if (unlock) {
   271				dev_info(ma->card.dev, "Speaker volumes unlocked\n");
   272			} else  {
   273				dev_info(ma->card.dev, "Speaker volumes locked: %s\n", reason);
   274				ma->speaker_volume_was_locked = true;
   275			}
   276	
   277			macaudio_vlimit_unlock(ma, unlock);
   278			ma->speaker_volume_unlocked = unlock;
   279		}
   280	}
   281	

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

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

only message in thread, other threads:[~2023-12-07  1:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07  0:59 [asahilinux:bits/070-audio 69/104] sound/soc/apple/macaudio.c:198:6: sparse: sparse: symbol 'macaudio_vlimit_unlock' was not declared. Should it be static? 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.