From: kernel test robot <lkp@intel.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>, Arnd Bergmann <arnd@arndb.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Rich Felker <dalias@libc.org>,
linux-sh@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
sparclinux@vger.kernel.org, linux-arch@vger.kernel.org,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-hexagon@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>,
Richard Henderson <richard.henderson@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
linux-m68k@lists.linux-m68k.org,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
linux-arm-kernel@lists.infradead.org,
Brian Cain <bcain@quicinc.com>,
linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org,
linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
Date: Sun, 19 Nov 2023 11:13:56 +0800 [thread overview]
Message-ID: <202311191145.pppExJS6-lkp@intel.com> (raw)
In-Reply-To: <20231118100827.1599422-1-wangkefeng.wang@huawei.com>
Hi Kefeng,
kernel test robot noticed the following build errors:
[auto build test ERROR on soc/for-next]
[also build test ERROR on geert-m68k/for-next geert-m68k/for-linus deller-parisc/for-next powerpc/next powerpc/fixes linus/master v6.7-rc1 next-20231117]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/asm-io-remove-unnecessary-xlate_dev_mem_ptr-and-unxlate_dev_mem_ptr/20231118-183038
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link: https://lore.kernel.org/r/20231118100827.1599422-1-wangkefeng.wang%40huawei.com
patch subject: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-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/202311191145.pppExJS6-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/char/mem.c:159:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
>> drivers/char/mem.c:159:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
>> drivers/char/mem.c:164:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
drivers/char/mem.c:235:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
drivers/char/mem.c:235:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
drivers/char/mem.c:243:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
6 errors generated.
vim +/xlate_dev_mem_ptr +159 drivers/char/mem.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 133
22ec1a2aea73b9 Kees Cook 2017-12-01 134 bounce = kmalloc(PAGE_SIZE, GFP_KERNEL);
22ec1a2aea73b9 Kees Cook 2017-12-01 135 if (!bounce)
22ec1a2aea73b9 Kees Cook 2017-12-01 136 return -ENOMEM;
22ec1a2aea73b9 Kees Cook 2017-12-01 137
^1da177e4c3f41 Linus Torvalds 2005-04-16 138 while (count > 0) {
fa29e97bb8c70f Wu Fengguang 2009-12-14 139 unsigned long remaining;
b5b38200ebe548 Kees Cook 2018-03-27 140 int allowed, probe;
fa29e97bb8c70f Wu Fengguang 2009-12-14 141
f222318e9c3a31 Wu Fengguang 2009-12-14 142 sz = size_inside_page(p, count);
^1da177e4c3f41 Linus Torvalds 2005-04-16 143
22ec1a2aea73b9 Kees Cook 2017-12-01 144 err = -EPERM;
a4866aa812518e Kees Cook 2017-04-05 145 allowed = page_is_allowed(p >> PAGE_SHIFT);
a4866aa812518e Kees Cook 2017-04-05 146 if (!allowed)
22ec1a2aea73b9 Kees Cook 2017-12-01 147 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 148
22ec1a2aea73b9 Kees Cook 2017-12-01 149 err = -EFAULT;
a4866aa812518e Kees Cook 2017-04-05 150 if (allowed == 2) {
a4866aa812518e Kees Cook 2017-04-05 151 /* Show zeros for restricted memory. */
a4866aa812518e Kees Cook 2017-04-05 152 remaining = clear_user(buf, sz);
a4866aa812518e Kees Cook 2017-04-05 153 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 154 /*
a4866aa812518e Kees Cook 2017-04-05 155 * On ia64 if a page has been mapped somewhere as
a4866aa812518e Kees Cook 2017-04-05 156 * uncached, then it must also be accessed uncached
a4866aa812518e Kees Cook 2017-04-05 157 * by the kernel or data corruption may occur.
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @159 ptr = xlate_dev_mem_ptr(p);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 160 if (!ptr)
22ec1a2aea73b9 Kees Cook 2017-12-01 161 goto failed;
a4866aa812518e Kees Cook 2017-04-05 162
fe557319aa06c2 Christoph Hellwig 2020-06-17 163 probe = copy_from_kernel_nofault(bounce, ptr, sz);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 @164 unxlate_dev_mem_ptr(p, ptr);
b5b38200ebe548 Kees Cook 2018-03-27 165 if (probe)
22ec1a2aea73b9 Kees Cook 2017-12-01 166 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 167
22ec1a2aea73b9 Kees Cook 2017-12-01 168 remaining = copy_to_user(buf, bounce, sz);
a4866aa812518e Kees Cook 2017-04-05 169 }
a4866aa812518e Kees Cook 2017-04-05 170
fa29e97bb8c70f Wu Fengguang 2009-12-14 171 if (remaining)
22ec1a2aea73b9 Kees Cook 2017-12-01 172 goto failed;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 173
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 buf += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 175 p += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 176 count -= sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 read += sz;
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 178 if (should_stop_iteration())
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 179 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 }
22ec1a2aea73b9 Kees Cook 2017-12-01 181 kfree(bounce);
^1da177e4c3f41 Linus Torvalds 2005-04-16 182
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 *ppos += read;
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 return read;
22ec1a2aea73b9 Kees Cook 2017-12-01 185
22ec1a2aea73b9 Kees Cook 2017-12-01 186 failed:
22ec1a2aea73b9 Kees Cook 2017-12-01 187 kfree(bounce);
22ec1a2aea73b9 Kees Cook 2017-12-01 188 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 190
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>, Arnd Bergmann <arnd@arndb.de>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>,
Rich Felker <dalias@libc.org>,
linux-sh@vger.kernel.org, llvm@lists.linux.dev,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
sparclinux@vger.kernel.org, linux-arch@vger.kernel.org,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-hexagon@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>,
Richard Henderson <richard.henderson@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
linux-m68k@lists.linux-m68k.org,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
oe-kbuild-all@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
Brian Cain <bcain@quicinc.com>,
linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org,
linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
Date: Sun, 19 Nov 2023 11:13:56 +0800 [thread overview]
Message-ID: <202311191145.pppExJS6-lkp@intel.com> (raw)
In-Reply-To: <20231118100827.1599422-1-wangkefeng.wang@huawei.com>
Hi Kefeng,
kernel test robot noticed the following build errors:
[auto build test ERROR on soc/for-next]
[also build test ERROR on geert-m68k/for-next geert-m68k/for-linus deller-parisc/for-next powerpc/next powerpc/fixes linus/master v6.7-rc1 next-20231117]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/asm-io-remove-unnecessary-xlate_dev_mem_ptr-and-unxlate_dev_mem_ptr/20231118-183038
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link: https://lore.kernel.org/r/20231118100827.1599422-1-wangkefeng.wang%40huawei.com
patch subject: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-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/202311191145.pppExJS6-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/char/mem.c:159:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
>> drivers/char/mem.c:159:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
>> drivers/char/mem.c:164:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
drivers/char/mem.c:235:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
drivers/char/mem.c:235:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
drivers/char/mem.c:243:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
6 errors generated.
vim +/xlate_dev_mem_ptr +159 drivers/char/mem.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 133
22ec1a2aea73b9 Kees Cook 2017-12-01 134 bounce = kmalloc(PAGE_SIZE, GFP_KERNEL);
22ec1a2aea73b9 Kees Cook 2017-12-01 135 if (!bounce)
22ec1a2aea73b9 Kees Cook 2017-12-01 136 return -ENOMEM;
22ec1a2aea73b9 Kees Cook 2017-12-01 137
^1da177e4c3f41 Linus Torvalds 2005-04-16 138 while (count > 0) {
fa29e97bb8c70f Wu Fengguang 2009-12-14 139 unsigned long remaining;
b5b38200ebe548 Kees Cook 2018-03-27 140 int allowed, probe;
fa29e97bb8c70f Wu Fengguang 2009-12-14 141
f222318e9c3a31 Wu Fengguang 2009-12-14 142 sz = size_inside_page(p, count);
^1da177e4c3f41 Linus Torvalds 2005-04-16 143
22ec1a2aea73b9 Kees Cook 2017-12-01 144 err = -EPERM;
a4866aa812518e Kees Cook 2017-04-05 145 allowed = page_is_allowed(p >> PAGE_SHIFT);
a4866aa812518e Kees Cook 2017-04-05 146 if (!allowed)
22ec1a2aea73b9 Kees Cook 2017-12-01 147 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 148
22ec1a2aea73b9 Kees Cook 2017-12-01 149 err = -EFAULT;
a4866aa812518e Kees Cook 2017-04-05 150 if (allowed == 2) {
a4866aa812518e Kees Cook 2017-04-05 151 /* Show zeros for restricted memory. */
a4866aa812518e Kees Cook 2017-04-05 152 remaining = clear_user(buf, sz);
a4866aa812518e Kees Cook 2017-04-05 153 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 154 /*
a4866aa812518e Kees Cook 2017-04-05 155 * On ia64 if a page has been mapped somewhere as
a4866aa812518e Kees Cook 2017-04-05 156 * uncached, then it must also be accessed uncached
a4866aa812518e Kees Cook 2017-04-05 157 * by the kernel or data corruption may occur.
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @159 ptr = xlate_dev_mem_ptr(p);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 160 if (!ptr)
22ec1a2aea73b9 Kees Cook 2017-12-01 161 goto failed;
a4866aa812518e Kees Cook 2017-04-05 162
fe557319aa06c2 Christoph Hellwig 2020-06-17 163 probe = copy_from_kernel_nofault(bounce, ptr, sz);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 @164 unxlate_dev_mem_ptr(p, ptr);
b5b38200ebe548 Kees Cook 2018-03-27 165 if (probe)
22ec1a2aea73b9 Kees Cook 2017-12-01 166 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 167
22ec1a2aea73b9 Kees Cook 2017-12-01 168 remaining = copy_to_user(buf, bounce, sz);
a4866aa812518e Kees Cook 2017-04-05 169 }
a4866aa812518e Kees Cook 2017-04-05 170
fa29e97bb8c70f Wu Fengguang 2009-12-14 171 if (remaining)
22ec1a2aea73b9 Kees Cook 2017-12-01 172 goto failed;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 173
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 buf += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 175 p += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 176 count -= sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 read += sz;
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 178 if (should_stop_iteration())
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 179 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 }
22ec1a2aea73b9 Kees Cook 2017-12-01 181 kfree(bounce);
^1da177e4c3f41 Linus Torvalds 2005-04-16 182
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 *ppos += read;
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 return read;
22ec1a2aea73b9 Kees Cook 2017-12-01 185
22ec1a2aea73b9 Kees Cook 2017-12-01 186 failed:
22ec1a2aea73b9 Kees Cook 2017-12-01 187 kfree(bounce);
22ec1a2aea73b9 Kees Cook 2017-12-01 188 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 190
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>, Arnd Bergmann <arnd@arndb.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Rich Felker <dalias@libc.org>,
linux-sh@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
sparclinux@vger.kernel.org, linux-arch@vger.kernel.org,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-hexagon@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>,
Richard Henderson <richard.henderson@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
linux-m68k@lists.linux-m68k.org,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
linux-arm-kernel@lists.infradead.org,
Brian Cain <bcain@quicinc.com>,
linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org,
linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
Date: Sun, 19 Nov 2023 11:13:56 +0800 [thread overview]
Message-ID: <202311191145.pppExJS6-lkp@intel.com> (raw)
In-Reply-To: <20231118100827.1599422-1-wangkefeng.wang@huawei.com>
Hi Kefeng,
kernel test robot noticed the following build errors:
[auto build test ERROR on soc/for-next]
[also build test ERROR on geert-m68k/for-next geert-m68k/for-linus deller-parisc/for-next powerpc/next powerpc/fixes linus/master v6.7-rc1 next-20231117]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/asm-io-remove-unnecessary-xlate_dev_mem_ptr-and-unxlate_dev_mem_ptr/20231118-183038
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link: https://lore.kernel.org/r/20231118100827.1599422-1-wangkefeng.wang%40huawei.com
patch subject: [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr()
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231119/202311191145.pppExJS6-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/202311191145.pppExJS6-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/char/mem.c:159:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
>> drivers/char/mem.c:159:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
>> drivers/char/mem.c:164:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
drivers/char/mem.c:235:10: error: call to undeclared function 'xlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
ptr = xlate_dev_mem_ptr(p);
^
drivers/char/mem.c:235:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
ptr = xlate_dev_mem_ptr(p);
^ ~~~~~~~~~~~~~~~~~~~~
drivers/char/mem.c:243:4: error: call to undeclared function 'unxlate_dev_mem_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unxlate_dev_mem_ptr(p, ptr);
^
6 errors generated.
vim +/xlate_dev_mem_ptr +159 drivers/char/mem.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 133
22ec1a2aea73b9 Kees Cook 2017-12-01 134 bounce = kmalloc(PAGE_SIZE, GFP_KERNEL);
22ec1a2aea73b9 Kees Cook 2017-12-01 135 if (!bounce)
22ec1a2aea73b9 Kees Cook 2017-12-01 136 return -ENOMEM;
22ec1a2aea73b9 Kees Cook 2017-12-01 137
^1da177e4c3f41 Linus Torvalds 2005-04-16 138 while (count > 0) {
fa29e97bb8c70f Wu Fengguang 2009-12-14 139 unsigned long remaining;
b5b38200ebe548 Kees Cook 2018-03-27 140 int allowed, probe;
fa29e97bb8c70f Wu Fengguang 2009-12-14 141
f222318e9c3a31 Wu Fengguang 2009-12-14 142 sz = size_inside_page(p, count);
^1da177e4c3f41 Linus Torvalds 2005-04-16 143
22ec1a2aea73b9 Kees Cook 2017-12-01 144 err = -EPERM;
a4866aa812518e Kees Cook 2017-04-05 145 allowed = page_is_allowed(p >> PAGE_SHIFT);
a4866aa812518e Kees Cook 2017-04-05 146 if (!allowed)
22ec1a2aea73b9 Kees Cook 2017-12-01 147 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 148
22ec1a2aea73b9 Kees Cook 2017-12-01 149 err = -EFAULT;
a4866aa812518e Kees Cook 2017-04-05 150 if (allowed == 2) {
a4866aa812518e Kees Cook 2017-04-05 151 /* Show zeros for restricted memory. */
a4866aa812518e Kees Cook 2017-04-05 152 remaining = clear_user(buf, sz);
a4866aa812518e Kees Cook 2017-04-05 153 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 154 /*
a4866aa812518e Kees Cook 2017-04-05 155 * On ia64 if a page has been mapped somewhere as
a4866aa812518e Kees Cook 2017-04-05 156 * uncached, then it must also be accessed uncached
a4866aa812518e Kees Cook 2017-04-05 157 * by the kernel or data corruption may occur.
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @159 ptr = xlate_dev_mem_ptr(p);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 160 if (!ptr)
22ec1a2aea73b9 Kees Cook 2017-12-01 161 goto failed;
a4866aa812518e Kees Cook 2017-04-05 162
fe557319aa06c2 Christoph Hellwig 2020-06-17 163 probe = copy_from_kernel_nofault(bounce, ptr, sz);
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 @164 unxlate_dev_mem_ptr(p, ptr);
b5b38200ebe548 Kees Cook 2018-03-27 165 if (probe)
22ec1a2aea73b9 Kees Cook 2017-12-01 166 goto failed;
22ec1a2aea73b9 Kees Cook 2017-12-01 167
22ec1a2aea73b9 Kees Cook 2017-12-01 168 remaining = copy_to_user(buf, bounce, sz);
a4866aa812518e Kees Cook 2017-04-05 169 }
a4866aa812518e Kees Cook 2017-04-05 170
fa29e97bb8c70f Wu Fengguang 2009-12-14 171 if (remaining)
22ec1a2aea73b9 Kees Cook 2017-12-01 172 goto failed;
e045fb2a988a9a venkatesh.pallipadi@intel.com 2008-03-18 173
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 buf += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 175 p += sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 176 count -= sz;
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 read += sz;
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 178 if (should_stop_iteration())
8619e5bdeee8b2 Tetsuo Handa 2019-08-26 179 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 }
22ec1a2aea73b9 Kees Cook 2017-12-01 181 kfree(bounce);
^1da177e4c3f41 Linus Torvalds 2005-04-16 182
^1da177e4c3f41 Linus Torvalds 2005-04-16 183 *ppos += read;
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 return read;
22ec1a2aea73b9 Kees Cook 2017-12-01 185
22ec1a2aea73b9 Kees Cook 2017-12-01 186 failed:
22ec1a2aea73b9 Kees Cook 2017-12-01 187 kfree(bounce);
22ec1a2aea73b9 Kees Cook 2017-12-01 188 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 190
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-19 3:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 10:08 [PATCH] asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr() Kefeng Wang
2023-11-18 10:08 ` Kefeng Wang
2023-11-18 10:08 ` Kefeng Wang
2023-11-18 19:26 ` kernel test robot
2023-11-18 19:26 ` kernel test robot
2023-11-18 19:26 ` kernel test robot
2023-11-19 3:13 ` kernel test robot [this message]
2023-11-19 3:13 ` kernel test robot
2023-11-19 3:13 ` kernel test robot
2023-11-19 19:34 ` Geert Uytterhoeven
2023-11-19 19:34 ` Geert Uytterhoeven
2023-11-19 19:34 ` Geert Uytterhoeven
2023-11-20 0:39 ` Kefeng Wang
2023-11-20 0:39 ` Kefeng Wang
2023-11-20 0:39 ` Kefeng Wang
2023-11-20 6:40 ` Arnd Bergmann
2023-11-20 6:40 ` Arnd Bergmann
2023-11-20 6:40 ` Arnd Bergmann
2023-11-20 7:04 ` Kefeng Wang
2023-11-20 7:04 ` Kefeng Wang
2023-11-20 7:04 ` Kefeng Wang
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=202311191145.pppExJS6-lkp@intel.com \
--to=lkp@intel.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=arnd@arndb.de \
--cc=bcain@quicinc.com \
--cc=dalias@libc.org \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=llvm@lists.linux.dev \
--cc=npiggin@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=richard.henderson@linaro.org \
--cc=sparclinux@vger.kernel.org \
--cc=stanislav.kinsburskii@gmail.com \
--cc=wangkefeng.wang@huawei.com \
--cc=ysato@users.sourceforge.jp \
/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.