All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Wesley Cheng <quic_wcheng@quicinc.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [usb:usb-testing 49/52] sound/usb/qcom/qc_audio_offload.c:399:14: warning: variable 'found' set but not used
Date: Sat, 15 Feb 2025 00:19:34 +0800	[thread overview]
Message-ID: <202502150035.0SvyRRJn-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-02-14 16:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202502150035.0SvyRRJn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=quic_wcheng@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.