[xlnx:master 271/274] drivers/misc/xilinx-ai-engine/ai-engine-part.c:302:32: warning: passing argument 2 of 'copy_from_user' makes pointer from integer without a cast
by kernel test robot
Hi Tejus,
FYI, the error/warning still remains.
tree: https://github.com/Xilinx/linux-xlnx master
head: 11fb963a44f50af56ff7017fe808ff83b3ae4716
commit: d3774573d5a9700273bd0c3ff82af157107f7fa6 [271/274] misc: xilinx-ai-engine: transaction mode ioctl
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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/Xilinx/linux-xlnx/commit/d3774573d5a9700273bd0c3ff82af...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xlnx master
git checkout d3774573d5a9700273bd0c3ff82af157107f7fa6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/misc/xilinx-ai-engine/ai-engine-part.c: In function 'aie_part_access_regs':
>> drivers/misc/xilinx-ai-engine/ai-engine-part.c:302:32: warning: passing argument 2 of 'copy_from_user' makes pointer from integer without a cast [-Wint-conversion]
302 | if (copy_from_user(tmp, args->dataptr, sizeof(u32) *
| ~~~~^~~~~~~~~
| |
| __u64 {aka long long unsigned int}
In file included from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/ptrace.h:7,
from arch/arm64/include/asm/kgdb.h:14,
from include/linux/kgdb.h:20,
from arch/arm64/include/asm/cacheflush.h:11,
from arch/arm64/include/asm/mmu_context.h:18,
from include/linux/mmu_context.h:5,
from drivers/misc/xilinx-ai-engine/ai-engine-part.c:17:
include/linux/uaccess.h:141:45: note: expected 'const void *' but argument is of type '__u64' {aka 'long long unsigned int'}
141 | copy_from_user(void *to, const void __user *from, unsigned long n)
| ~~~~~~~~~~~~~~~~~~~^~~~
drivers/misc/xilinx-ai-engine/ai-engine-part.c: In function 'aie_part_execute_transaction_from_user':
drivers/misc/xilinx-ai-engine/ai-engine-part.c:365:35: warning: passing argument 2 of 'copy_from_user' makes pointer from integer without a cast [-Wint-conversion]
365 | if (copy_from_user(cmds, txn_inst.cmdsptr,
| ~~~~~~~~^~~~~~~~
| |
| __u64 {aka long long unsigned int}
In file included from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/ptrace.h:7,
from arch/arm64/include/asm/kgdb.h:14,
from include/linux/kgdb.h:20,
from arch/arm64/include/asm/cacheflush.h:11,
from arch/arm64/include/asm/mmu_context.h:18,
from include/linux/mmu_context.h:5,
from drivers/misc/xilinx-ai-engine/ai-engine-part.c:17:
include/linux/uaccess.h:141:45: note: expected 'const void *' but argument is of type '__u64' {aka 'long long unsigned int'}
141 | copy_from_user(void *to, const void __user *from, unsigned long n)
| ~~~~~~~~~~~~~~~~~~~^~~~
vim +/copy_from_user +302 drivers/misc/xilinx-ai-engine/ai-engine-part.c
262
263 /**
264 * aie_part_access_regs() - AI engine partition registers access
265 * @apart: AI engine partition
266 * @num_reqs: number of access requests
267 * @reqs: array of registers access
268 * @return: 0 for success, and negative value for failure.
269 *
270 * This function executes AI engine partition register access requests.
271 */
272 static int aie_part_access_regs(struct aie_partition *apart, u32 num_reqs,
273 struct aie_reg_args *reqs)
274 {
275 u32 i;
276
277 for (i = 0; i < num_reqs; i++) {
278 struct aie_reg_args *args = &reqs[i];
279 int ret;
280
281 switch (args->op) {
282 case AIE_REG_WRITE:
283 {
284 ret = aie_part_write_register(apart,
285 (size_t)args->offset,
286 sizeof(args->val),
287 &args->val, args->mask);
288 break;
289 }
290 case AIE_REG_BLOCKWRITE:
291 {
292 u32 *tmp;
293
294 /*
295 * TODO: replace copy_from_user by pinning the user
296 * page for performance improvement.
297 */
298 tmp = kcalloc(args->len, sizeof(u32), GFP_KERNEL);
299 if (!tmp)
300 return -ENOMEM;
301
> 302 if (copy_from_user(tmp, args->dataptr, sizeof(u32) *
303 args->len)) {
304 kfree(tmp);
305 return -EFAULT;
306 }
307
308 ret = aie_part_write_register(apart,
309 (size_t)args->offset,
310 sizeof(u32) * args->len,
311 tmp, args->mask);
312 kfree(tmp);
313 break;
314 }
315 case AIE_REG_BLOCKSET:
316 {
317 ret = aie_part_block_set(apart, args);
318 break;
319 }
320 default:
321 dev_err(&apart->dev,
322 "Invalid register command type: %u.\n",
323 args->op);
324 return -EINVAL;
325 }
326
327 if (ret < 0) {
328 dev_err(&apart->dev, "reg op %u failed: 0x%llx.\n",
329 args->op, args->offset);
330 return ret;
331 }
332 }
333
334 return 0;
335 }
336
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[chrome-os:chromeos-5.10 46/50] drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:456:16: error: unused variable 'flags'
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: a0db3419071529d11d57bf7720ebbea165ec301c
commit: 2aafbed9832f90f66592f9055153c2e3cfcfddce [46/50] CHROMIUM: drm/i915: Fix spinlock recursion in intel_breadcrumbs
config: x86_64-randconfig-c024-20210409 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 2aafbed9832f90f66592f9055153c2e3cfcfddce
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/gt/intel_breadcrumbs.c: In function 'i915_request_cancel_breadcrumb':
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:456:16: error: unused variable 'flags' [-Werror=unused-variable]
456 | unsigned long flags;
| ^~~~~
cc1: all warnings being treated as errors
vim +/flags +456 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 451
52c0fdb25c7c91 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2019-01-29 452 void i915_request_cancel_breadcrumb(struct i915_request *rq)
9eb143bbec7dfd drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2017-02-23 453 {
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 454 struct intel_breadcrumbs *b = READ_ONCE(rq->engine)->breadcrumbs;
9f3ccd40acf4a3 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2019-12-20 455 struct intel_context *ce = rq->context;
71e8f381dfef38 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-12-24 @456 unsigned long flags;
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 457 bool release;
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 458
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 459 spin_lock(&ce->signal_lock);
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 460 if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 461 spin_unlock(&ce->signal_lock);
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 462 return;
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 463 }
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 464
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 465 list_del_rcu(&rq->signal_link);
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 466 release = remove_signaling_context(b, ce);
2aafbed9832f90 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Sean Paul 2021-04-09 467 spin_unlock(&ce->signal_lock);
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 468 if (release)
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 469 intel_context_put(ce);
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 470
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 471 if (__i915_request_is_complete(rq))
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 472 irq_signal_request(rq, b);
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 473
e23005604b2f81 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-08-01 474 i915_request_put(rq);
688e6c7258164d drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 475 }
ad07dfcddf1394 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-10-07 476
:::::: The code at line 456 was first introduced by commit
:::::: 71e8f381dfef3815cb7698f561d319606716b5f7 FROMGIT: drm/i915/gt: Remove virtual breadcrumb before transfer
:::::: TO: Chris Wilson <chris(a)chris-wilson.co.uk>
:::::: CC: Azhar Shaikh <azhar.shaikh(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[chrome-os:chromeos-5.10 46/50] drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:456:16: error: unused variable 'flags'
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: a0db3419071529d11d57bf7720ebbea165ec301c
commit: 2aafbed9832f90f66592f9055153c2e3cfcfddce [46/50] CHROMIUM: drm/i915: Fix spinlock recursion in intel_breadcrumbs
config: x86_64-randconfig-a003-20210409 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project dd453a1389b6a7e6d9214b449d3c54981b1a89b6)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 2aafbed9832f90f66592f9055153c2e3cfcfddce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:456:16: error: unused variable 'flags' [-Werror,-Wunused-variable]
unsigned long flags;
^
1 error generated.
vim +/flags +456 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 451
52c0fdb25c7c91 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2019-01-29 452 void i915_request_cancel_breadcrumb(struct i915_request *rq)
9eb143bbec7dfd drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2017-02-23 453 {
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 454 struct intel_breadcrumbs *b = READ_ONCE(rq->engine)->breadcrumbs;
9f3ccd40acf4a3 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2019-12-20 455 struct intel_context *ce = rq->context;
71e8f381dfef38 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-12-24 @456 unsigned long flags;
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 457 bool release;
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 458
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 459 spin_lock(&ce->signal_lock);
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 460 if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 461 spin_unlock(&ce->signal_lock);
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 462 return;
2545b18b98348d drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2021-01-19 463 }
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 464
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 465 list_del_rcu(&rq->signal_link);
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 466 release = remove_signaling_context(b, ce);
2aafbed9832f90 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Sean Paul 2021-04-09 467 spin_unlock(&ce->signal_lock);
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 468 if (release)
2bfdf302465a5e drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 469 intel_context_put(ce);
c81d46138da658 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 470
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 471 if (__i915_request_is_complete(rq))
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 472 irq_signal_request(rq, b);
e8e67d1c9d9215 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-11-26 473
e23005604b2f81 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c Chris Wilson 2020-08-01 474 i915_request_put(rq);
688e6c7258164d drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-07-01 475 }
ad07dfcddf1394 drivers/gpu/drm/i915/intel_breadcrumbs.c Chris Wilson 2016-10-07 476
:::::: The code at line 456 was first introduced by commit
:::::: 71e8f381dfef3815cb7698f561d319606716b5f7 FROMGIT: drm/i915/gt: Remove virtual breadcrumb before transfer
:::::: TO: Chris Wilson <chris(a)chris-wilson.co.uk>
:::::: CC: Azhar Shaikh <azhar.shaikh(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[intel-linux-intel-lts:4.19/android_r 16398/22631] drivers/gpu/drm/drm_dp_mst_topology.c:1843 drm_dp_mst_update_dsc_info() warn: inconsistent indenting
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 4.19/android_r
head: 072f407465e8e25a3c2c22590e1ab72ccf335151
commit: b572376bedc67f334d005dabd7727dd318eeba44 [16398/22631] ANDROID: GKI: Add 'dsc_info' to struct drm_dp_mst_port
config: i386-randconfig-m021-20210409 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/gpu/drm/drm_dp_mst_topology.c:1843 drm_dp_mst_update_dsc_info() warn: inconsistent indenting
vim +1843 drivers/gpu/drm/drm_dp_mst_topology.c
1830
1831 int drm_dp_mst_update_dsc_info(struct drm_dp_mst_topology_mgr *mgr,
1832 struct drm_dp_mst_port *port,
1833 struct drm_dp_mst_dsc_info *dsc_info)
1834 {
1835 if (!dsc_info)
1836 return -EINVAL;
1837
1838 port = drm_dp_get_validated_port_ref(mgr, port);
1839 if (!port)
1840 return -EINVAL;
1841
1842 memcpy(&port->dsc_info, dsc_info, sizeof(struct drm_dp_mst_dsc_info));
> 1843 drm_dp_put_port(port);
1844
1845 return 0;
1846 }
1847 EXPORT_SYMBOL_GPL(drm_dp_mst_update_dsc_info);
1848
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[intel-linux-intel-lts:4.19/android_r 19120/22631] security/security.c:381:5: warning: no previous prototype for 'lsm_file_alloc'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 4.19/android_r
head: 072f407465e8e25a3c2c22590e1ab72ccf335151
commit: b652a52d36a85d1b731921ba08e701d7150ce200 [19120/22631] Merge branch 'aosp/android-4.19-stable' into android_r
config: m68k-randconfig-r036-20210409 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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/intel/linux-intel-lts/commit/b652a52d36a85d1b731921ba0...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android_r
git checkout b652a52d36a85d1b731921ba08e701d7150ce200
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:81,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/bpf.h:12,
from security/security.c:15:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:188:36: note: in definition of macro 'BUG_ON'
188 | #define BUG_ON(condition) do { if (condition) BUG(); } while (0)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:188:36: note: in definition of macro 'BUG_ON'
188 | #define BUG_ON(condition) do { if (condition) BUG(); } while (0)
| ^~~~~~~~~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h:392:9: note: in expansion of macro 'pfn_valid'
392 | BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
| ^~~~~~~~~
security/security.c: At top level:
>> security/security.c:381:5: warning: no previous prototype for 'lsm_file_alloc' [-Wmissing-prototypes]
381 | int lsm_file_alloc(struct file *file)
| ^~~~~~~~~~~~~~
>> security/security.c:402:5: warning: no previous prototype for 'lsm_task_alloc' [-Wmissing-prototypes]
402 | int lsm_task_alloc(struct task_struct *task)
| ^~~~~~~~~~~~~~
>> security/security.c:482:5: warning: no previous prototype for 'lsm_ipc_alloc' [-Wmissing-prototypes]
482 | int lsm_ipc_alloc(struct kern_ipc_perm *kip)
| ^~~~~~~~~~~~~
>> security/security.c:504:5: warning: no previous prototype for 'lsm_key_alloc' [-Wmissing-prototypes]
504 | int lsm_key_alloc(struct key *key)
| ^~~~~~~~~~~~~
>> security/security.c:526:5: warning: no previous prototype for 'lsm_msg_msg_alloc' [-Wmissing-prototypes]
526 | int lsm_msg_msg_alloc(struct msg_msg *mp)
| ^~~~~~~~~~~~~~~~~
>> security/security.c:548:5: warning: no previous prototype for 'lsm_sock_alloc' [-Wmissing-prototypes]
548 | int lsm_sock_alloc(struct sock *sock, gfp_t priority)
| ^~~~~~~~~~~~~~
>> security/security.c:569:5: warning: no previous prototype for 'lsm_superblock_alloc' [-Wmissing-prototypes]
569 | int lsm_superblock_alloc(struct super_block *sb)
| ^~~~~~~~~~~~~~~~~~~~
security/security.c:220: warning: Function parameter or member 'lsm' not described in 'security_module_enable'
security/security.c:220: warning: Excess function parameter 'module' description in 'security_module_enable'
--
security/integrity/ima/ima_policy.c: In function 'ima_lsm_update_rules':
security/integrity/ima/ima_policy.c:253:6: warning: variable 'result' set but not used [-Wunused-but-set-variable]
253 | int result;
| ^~~~~~
security/integrity/ima/ima_policy.c: In function 'ima_match_rules':
>> security/integrity/ima/ima_policy.c:332:36: warning: passing argument 1 of 'security_filter_rule_match' makes integer from pointer without a cast [-Wint-conversion]
332 | rc = security_filter_rule_match(&osid,
| ^~~~~
| |
| struct secids *
In file included from security/integrity/ima/ima_policy.c:24:
security/integrity/ima/ima.h:313:50: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'struct secids *'
313 | static inline int security_filter_rule_match(u32 secid, u32 field, u32 op,
| ~~~~^~~~~
security/integrity/ima/ima_policy.c:341:36: warning: passing argument 1 of 'security_filter_rule_match' makes integer from pointer without a cast [-Wint-conversion]
341 | rc = security_filter_rule_match(secid,
| ^~~~~
| |
| struct secids *
In file included from security/integrity/ima/ima_policy.c:24:
security/integrity/ima/ima.h:313:50: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'struct secids *'
313 | static inline int security_filter_rule_match(u32 secid, u32 field, u32 op,
| ~~~~^~~~~
security/integrity/ima/ima_policy.c: In function 'ima_init_policy':
security/integrity/ima/ima_policy.c:526:16: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
526 | for (i = 0; i < ARRAY_SIZE(build_appraise_rules); i++) {
| ^
security/integrity/ima/ima_policy.c: In function 'ima_parse_rule':
security/integrity/ima/ima_policy.c:855:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
855 | entry->uid_op = &uid_gt;
| ~~~~~~~~~~~~~~^~~~~~~~~
security/integrity/ima/ima_policy.c:856:3: note: here
856 | case Opt_uid_lt:
| ^~~~
security/integrity/ima/ima_policy.c:858:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
858 | if ((token == Opt_uid_lt) || (token == Opt_euid_lt))
| ^
security/integrity/ima/ima_policy.c:860:3: note: here
860 | case Opt_uid_eq:
| ^~~~
security/integrity/ima/ima_policy.c:887:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
887 | entry->fowner_op = &uid_gt;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~
security/integrity/ima/ima_policy.c:888:3: note: here
888 | case Opt_fowner_lt:
| ^~~~
security/integrity/ima/ima_policy.c:889:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
889 | if (token == Opt_fowner_lt)
| ^
security/integrity/ima/ima_policy.c:891:3: note: here
891 | case Opt_fowner_eq:
| ^~~~
security/integrity/ima/ima_policy.c:405: warning: Function parameter or member 'flags' not described in 'ima_match_policy'
security/integrity/ima/ima_policy.c:998: warning: Function parameter or member 'rule' not described in 'ima_parse_add_rule'
vim +/lsm_file_alloc +381 security/security.c
d082cff47912b9 Casey Schaufler 2018-05-10 372
d082cff47912b9 Casey Schaufler 2018-05-10 373 /**
d082cff47912b9 Casey Schaufler 2018-05-10 374 * lsm_file_alloc - allocate a composite file blob
d082cff47912b9 Casey Schaufler 2018-05-10 375 * @file: the file that needs a blob
d082cff47912b9 Casey Schaufler 2018-05-10 376 *
d082cff47912b9 Casey Schaufler 2018-05-10 377 * Allocate the file blob for all the modules
d082cff47912b9 Casey Schaufler 2018-05-10 378 *
d082cff47912b9 Casey Schaufler 2018-05-10 379 * Returns 0, or -ENOMEM if memory can't be allocated.
d082cff47912b9 Casey Schaufler 2018-05-10 380 */
d082cff47912b9 Casey Schaufler 2018-05-10 @381 int lsm_file_alloc(struct file *file)
d082cff47912b9 Casey Schaufler 2018-05-10 382 {
d082cff47912b9 Casey Schaufler 2018-05-10 383 if (!lsm_file_cache) {
d082cff47912b9 Casey Schaufler 2018-05-10 384 file->f_security = NULL;
d082cff47912b9 Casey Schaufler 2018-05-10 385 return 0;
d082cff47912b9 Casey Schaufler 2018-05-10 386 }
d082cff47912b9 Casey Schaufler 2018-05-10 387
d082cff47912b9 Casey Schaufler 2018-05-10 388 file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL);
d082cff47912b9 Casey Schaufler 2018-05-10 389 if (file->f_security == NULL)
d082cff47912b9 Casey Schaufler 2018-05-10 390 return -ENOMEM;
d082cff47912b9 Casey Schaufler 2018-05-10 391 return 0;
7880b02f0906b7 Casey Schaufler 2018-08-27 392 }
7880b02f0906b7 Casey Schaufler 2018-08-27 393
7cb75cc654c717 Casey Schaufler 2018-05-10 394 /**
7cb75cc654c717 Casey Schaufler 2018-05-10 395 * lsm_task_alloc - allocate a composite task blob
7cb75cc654c717 Casey Schaufler 2018-05-10 396 * @task: the task that needs a blob
7cb75cc654c717 Casey Schaufler 2018-05-10 397 *
7cb75cc654c717 Casey Schaufler 2018-05-10 398 * Allocate the task blob for all the modules
7cb75cc654c717 Casey Schaufler 2018-05-10 399 *
7cb75cc654c717 Casey Schaufler 2018-05-10 400 * Returns 0, or -ENOMEM if memory can't be allocated.
7cb75cc654c717 Casey Schaufler 2018-05-10 401 */
7cb75cc654c717 Casey Schaufler 2018-05-10 @402 int lsm_task_alloc(struct task_struct *task)
7cb75cc654c717 Casey Schaufler 2018-05-10 403 {
7cb75cc654c717 Casey Schaufler 2018-05-10 404 if (blob_sizes.lbs_task == 0) {
7cb75cc654c717 Casey Schaufler 2018-05-10 405 task->security = NULL;
7cb75cc654c717 Casey Schaufler 2018-05-10 406 return 0;
7cb75cc654c717 Casey Schaufler 2018-05-10 407 }
7cb75cc654c717 Casey Schaufler 2018-05-10 408
7cb75cc654c717 Casey Schaufler 2018-05-10 409 task->security = kzalloc(blob_sizes.lbs_task, GFP_KERNEL);
7cb75cc654c717 Casey Schaufler 2018-05-10 410 if (task->security == NULL)
7cb75cc654c717 Casey Schaufler 2018-05-10 411 return -ENOMEM;
7cb75cc654c717 Casey Schaufler 2018-05-10 412 return 0;
7cb75cc654c717 Casey Schaufler 2018-05-10 413 }
7cb75cc654c717 Casey Schaufler 2018-05-10 414
7cb75cc654c717 Casey Schaufler 2018-05-10 415 /**
7cb75cc654c717 Casey Schaufler 2018-05-10 416 * lsm_early_task - during initialization allocate a composite task blob
7cb75cc654c717 Casey Schaufler 2018-05-10 417 * @task: the task that needs a blob
7cb75cc654c717 Casey Schaufler 2018-05-10 418 *
7cb75cc654c717 Casey Schaufler 2018-05-10 419 * Allocate the task blob for all the modules if it's not already there
7cb75cc654c717 Casey Schaufler 2018-05-10 420 */
7cb75cc654c717 Casey Schaufler 2018-05-10 421 void lsm_early_task(struct task_struct *task)
7cb75cc654c717 Casey Schaufler 2018-05-10 422 {
7cb75cc654c717 Casey Schaufler 2018-05-10 423 int rc;
7cb75cc654c717 Casey Schaufler 2018-05-10 424
7cb75cc654c717 Casey Schaufler 2018-05-10 425 if (task == NULL)
7cb75cc654c717 Casey Schaufler 2018-05-10 426 panic("%s: task cred.\n", __func__);
7cb75cc654c717 Casey Schaufler 2018-05-10 427 if (task->security != NULL)
7cb75cc654c717 Casey Schaufler 2018-05-10 428 return;
7cb75cc654c717 Casey Schaufler 2018-05-10 429 rc = lsm_task_alloc(task);
7cb75cc654c717 Casey Schaufler 2018-05-10 430 if (rc)
7cb75cc654c717 Casey Schaufler 2018-05-10 431 panic("%s: Early task alloc failed.\n", __func__);
7cb75cc654c717 Casey Schaufler 2018-05-10 432 }
7cb75cc654c717 Casey Schaufler 2018-05-10 433
aa6496634cff6a Casey Schaufler 2018-06-20 434 /**
aa6496634cff6a Casey Schaufler 2018-06-20 435 * lsm_inode_alloc - allocate a composite inode blob
aa6496634cff6a Casey Schaufler 2018-06-20 436 * @inode: the inode that needs a blob
aa6496634cff6a Casey Schaufler 2018-06-20 437 *
aa6496634cff6a Casey Schaufler 2018-06-20 438 * Allocate the inode blob for all the modules
aa6496634cff6a Casey Schaufler 2018-06-20 439 *
aa6496634cff6a Casey Schaufler 2018-06-20 440 * Returns 0, or -ENOMEM if memory can't be allocated.
aa6496634cff6a Casey Schaufler 2018-06-20 441 */
aa6496634cff6a Casey Schaufler 2018-06-20 442 int lsm_inode_alloc(struct inode *inode)
aa6496634cff6a Casey Schaufler 2018-06-20 443 {
aa6496634cff6a Casey Schaufler 2018-06-20 444 if (!lsm_inode_cache) {
aa6496634cff6a Casey Schaufler 2018-06-20 445 inode->i_security = NULL;
aa6496634cff6a Casey Schaufler 2018-06-20 446 return 0;
aa6496634cff6a Casey Schaufler 2018-06-20 447 }
aa6496634cff6a Casey Schaufler 2018-06-20 448
aa6496634cff6a Casey Schaufler 2018-06-20 449 inode->i_security = kmem_cache_zalloc(lsm_inode_cache, GFP_NOFS);
aa6496634cff6a Casey Schaufler 2018-06-20 450 if (inode->i_security == NULL)
aa6496634cff6a Casey Schaufler 2018-06-20 451 return -ENOMEM;
aa6496634cff6a Casey Schaufler 2018-06-20 452 return 0;
aa6496634cff6a Casey Schaufler 2018-06-20 453 }
aa6496634cff6a Casey Schaufler 2018-06-20 454
aa6496634cff6a Casey Schaufler 2018-06-20 455 /**
aa6496634cff6a Casey Schaufler 2018-06-20 456 * lsm_early_inode - during initialization allocate a composite inode blob
aa6496634cff6a Casey Schaufler 2018-06-20 457 * @inode: the inode that needs a blob
aa6496634cff6a Casey Schaufler 2018-06-20 458 *
aa6496634cff6a Casey Schaufler 2018-06-20 459 * Allocate the inode blob for all the modules if it's not already there
aa6496634cff6a Casey Schaufler 2018-06-20 460 */
aa6496634cff6a Casey Schaufler 2018-06-20 461 void lsm_early_inode(struct inode *inode)
aa6496634cff6a Casey Schaufler 2018-06-20 462 {
aa6496634cff6a Casey Schaufler 2018-06-20 463 int rc;
aa6496634cff6a Casey Schaufler 2018-06-20 464
aa6496634cff6a Casey Schaufler 2018-06-20 465 if (inode == NULL)
aa6496634cff6a Casey Schaufler 2018-06-20 466 panic("%s: NULL inode.\n", __func__);
aa6496634cff6a Casey Schaufler 2018-06-20 467 if (inode->i_security != NULL)
aa6496634cff6a Casey Schaufler 2018-06-20 468 return;
aa6496634cff6a Casey Schaufler 2018-06-20 469 rc = lsm_inode_alloc(inode);
aa6496634cff6a Casey Schaufler 2018-06-20 470 if (rc)
aa6496634cff6a Casey Schaufler 2018-06-20 471 panic("%s: Early inode alloc failed.\n", __func__);
aa6496634cff6a Casey Schaufler 2018-06-20 472 }
aa6496634cff6a Casey Schaufler 2018-06-20 473
e92c67fcf33bb7 Casey Schaufler 2018-06-21 474 /**
e92c67fcf33bb7 Casey Schaufler 2018-06-21 475 * lsm_ipc_alloc - allocate a composite ipc blob
e92c67fcf33bb7 Casey Schaufler 2018-06-21 476 * @kip: the ipc that needs a blob
e92c67fcf33bb7 Casey Schaufler 2018-06-21 477 *
e92c67fcf33bb7 Casey Schaufler 2018-06-21 478 * Allocate the ipc blob for all the modules
e92c67fcf33bb7 Casey Schaufler 2018-06-21 479 *
e92c67fcf33bb7 Casey Schaufler 2018-06-21 480 * Returns 0, or -ENOMEM if memory can't be allocated.
e92c67fcf33bb7 Casey Schaufler 2018-06-21 481 */
e92c67fcf33bb7 Casey Schaufler 2018-06-21 @482 int lsm_ipc_alloc(struct kern_ipc_perm *kip)
e92c67fcf33bb7 Casey Schaufler 2018-06-21 483 {
e92c67fcf33bb7 Casey Schaufler 2018-06-21 484 if (blob_sizes.lbs_ipc == 0) {
e92c67fcf33bb7 Casey Schaufler 2018-06-21 485 kip->security = NULL;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 486 return 0;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 487 }
e92c67fcf33bb7 Casey Schaufler 2018-06-21 488
e92c67fcf33bb7 Casey Schaufler 2018-06-21 489 kip->security = kzalloc(blob_sizes.lbs_ipc, GFP_KERNEL);
e92c67fcf33bb7 Casey Schaufler 2018-06-21 490 if (kip->security == NULL)
e92c67fcf33bb7 Casey Schaufler 2018-06-21 491 return -ENOMEM;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 492 return 0;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 493 }
e92c67fcf33bb7 Casey Schaufler 2018-06-21 494
1d4be734af45c0 Casey Schaufler 2018-05-10 495 #ifdef CONFIG_KEYS
1d4be734af45c0 Casey Schaufler 2018-05-10 496 /**
1d4be734af45c0 Casey Schaufler 2018-05-10 497 * lsm_key_alloc - allocate a composite key blob
1d4be734af45c0 Casey Schaufler 2018-05-10 498 * @key: the key that needs a blob
1d4be734af45c0 Casey Schaufler 2018-05-10 499 *
1d4be734af45c0 Casey Schaufler 2018-05-10 500 * Allocate the key blob for all the modules
1d4be734af45c0 Casey Schaufler 2018-05-10 501 *
1d4be734af45c0 Casey Schaufler 2018-05-10 502 * Returns 0, or -ENOMEM if memory can't be allocated.
1d4be734af45c0 Casey Schaufler 2018-05-10 503 */
1d4be734af45c0 Casey Schaufler 2018-05-10 @504 int lsm_key_alloc(struct key *key)
1d4be734af45c0 Casey Schaufler 2018-05-10 505 {
1d4be734af45c0 Casey Schaufler 2018-05-10 506 if (blob_sizes.lbs_key == 0) {
1d4be734af45c0 Casey Schaufler 2018-05-10 507 key->security = NULL;
1d4be734af45c0 Casey Schaufler 2018-05-10 508 return 0;
1d4be734af45c0 Casey Schaufler 2018-05-10 509 }
1d4be734af45c0 Casey Schaufler 2018-05-10 510
1d4be734af45c0 Casey Schaufler 2018-05-10 511 key->security = kzalloc(blob_sizes.lbs_key, GFP_KERNEL);
1d4be734af45c0 Casey Schaufler 2018-05-10 512 if (key->security == NULL)
1d4be734af45c0 Casey Schaufler 2018-05-10 513 return -ENOMEM;
1d4be734af45c0 Casey Schaufler 2018-05-10 514 return 0;
1d4be734af45c0 Casey Schaufler 2018-05-10 515 }
1d4be734af45c0 Casey Schaufler 2018-05-10 516 #endif /* CONFIG_KEYS */
1d4be734af45c0 Casey Schaufler 2018-05-10 517
e92c67fcf33bb7 Casey Schaufler 2018-06-21 518 /**
e92c67fcf33bb7 Casey Schaufler 2018-06-21 519 * lsm_msg_msg_alloc - allocate a composite msg_msg blob
e92c67fcf33bb7 Casey Schaufler 2018-06-21 520 * @mp: the msg_msg that needs a blob
e92c67fcf33bb7 Casey Schaufler 2018-06-21 521 *
e92c67fcf33bb7 Casey Schaufler 2018-06-21 522 * Allocate the ipc blob for all the modules
e92c67fcf33bb7 Casey Schaufler 2018-06-21 523 *
e92c67fcf33bb7 Casey Schaufler 2018-06-21 524 * Returns 0, or -ENOMEM if memory can't be allocated.
e92c67fcf33bb7 Casey Schaufler 2018-06-21 525 */
e92c67fcf33bb7 Casey Schaufler 2018-06-21 @526 int lsm_msg_msg_alloc(struct msg_msg *mp)
e92c67fcf33bb7 Casey Schaufler 2018-06-21 527 {
e92c67fcf33bb7 Casey Schaufler 2018-06-21 528 if (blob_sizes.lbs_msg_msg == 0) {
e92c67fcf33bb7 Casey Schaufler 2018-06-21 529 mp->security = NULL;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 530 return 0;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 531 }
e92c67fcf33bb7 Casey Schaufler 2018-06-21 532
e92c67fcf33bb7 Casey Schaufler 2018-06-21 533 mp->security = kzalloc(blob_sizes.lbs_msg_msg, GFP_KERNEL);
e92c67fcf33bb7 Casey Schaufler 2018-06-21 534 if (mp->security == NULL)
e92c67fcf33bb7 Casey Schaufler 2018-06-21 535 return -ENOMEM;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 536 return 0;
e92c67fcf33bb7 Casey Schaufler 2018-06-21 537 }
e92c67fcf33bb7 Casey Schaufler 2018-06-21 538
36f477475f6efc Casey Schaufler 2018-07-12 539 /**
36f477475f6efc Casey Schaufler 2018-07-12 540 * lsm_sock_alloc - allocate a composite sock blob
36f477475f6efc Casey Schaufler 2018-07-12 541 * @sock: the sock that needs a blob
36f477475f6efc Casey Schaufler 2018-07-12 542 * @priority: allocation mode
36f477475f6efc Casey Schaufler 2018-07-12 543 *
36f477475f6efc Casey Schaufler 2018-07-12 544 * Allocate the sock blob for all the modules
36f477475f6efc Casey Schaufler 2018-07-12 545 *
36f477475f6efc Casey Schaufler 2018-07-12 546 * Returns 0, or -ENOMEM if memory can't be allocated.
36f477475f6efc Casey Schaufler 2018-07-12 547 */
36f477475f6efc Casey Schaufler 2018-07-12 @548 int lsm_sock_alloc(struct sock *sock, gfp_t priority)
36f477475f6efc Casey Schaufler 2018-07-12 549 {
36f477475f6efc Casey Schaufler 2018-07-12 550 if (blob_sizes.lbs_sock == 0) {
36f477475f6efc Casey Schaufler 2018-07-12 551 sock->sk_security = NULL;
36f477475f6efc Casey Schaufler 2018-07-12 552 return 0;
36f477475f6efc Casey Schaufler 2018-07-12 553 }
36f477475f6efc Casey Schaufler 2018-07-12 554
36f477475f6efc Casey Schaufler 2018-07-12 555 sock->sk_security = kzalloc(blob_sizes.lbs_sock, priority);
36f477475f6efc Casey Schaufler 2018-07-12 556 if (sock->sk_security == NULL)
36f477475f6efc Casey Schaufler 2018-07-12 557 return -ENOMEM;
36f477475f6efc Casey Schaufler 2018-07-12 558 return 0;
36f477475f6efc Casey Schaufler 2018-07-12 559 }
36f477475f6efc Casey Schaufler 2018-07-12 560
01de591a11f331 Casey Schaufler 2018-05-10 561 /**
01de591a11f331 Casey Schaufler 2018-05-10 562 * lsm_superblock_alloc - allocate a composite superblock blob
01de591a11f331 Casey Schaufler 2018-05-10 563 * @sb: the superblock that needs a blob
01de591a11f331 Casey Schaufler 2018-05-10 564 *
01de591a11f331 Casey Schaufler 2018-05-10 565 * Allocate the superblock blob for all the modules
01de591a11f331 Casey Schaufler 2018-05-10 566 *
01de591a11f331 Casey Schaufler 2018-05-10 567 * Returns 0, or -ENOMEM if memory can't be allocated.
01de591a11f331 Casey Schaufler 2018-05-10 568 */
01de591a11f331 Casey Schaufler 2018-05-10 @569 int lsm_superblock_alloc(struct super_block *sb)
01de591a11f331 Casey Schaufler 2018-05-10 570 {
01de591a11f331 Casey Schaufler 2018-05-10 571 if (blob_sizes.lbs_superblock == 0) {
01de591a11f331 Casey Schaufler 2018-05-10 572 sb->s_security = NULL;
01de591a11f331 Casey Schaufler 2018-05-10 573 return 0;
01de591a11f331 Casey Schaufler 2018-05-10 574 }
01de591a11f331 Casey Schaufler 2018-05-10 575
01de591a11f331 Casey Schaufler 2018-05-10 576 sb->s_security = kzalloc(blob_sizes.lbs_superblock, GFP_KERNEL);
01de591a11f331 Casey Schaufler 2018-05-10 577 if (sb->s_security == NULL)
01de591a11f331 Casey Schaufler 2018-05-10 578 return -ENOMEM;
01de591a11f331 Casey Schaufler 2018-05-10 579 return 0;
01de591a11f331 Casey Schaufler 2018-05-10 580 }
01de591a11f331 Casey Schaufler 2018-05-10 581
:::::: The code at line 381 was first introduced by commit
:::::: d082cff47912b94848d4e470a40449bf84b7536f LSM: Infrastructure management of the file security blob
:::::: TO: Casey Schaufler <casey(a)schaufler-ca.com>
:::::: CC: Pan, Kris <kris.pan(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[intel-linux-intel-lts:4.19/android_r 19121/22631] socket.c:undefined reference to `wext_handle_ioctl'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 4.19/android_r
head: 072f407465e8e25a3c2c22590e1ab72ccf335151
commit: d50a6d412d61dbbde36becaf093d1b8ae3868b8a [19121/22631] binder.c modify secids for struct and param by refs
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.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/intel/linux-intel-lts/commit/d50a6d412d61dbbde36becaf0...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android_r
git checkout d50a6d412d61dbbde36becaf093d1b8ae3868b8a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
s390-linux-ld: net/socket.o: in function `sock_ioctl':
>> socket.c:(.text+0x1d34): undefined reference to `wext_handle_ioctl'
s390-linux-ld: net/socket.o: in function `compat_sock_ioctl':
>> socket.c:(.text+0x27b6): undefined reference to `compat_wext_handle_ioctl'
s390-linux-ld: net/core/net-procfs.o: in function `dev_proc_net_exit':
>> net-procfs.c:(.text+0xbf4): undefined reference to `wext_proc_exit'
s390-linux-ld: net/core/net-procfs.o: in function `dev_proc_net_init':
>> net-procfs.c:(.text+0xd08): undefined reference to `wext_proc_init'
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for WIRELESS_EXT
Depends on NET && WIRELESS
Selected by
- GKI_LEGACY_WEXT_ALLCONFIG
WARNING: unmet direct dependencies detected for WEXT_CORE
Depends on NET && WIRELESS && (CFG80211_WEXT || WIRELESS_EXT
Selected by
- GKI_LEGACY_WEXT_ALLCONFIG
WARNING: unmet direct dependencies detected for WEXT_PROC
Depends on NET && WIRELESS && PROC_FS && WEXT_CORE
Selected by
- GKI_LEGACY_WEXT_ALLCONFIG
WARNING: unmet direct dependencies detected for WEXT_PRIV
Depends on NET && WIRELESS
Selected by
- GKI_LEGACY_WEXT_ALLCONFIG
WARNING: unmet direct dependencies detected for WEXT_SPY
Depends on NET && WIRELESS
Selected by
- GKI_LEGACY_WEXT_ALLCONFIG
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[chrome-os:chromeos-5.10 50/50] drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c:1242:5: warning: no previous prototype for 'bufreq_enc'
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: a0db3419071529d11d57bf7720ebbea165ec301c
commit: a0db3419071529d11d57bf7720ebbea165ec301c [50/50] UPSTREAM: media: venus: Add platform buffers for v6
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.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
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout a0db3419071529d11d57bf7720ebbea165ec301c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c:1242:5: warning: no previous prototype for 'bufreq_enc' [-Wmissing-prototypes]
1242 | int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype,
| ^~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +/bufreq_enc +1242 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
1241
> 1242 int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype,
1243 struct hfi_buffer_requirements *bufreq)
1244 {
1245 enum hfi_version version = params->version;
1246 struct enc_bufsize_ops *enc_ops;
1247 u32 width = params->width;
1248 u32 height = params->height;
1249 bool is_tenbit = params->enc.is_tenbit;
1250 u32 num_bframes = params->enc.num_b_frames;
1251 u32 codec = params->codec;
1252 u32 work_mode = params->enc.work_mode;
1253 u32 rc_type = params->enc.rc_type;
1254 u32 num_vpp_pipes = params->num_vpp_pipes;
1255 u32 num_ref;
1256
1257 switch (codec) {
1258 case V4L2_PIX_FMT_H264:
1259 enc_ops = &enc_h264_ops;
1260 break;
1261 case V4L2_PIX_FMT_HEVC:
1262 enc_ops = &enc_h265_ops;
1263 break;
1264 case V4L2_PIX_FMT_VP8:
1265 enc_ops = &enc_vp8_ops;
1266 break;
1267 default:
1268 return -EINVAL;
1269 }
1270
1271 num_ref = num_bframes > 0 ? num_bframes + 1 : 1;
1272
1273 bufreq->type = buftype;
1274 bufreq->region_size = 0;
1275 bufreq->count_min = 1;
1276 bufreq->count_actual = 1;
1277 bufreq->hold_count = 1;
1278 bufreq->contiguous = 1;
1279 bufreq->alignment = 256;
1280
1281 if (buftype == HFI_BUFFER_INPUT) {
1282 bufreq->count_min = MIN_INPUT_BUFFERS;
1283 bufreq->size =
1284 venus_helper_get_framesz_raw(params->hfi_color_fmt,
1285 width, height);
1286 } else if (buftype == HFI_BUFFER_OUTPUT ||
1287 buftype == HFI_BUFFER_OUTPUT2) {
1288 bufreq->count_min =
1289 output_buffer_count(VIDC_SESSION_TYPE_ENC, codec);
1290 bufreq->size = calculate_enc_output_frame_size(width, height,
1291 rc_type);
1292 } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) {
1293 bufreq->size = enc_ops->scratch(width, height, work_mode,
1294 num_vpp_pipes, rc_type);
1295 } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH_1(version)) {
1296 bufreq->size = enc_ops->scratch1(width, height, num_ref,
1297 is_tenbit, num_vpp_pipes);
1298 } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH_2(version)) {
1299 bufreq->size = enc_ops->scratch2(width, height, num_ref,
1300 is_tenbit);
1301 } else if (buftype == HFI_BUFFER_INTERNAL_PERSIST) {
1302 bufreq->size = enc_ops->persist();
1303 } else {
1304 return -EINVAL;
1305 }
1306
1307 return 0;
1308 }
1309
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH v7 02/28] mm: Introduce struct folio
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20210409]
[also build test ERROR on v5.12-rc6]
[cannot apply to linux/master linus/master hnaz-linux-mm/master v5.12-rc6 v5.12-rc5 v5.12-rc4]
[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]
url: https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/Memory-Fol...
base: e99d8a8495175df8cb8b739f8cf9b0fc9d0cd3b5
config: mips-gpr_defconfig (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/5658a201516d2ed74a34c328e3b55f552...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Memory-Folios/20210410-031353
git checkout 5658a201516d2ed74a34c328e3b55f552d4861d8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:6,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:53,
from arch/mips/include/asm/div64.h:12,
from include/linux/math64.h:7,
from include/linux/time.h:6,
from include/linux/compat.h:10,
from arch/mips/kernel/asm-offsets.c:12:
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, lru) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:274:1: note: in expansion of macro 'FOLIO_MATCH'
274 | FOLIO_MATCH(lru, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, compound_head) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:275:1: note: in expansion of macro 'FOLIO_MATCH'
275 | FOLIO_MATCH(compound_head, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, index) == offsetof(struct folio, index)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:276:1: note: in expansion of macro 'FOLIO_MATCH'
276 | FOLIO_MATCH(index, index);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, private) == offsetof(struct folio, private)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:277:1: note: in expansion of macro 'FOLIO_MATCH'
277 | FOLIO_MATCH(private, private);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _mapcount) == offsetof(struct folio, _mapcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:278:1: note: in expansion of macro 'FOLIO_MATCH'
278 | FOLIO_MATCH(_mapcount, _mapcount);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _refcount) == offsetof(struct folio, _refcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:279:1: note: in expansion of macro 'FOLIO_MATCH'
279 | FOLIO_MATCH(_refcount, _refcount);
| ^~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:26:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
26 | void output_ptreg_defines(void)
| ^~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:78:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
78 | void output_task_defines(void)
| ^~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:93:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
93 | void output_thread_info_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:109:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
109 | void output_thread_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:137:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
137 | void output_thread_fpu_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:180:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
180 | void output_mm_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:219:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
219 | void output_sc_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:254:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
254 | void output_signal_defined(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:347:6: warning: no previous prototype for 'output_kvm_defines' [-Wmissing-prototypes]
347 | void output_kvm_defines(void)
| ^~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:6,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:53,
from arch/mips/include/asm/div64.h:12,
from include/linux/math64.h:7,
from include/linux/time.h:6,
from include/linux/compat.h:10,
from arch/mips/kernel/asm-offsets.c:12:
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, lru) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:274:1: note: in expansion of macro 'FOLIO_MATCH'
274 | FOLIO_MATCH(lru, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, compound_head) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:275:1: note: in expansion of macro 'FOLIO_MATCH'
275 | FOLIO_MATCH(compound_head, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, index) == offsetof(struct folio, index)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:276:1: note: in expansion of macro 'FOLIO_MATCH'
276 | FOLIO_MATCH(index, index);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, private) == offsetof(struct folio, private)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:277:1: note: in expansion of macro 'FOLIO_MATCH'
277 | FOLIO_MATCH(private, private);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _mapcount) == offsetof(struct folio, _mapcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:278:1: note: in expansion of macro 'FOLIO_MATCH'
278 | FOLIO_MATCH(_mapcount, _mapcount);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _refcount) == offsetof(struct folio, _refcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:279:1: note: in expansion of macro 'FOLIO_MATCH'
279 | FOLIO_MATCH(_refcount, _refcount);
| ^~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:26:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
26 | void output_ptreg_defines(void)
| ^~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:78:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
78 | void output_task_defines(void)
| ^~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:93:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
93 | void output_thread_info_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:109:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
109 | void output_thread_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:137:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
137 | void output_thread_fpu_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:180:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
180 | void output_mm_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:219:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
219 | void output_sc_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:254:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
254 | void output_signal_defined(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:347:6: warning: no previous prototype for 'output_kvm_defines' [-Wmissing-prototypes]
347 | void output_kvm_defines(void)
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:118: arch/mips/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1304: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:222: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
error: no override and no default toolchain set
init/Kconfig:70:warning: 'RUSTC_VERSION': number is invalid
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:6,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:53,
from arch/mips/include/asm/div64.h:12,
from include/linux/math64.h:7,
from include/linux/time.h:6,
from include/linux/compat.h:10,
from arch/mips/kernel/asm-offsets.c:12:
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, lru) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:274:1: note: in expansion of macro 'FOLIO_MATCH'
274 | FOLIO_MATCH(lru, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, compound_head) == offsetof(struct folio, lru)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:275:1: note: in expansion of macro 'FOLIO_MATCH'
275 | FOLIO_MATCH(compound_head, lru);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, index) == offsetof(struct folio, index)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:276:1: note: in expansion of macro 'FOLIO_MATCH'
276 | FOLIO_MATCH(index, index);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, private) == offsetof(struct folio, private)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:277:1: note: in expansion of macro 'FOLIO_MATCH'
277 | FOLIO_MATCH(private, private);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _mapcount) == offsetof(struct folio, _mapcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:278:1: note: in expansion of macro 'FOLIO_MATCH'
278 | FOLIO_MATCH(_mapcount, _mapcount);
| ^~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct page, _refcount) == offsetof(struct folio, _refcount)"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/linux/mm_types.h:272:2: note: in expansion of macro 'static_assert'
272 | static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl))
| ^~~~~~~~~~~~~
include/linux/mm_types.h:279:1: note: in expansion of macro 'FOLIO_MATCH'
279 | FOLIO_MATCH(_refcount, _refcount);
| ^~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:26:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
26 | void output_ptreg_defines(void)
| ^~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:78:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
78 | void output_task_defines(void)
| ^~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:93:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
93 | void output_thread_info_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:109:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
109 | void output_thread_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:137:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
137 | void output_thread_fpu_defines(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:180:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
180 | void output_mm_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:219:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
219 | void output_sc_defines(void)
| ^~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:254:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
254 | void output_signal_defined(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/mips/kernel/asm-offsets.c:347:6: warning: no previous prototype for 'output_kvm_defines' [-Wmissing-prototypes]
347 | void output_kvm_defines(void)
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:118: arch/mips/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1304: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:222: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +78 include/linux/build_bug.h
bc6245e5efd70c Ian Abbott 2017-07-10 60
6bab69c65013be Rasmus Villemoes 2019-03-07 61 /**
6bab69c65013be Rasmus Villemoes 2019-03-07 62 * static_assert - check integer constant expression at build time
6bab69c65013be Rasmus Villemoes 2019-03-07 63 *
6bab69c65013be Rasmus Villemoes 2019-03-07 64 * static_assert() is a wrapper for the C11 _Static_assert, with a
6bab69c65013be Rasmus Villemoes 2019-03-07 65 * little macro magic to make the message optional (defaulting to the
6bab69c65013be Rasmus Villemoes 2019-03-07 66 * stringification of the tested expression).
6bab69c65013be Rasmus Villemoes 2019-03-07 67 *
6bab69c65013be Rasmus Villemoes 2019-03-07 68 * Contrary to BUILD_BUG_ON(), static_assert() can be used at global
6bab69c65013be Rasmus Villemoes 2019-03-07 69 * scope, but requires the expression to be an integer constant
6bab69c65013be Rasmus Villemoes 2019-03-07 70 * expression (i.e., it is not enough that __builtin_constant_p() is
6bab69c65013be Rasmus Villemoes 2019-03-07 71 * true for expr).
6bab69c65013be Rasmus Villemoes 2019-03-07 72 *
6bab69c65013be Rasmus Villemoes 2019-03-07 73 * Also note that BUILD_BUG_ON() fails the build if the condition is
6bab69c65013be Rasmus Villemoes 2019-03-07 74 * true, while static_assert() fails the build if the expression is
6bab69c65013be Rasmus Villemoes 2019-03-07 75 * false.
6bab69c65013be Rasmus Villemoes 2019-03-07 76 */
6bab69c65013be Rasmus Villemoes 2019-03-07 @77 #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
6bab69c65013be Rasmus Villemoes 2019-03-07 @78 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
6bab69c65013be Rasmus Villemoes 2019-03-07 79
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
[bvanassche:scsi-status 14/15] drivers/ide/ide-ioctls.c:141:30: error: used type 'struct scsi_status' where arithmetic or pointer type is required
by kernel test robot
tree: https://github.com/bvanassche/linux scsi-status
head: e3e8aaedcd689d1a2ae20024ed467d127bbe060a
commit: 87559dd4d6d375d2a9ac620763b0643fa80bd002 [14/15] Introduce struct scsi_status
config: mips-randconfig-r016-20210409 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project dd453a1389b6a7e6d9214b449d3c54981b1a89b6)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/bvanassche/linux/commit/87559dd4d6d375d2a9ac620763b064...
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche scsi-status
git checkout 87559dd4d6d375d2a9ac620763b0643fa80bd002
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/ide/ide-ioctls.c:141:30: error: used type 'struct scsi_status' where arithmetic or pointer type is required
err = scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
>> drivers/ide/ide-ioctls.c:239:6: error: assigning to 'int' from incompatible type 'struct scsi_status'
ret = scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
2 errors generated.
--
>> drivers/ide/ide-io.c:154:24: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = 0;
^ ~
drivers/ide/ide-io.c:157:25: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = IDE_DRV_ERROR_GENERAL;
^ ~~~~~~~~~~~~~~~~~~~~~
>> drivers/ide/ide-io.c:158:62: error: invalid operands to binary expression ('struct scsi_status' and 'int')
else if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result == 0)
~~~~~~~~~~~~~~~~~~~~ ^ ~
drivers/ide/ide-io.c:159:25: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = -EIO;
^ ~~~~
drivers/ide/ide-io.c:287:23: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = 0;
^ ~
5 errors generated.
--
>> drivers/ide/ide-taskfile.c:282:29: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(cmd->rq)->result = 0;
^ ~
>> drivers/ide/ide-taskfile.c:324:23: error: assigning to 'struct scsi_status' from incompatible type 'u8' (aka 'unsigned char')
scsi_req(rq)->result = err;
^ ~~~
>> drivers/ide/ide-taskfile.c:447:31: error: used type 'struct scsi_status' where arithmetic or pointer type is required
error = scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
--
>> drivers/ide/ide-pm.c:31:29: error: used type 'struct scsi_status' where arithmetic or pointer type is required
ret = scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
>> drivers/ide/ide-pm.c:49:24: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = -ENXIO;
^ ~~~~~~
drivers/ide/ide-pm.c:55:30: error: used type 'struct scsi_status' where arithmetic or pointer type is required
return scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
--
>> drivers/ide/ide-park.c:41:28: error: used type 'struct scsi_status' where arithmetic or pointer type is required
rc = scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
1 error generated.
--
>> drivers/ide/ide-devsets.c:177:6: error: assigning to 'int' from incompatible type 'struct scsi_status'
ret = scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
>> drivers/ide/ide-devsets.c:189:24: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = err;
^ ~~~
2 errors generated.
--
>> drivers/ide/ide-eh.c:16:24: error: invalid operands to binary expression ('struct scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
>> drivers/ide/ide-eh.c:29:25: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = ERROR_MAX;
^ ~~~~~~~~~
drivers/ide/ide-eh.c:32:25: error: invalid operands to binary expression ('struct scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RECAL;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:43:27: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if (scsi_req(rq)->result >= ERROR_MAX || blk_noretry_request(rq)) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
drivers/ide/ide-eh.c:49:24: error: invalid operands to binary expression ('struct scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:51:28: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
>> drivers/ide/ide-eh.c:52:3: error: cannot increment value of type 'struct scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:56:28: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RECAL) == ERROR_RECAL)
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:59:2: error: cannot increment value of type 'struct scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:72:24: error: invalid operands to binary expression ('struct scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:81:27: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if (scsi_req(rq)->result >= ERROR_MAX) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
drivers/ide/ide-eh.c:84:29: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:85:4: error: cannot increment value of type 'struct scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:88:3: error: cannot increment value of type 'struct scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:134:25: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = 1;
^ ~
>> drivers/ide/ide-eh.c:138:24: error: assigning to 'struct scsi_status' from incompatible type 'u8' (aka 'unsigned char')
scsi_req(rq)->result = err;
^ ~~~
drivers/ide/ide-eh.c:153:40: error: invalid operands to binary expression ('struct scsi_status' and 'int')
if (err <= 0 && scsi_req(rq)->result == 0)
~~~~~~~~~~~~~~~~~~~~ ^ ~
drivers/ide/ide-eh.c:154:25: error: assigning to 'struct scsi_status' from incompatible type 'int'
scsi_req(rq)->result = -EIO;
^ ~~~~
18 errors generated.
vim +141 drivers/ide/ide-ioctls.c
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 126
1df23c6fe5b065 Arnd Bergmann 2019-11-28 127 static int ide_cmd_ioctl(ide_drive_t *drive, void __user *argp)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 128 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 129 u8 *buf = NULL;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 130 int bufsize = 0, err = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 131 u8 args[4], xfer_rate = 0;
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 132 struct ide_cmd cmd;
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 133 struct ide_taskfile *tf = &cmd.tf;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 134
1df23c6fe5b065 Arnd Bergmann 2019-11-28 135 if (NULL == argp) {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 136 struct request *rq;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 137
ff005a066240ef Christoph Hellwig 2018-05-09 138 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
2f5a8e80f79dc8 Christoph Hellwig 2017-01-31 139 ide_req(rq)->type = ATA_PRIV_TASKFILE;
684da7628d93bb Guoqing Jiang 2021-01-25 140 blk_execute_rq(NULL, rq, 0);
17d5363b83f8c7 Christoph Hellwig 2017-04-20 @141 err = scsi_req(rq)->result ? -EIO : 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 142 blk_put_request(rq);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 143
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 144 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 145 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 146
1df23c6fe5b065 Arnd Bergmann 2019-11-28 147 if (copy_from_user(args, argp, 4))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 148 return -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 149
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 150 memset(&cmd, 0, sizeof(cmd));
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 151 tf->feature = args[2];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 152 if (args[0] == ATA_CMD_SMART) {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 153 tf->nsect = args[3];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 154 tf->lbal = args[1];
6fcf0497ffcc18 Xinghai Yu 2013-07-25 155 tf->lbam = ATA_SMART_LBAM_PASS;
6fcf0497ffcc18 Xinghai Yu 2013-07-25 156 tf->lbah = ATA_SMART_LBAH_PASS;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 157 cmd.valid.out.tf = IDE_VALID_OUT_TF;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 158 cmd.valid.in.tf = IDE_VALID_NSECT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 159 } else {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 160 tf->nsect = args[1];
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 161 cmd.valid.out.tf = IDE_VALID_FEATURE | IDE_VALID_NSECT;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 162 cmd.valid.in.tf = IDE_VALID_NSECT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 163 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 164 tf->command = args[0];
0dfb991c6943c8 Bartlomiej Zolnierkiewicz 2009-03-27 165 cmd.protocol = args[3] ? ATA_PROT_PIO : ATA_PROT_NODATA;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 166
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 167 if (args[3]) {
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 168 cmd.tf_flags |= IDE_TFLAG_IO_16BIT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 169 bufsize = SECTOR_SIZE * args[3];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 170 buf = kzalloc(bufsize, GFP_KERNEL);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 171 if (buf == NULL)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 172 return -ENOMEM;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 173 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 174
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 175 if (tf->command == ATA_CMD_SET_FEATURES &&
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 176 tf->feature == SETFEATURES_XFER &&
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 177 tf->nsect >= XFER_SW_DMA_0) {
28c1969ff887bc Hemant Pedanekar 2009-11-25 178 xfer_rate = ide_find_dma_mode(drive, tf->nsect);
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 179 if (xfer_rate != tf->nsect) {
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 180 err = -EINVAL;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 181 goto abort;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 182 }
665d66e8fad60a Bartlomiej Zolnierkiewicz 2009-06-23 183
665d66e8fad60a Bartlomiej Zolnierkiewicz 2009-06-23 184 cmd.tf_flags |= IDE_TFLAG_SET_XFER;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 185 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 186
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 187 err = ide_raw_taskfile(drive, &cmd, buf, args[3]);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 188
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 189 args[0] = tf->status;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 190 args[1] = tf->error;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 191 args[2] = tf->nsect;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 192 abort:
1df23c6fe5b065 Arnd Bergmann 2019-11-28 193 if (copy_to_user(argp, &args, 4))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 194 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 195 if (buf) {
1df23c6fe5b065 Arnd Bergmann 2019-11-28 196 if (copy_to_user((argp + 4), buf, bufsize))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 197 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 198 kfree(buf);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 199 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 200 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 201 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 202
1df23c6fe5b065 Arnd Bergmann 2019-11-28 203 static int ide_task_ioctl(ide_drive_t *drive, void __user *p)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 204 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 205 int err = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 206 u8 args[7];
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 207 struct ide_cmd cmd;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 208
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 209 if (copy_from_user(args, p, 7))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 210 return -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 211
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 212 memset(&cmd, 0, sizeof(cmd));
745483f10c6cef Sergei Shtylyov 2009-04-08 213 memcpy(&cmd.tf.feature, &args[1], 6);
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 214 cmd.tf.command = args[0];
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 215 cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 216 cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 217
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 218 err = ide_no_data_taskfile(drive, &cmd);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 219
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 220 args[0] = cmd.tf.command;
745483f10c6cef Sergei Shtylyov 2009-04-08 221 memcpy(&args[1], &cmd.tf.feature, 6);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 222
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 223 if (copy_to_user(p, args, 7))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 224 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 225
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 226 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 227 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 228
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 229 static int generic_drive_reset(ide_drive_t *drive)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 230 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 231 struct request *rq;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 232 int ret = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 233
ff005a066240ef Christoph Hellwig 2018-05-09 234 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
2f5a8e80f79dc8 Christoph Hellwig 2017-01-31 235 ide_req(rq)->type = ATA_PRIV_MISC;
82ed4db499b859 Christoph Hellwig 2017-01-27 236 scsi_req(rq)->cmd_len = 1;
82ed4db499b859 Christoph Hellwig 2017-01-27 237 scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET;
684da7628d93bb Guoqing Jiang 2021-01-25 238 blk_execute_rq(NULL, rq, 1);
17d5363b83f8c7 Christoph Hellwig 2017-04-20 @239 ret = scsi_req(rq)->result;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 240 blk_put_request(rq);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 241 return ret;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 242 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 243
:::::: The code at line 141 was first introduced by commit
:::::: 17d5363b83f8c73ef9109f75a4a9b578f31d842f scsi: introduce a result field in struct scsi_request
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Jens Axboe <axboe(a)fb.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months