All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [axboe-block:rw_iter 8/17] drivers/char/mem.c:209:17: error: 'buf' undeclared; did you mean 'btf'?
Date: Fri, 5 Apr 2024 02:04:01 +0800	[thread overview]
Message-ID: <202404050113.bs8MZ6oZ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git rw_iter
head:   abf039f568d1cb3559719a95366691c120449cd9
commit: a60eb2a07b5eb5064a5636204550c1df87d20751 [8/17] char: convert drivers to use ->read_iter() and ->write_iter()
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20240405/202404050113.bs8MZ6oZ-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240405/202404050113.bs8MZ6oZ-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/202404050113.bs8MZ6oZ-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/char/mem.c: In function 'write_mem':
>> drivers/char/mem.c:209:17: error: 'buf' undeclared (first use in this function); did you mean 'btf'?
     209 |                 buf += sz;
         |                 ^~~
         |                 btf
   drivers/char/mem.c:209:17: note: each undeclared identifier is reported only once for each function it appears in
--
   drivers/char/nvram.c: In function 'nvram_misc_read':
>> drivers/char/nvram.c:230:24: error: implicit declaration of function 'iov_iter_count' [-Werror=implicit-function-declaration]
     230 |         size_t count = iov_iter_count(to);
         |                        ^~~~~~~~~~~~~~
>> drivers/char/nvram.c:249:13: error: implicit declaration of function 'copy_to_iter_full' [-Werror=implicit-function-declaration]
     249 |         if (copy_to_iter_full(tmp, ret, to)) {
         |             ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +209 drivers/char/mem.c

^1da177e4c3f41 Linus Torvalds                2005-04-16  187  
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  188  static ssize_t write_mem(struct kiocb *iocb, struct iov_iter *from)
^1da177e4c3f41 Linus Torvalds                2005-04-16  189  {
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  190  	size_t count = iov_iter_count(from);
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  191  	phys_addr_t p = iocb->ki_pos;
^1da177e4c3f41 Linus Torvalds                2005-04-16  192  	ssize_t written, sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  193  	unsigned long copied;
^1da177e4c3f41 Linus Torvalds                2005-04-16  194  	void *ptr;
^1da177e4c3f41 Linus Torvalds                2005-04-16  195  
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  196  	if (p != iocb->ki_pos)
08d2d00b291ed4 Petr Tesarik                  2014-01-30  197  		return -EFBIG;
08d2d00b291ed4 Petr Tesarik                  2014-01-30  198  
136939a2b5aa43 Bjorn Helgaas                 2006-03-26  199  	if (!valid_phys_addr_range(p, count))
^1da177e4c3f41 Linus Torvalds                2005-04-16  200  		return -EFAULT;
^1da177e4c3f41 Linus Torvalds                2005-04-16  201  
^1da177e4c3f41 Linus Torvalds                2005-04-16  202  	written = 0;
^1da177e4c3f41 Linus Torvalds                2005-04-16  203  
^1da177e4c3f41 Linus Torvalds                2005-04-16  204  #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
^1da177e4c3f41 Linus Torvalds                2005-04-16  205  	/* we don't have page 0 mapped on sparc and m68k.. */
^1da177e4c3f41 Linus Torvalds                2005-04-16  206  	if (p < PAGE_SIZE) {
7fabaddd09ab32 Wu Fengguang                  2009-12-14  207  		sz = size_inside_page(p, count);
^1da177e4c3f41 Linus Torvalds                2005-04-16  208  		/* Hmm. Do something? */
^1da177e4c3f41 Linus Torvalds                2005-04-16 @209  		buf += sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  210  		p += sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  211  		count -= sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  212  		written += sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  213  	}
^1da177e4c3f41 Linus Torvalds                2005-04-16  214  #endif
^1da177e4c3f41 Linus Torvalds                2005-04-16  215  
^1da177e4c3f41 Linus Torvalds                2005-04-16  216  	while (count > 0) {
a4866aa812518e Kees Cook                     2017-04-05  217  		int allowed;
a4866aa812518e Kees Cook                     2017-04-05  218  
f222318e9c3a31 Wu Fengguang                  2009-12-14  219  		sz = size_inside_page(p, count);
^1da177e4c3f41 Linus Torvalds                2005-04-16  220  
a4866aa812518e Kees Cook                     2017-04-05  221  		allowed = page_is_allowed(p >> PAGE_SHIFT);
a4866aa812518e Kees Cook                     2017-04-05  222  		if (!allowed)
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  223  			return -EPERM;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  224  
a4866aa812518e Kees Cook                     2017-04-05  225  		/* Skip actual writing when a page is marked as restricted. */
a4866aa812518e Kees Cook                     2017-04-05  226  		if (allowed == 1) {
^1da177e4c3f41 Linus Torvalds                2005-04-16  227  			/*
a4866aa812518e Kees Cook                     2017-04-05  228  			 * On ia64 if a page has been mapped somewhere as
a4866aa812518e Kees Cook                     2017-04-05  229  			 * uncached, then it must also be accessed uncached
a4866aa812518e Kees Cook                     2017-04-05  230  			 * by the kernel or data corruption may occur.
^1da177e4c3f41 Linus Torvalds                2005-04-16  231  			 */
^1da177e4c3f41 Linus Torvalds                2005-04-16  232  			ptr = xlate_dev_mem_ptr(p);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  233  			if (!ptr) {
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  234  				if (written)
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  235  					break;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  236  				return -EFAULT;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  237  			}
^1da177e4c3f41 Linus Torvalds                2005-04-16  238  
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  239  			copied = copy_from_iter(ptr, sz, from);
fa29e97bb8c70f Wu Fengguang                  2009-12-14  240  			unxlate_dev_mem_ptr(p, ptr);
^1da177e4c3f41 Linus Torvalds                2005-04-16  241  			if (copied) {
c654d60e8f0ea1 Jan Beulich                   2006-03-25  242  				written += sz - copied;
c654d60e8f0ea1 Jan Beulich                   2006-03-25  243  				if (written)
c654d60e8f0ea1 Jan Beulich                   2006-03-25  244  					break;
^1da177e4c3f41 Linus Torvalds                2005-04-16  245  				return -EFAULT;
^1da177e4c3f41 Linus Torvalds                2005-04-16  246  			}
a4866aa812518e Kees Cook                     2017-04-05  247  		}
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18  248  
^1da177e4c3f41 Linus Torvalds                2005-04-16  249  		p += sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  250  		count -= sz;
^1da177e4c3f41 Linus Torvalds                2005-04-16  251  		written += sz;
8619e5bdeee8b2 Tetsuo Handa                  2019-08-26  252  		if (should_stop_iteration())
8619e5bdeee8b2 Tetsuo Handa                  2019-08-26  253  			break;
^1da177e4c3f41 Linus Torvalds                2005-04-16  254  	}
^1da177e4c3f41 Linus Torvalds                2005-04-16  255  
a60eb2a07b5eb5 Jens Axboe                    2024-04-03  256  	iocb->ki_pos += written;
^1da177e4c3f41 Linus Torvalds                2005-04-16  257  	return written;
^1da177e4c3f41 Linus Torvalds                2005-04-16  258  }
^1da177e4c3f41 Linus Torvalds                2005-04-16  259  

:::::: The code at line 209 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

                 reply	other threads:[~2024-04-04 18:05 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=202404050113.bs8MZ6oZ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.