All of lore.kernel.org
 help / color / mirror / Atom feed
* [usb:usb-testing 49/52] sound/usb/qcom/qc_audio_offload.c:399:14: warning: variable 'found' set but not used
@ 2025-02-14 16:19 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-14 16:19 UTC (permalink / raw)
  To: Wesley Cheng; +Cc: oe-kbuild-all, linux-usb, Greg Kroah-Hartman

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   c26f6731b8da887f1fb92d4654da57a19a266466
commit: 2974d256f0b76fda676b8c7f7ddee2752bbcac7b [49/52] ALSA: usb-audio: qcom: Introduce QC USB SND offloading support
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250215/202502150035.0SvyRRJn-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250215/202502150035.0SvyRRJn-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/202502150035.0SvyRRJn-lkp@intel.com/

All warnings (new ones prefixed by >>):

   sound/usb/qcom/qc_audio_offload.c: In function 'uaudio_get_iova':
>> sound/usb/qcom/qc_audio_offload.c:399:14: warning: variable 'found' set but not used [-Wunused-but-set-variable]
     399 |         bool found = false;
         |              ^~~~~
   sound/usb/qcom/qc_audio_offload.c: In function 'prepare_qmi_response':
>> sound/usb/qcom/qc_audio_offload.c:1353:13: warning: variable 'xfer_buf_len' set but not used [-Wunused-but-set-variable]
    1353 |         u32 xfer_buf_len;
         |             ^~~~~~~~~~~~


vim +/found +399 sound/usb/qcom/qc_audio_offload.c

   389	
   390	/* Offloading IOMMU management */
   391	static unsigned long uaudio_get_iova(unsigned long *curr_iova,
   392					     size_t *curr_iova_size,
   393					     struct list_head *head, size_t size)
   394	{
   395		struct iova_info *info, *new_info = NULL;
   396		struct list_head *curr_head;
   397		size_t tmp_size = size;
   398		unsigned long va = 0;
 > 399		bool found = false;
   400	
   401		if (size % PAGE_SIZE)
   402			goto done;
   403	
   404		if (size > *curr_iova_size)
   405			goto done;
   406	
   407		if (*curr_iova_size == 0)
   408			goto done;
   409	
   410		list_for_each_entry(info, head, list) {
   411			/* exact size iova_info */
   412			if (!info->in_use && info->size == size) {
   413				info->in_use = true;
   414				va = info->start_iova;
   415				*curr_iova_size -= size;
   416				found = true;
   417				goto done;
   418			} else if (!info->in_use && tmp_size >= info->size) {
   419				if (!new_info)
   420					new_info = info;
   421				tmp_size -= info->size;
   422				if (tmp_size)
   423					continue;
   424	
   425				va = new_info->start_iova;
   426				for (curr_head = &new_info->list; curr_head !=
   427				&info->list; curr_head = curr_head->next) {
   428					new_info = list_entry(curr_head, struct
   429							iova_info, list);
   430					new_info->in_use = true;
   431				}
   432				info->in_use = true;
   433				*curr_iova_size -= size;
   434				found = true;
   435				goto done;
   436			} else {
   437				/* iova region in use */
   438				new_info = NULL;
   439				tmp_size = size;
   440			}
   441		}
   442	
   443		info = kzalloc(sizeof(*info), GFP_KERNEL);
   444		if (!info) {
   445			va = 0;
   446			goto done;
   447		}
   448	
   449		va = *curr_iova;
   450		info->start_iova = *curr_iova;
   451		info->size = size;
   452		info->in_use = true;
   453		*curr_iova += size;
   454		*curr_iova_size -= size;
   455		found = true;
   456		list_add_tail(&info->list, head);
   457	
   458	done:
   459		return va;
   460	}
   461	

-- 
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:[~2025-02-14 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 16:19 [usb:usb-testing 49/52] sound/usb/qcom/qc_audio_offload.c:399:14: warning: variable 'found' set but not used 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.