public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: popcornmix <popcornmix@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Phil Elwell <phil@raspberrypi.org>,
	Christian Lamparter <chunkeey@gmail.com>,
	Christopher Blake <chrisrblake93@gmail.com>
Subject: [l1k:smsc95xx_5.17 74/888] arch/arm/lib/uaccess_with_memcpy.c:211:30: warning: variable 'temp' set but not used
Date: Sun, 10 Apr 2022 05:27:01 +0800	[thread overview]
Message-ID: <202204100511.otOdzGCX-lkp@intel.com> (raw)

tree:   https://github.com/l1k/linux smsc95xx_5.17
head:   240f56c27361c195cd502d95aba51c6b8e5b808c
commit: 375b90433562ce3545ccda0376716268ff974114 [74/888] Improve __copy_to_user and __copy_from_user performance
config: arm-randconfig-c003-20220408 (https://download.01.org/0day-ci/archive/20220410/202204100511.otOdzGCX-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
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/l1k/linux/commit/375b90433562ce3545ccda0376716268ff974114
        git remote add l1k https://github.com/l1k/linux
        git fetch --no-tags l1k smsc95xx_5.17
        git checkout 375b90433562ce3545ccda0376716268ff974114
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   arm-linux-gnueabi-ld: arch/arm/mm/proc-xscale.o: in function `xscale_dma_unmap_area':
>> (.text+0x25c): undefined reference to `xscale_80200_A0_A1_dma_inv_range'
   arm-linux-gnueabi-ld: (.text+0x260): undefined reference to `xscale_80200_A0_A1_dma_clean_range'
   arm-linux-gnueabi-ld: arch/arm/mm/proc-syms.o:(___ksymtab+xscale_dma_clean_range+0x0): undefined reference to `xscale_dma_clean_range'
   arm-linux-gnueabi-ld: arch/arm/mm/proc-syms.o:(___ksymtab+xscale_dma_inv_range+0x0): undefined reference to `xscale_dma_inv_range'
--
   arch/arm/lib/uaccess_with_memcpy.c:137:1: warning: no previous prototype for '__copy_to_user_memcpy' [-Wmissing-prototypes]
     137 | __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
         | ^~~~~~~~~~~~~~~~~~~~~
   arch/arm/lib/uaccess_with_memcpy.c:190:1: warning: no previous prototype for '__copy_from_user_memcpy' [-Wmissing-prototypes]
     190 | __copy_from_user_memcpy(void *to, const void __user *from, unsigned long n)
         | ^~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/lib/uaccess_with_memcpy.c: In function '__copy_from_user_memcpy':
>> arch/arm/lib/uaccess_with_memcpy.c:211:30: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
     211 |                         char temp;
         |                              ^~~~


vim +/temp +211 arch/arm/lib/uaccess_with_memcpy.c

   188	
   189	unsigned long noinline
   190	__copy_from_user_memcpy(void *to, const void __user *from, unsigned long n)
   191	{
   192		unsigned long ua_flags;
   193		int atomic;
   194	
   195		if (unlikely(uaccess_kernel())) {
   196			memcpy(to, (const void *)from, n);
   197			return 0;
   198		}
   199	
   200		/* the mmap semaphore is taken only if not in an atomic context */
   201		atomic = in_atomic();
   202	
   203		if (!atomic)
   204			mmap_read_lock(current->mm);
   205		while (n) {
   206			pte_t *pte;
   207			spinlock_t *ptl;
   208			int tocopy;
   209	
   210			while (!pin_page_for_read(from, &pte, &ptl)) {
 > 211				char temp;
   212				if (!atomic)
   213					mmap_read_unlock(current->mm);
   214				if (__get_user(temp, (char __user *)from))
   215					goto out;
   216				if (!atomic)
   217					mmap_read_lock(current->mm);
   218			}
   219	
   220			tocopy = (~(unsigned long)from & ~PAGE_MASK) + 1;
   221			if (tocopy > n)
   222				tocopy = n;
   223	
   224			ua_flags = uaccess_save_and_enable();
   225			memcpy(to, (const void *)from, tocopy);
   226			uaccess_restore(ua_flags);
   227			to += tocopy;
   228			from += tocopy;
   229			n -= tocopy;
   230	
   231			pte_unmap_unlock(pte, ptl);
   232		}
   233		if (!atomic)
   234			mmap_read_unlock(current->mm);
   235	
   236	out:
   237		return n;
   238	}
   239	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-09 21:28 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=202204100511.otOdzGCX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chrisrblake93@gmail.com \
    --cc=chunkeey@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil@raspberrypi.org \
    --cc=popcornmix@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox