[linux-next:master 6222/14131] drivers/usb/chipidea/udc.c:477:26: sparse: sparse: bad assignment (+=) to restricted __le32
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: e48aa1eb443f80fc6953734c805add4fb694b835 [6222/14131] usb: chipidea: udc: add software sg list support
:::::: branch date: 4 days ago
:::::: commit date: 4 weeks ago
config: nios2-randconfig-s032-20200602 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout e48aa1eb443f80fc6953734c805add4fb694b835
# save the attached .config to linux build tree
make W=1 C=1 ARCH=nios2 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/usb/chipidea/udc.c:477:26: sparse: sparse: bad assignment (+=) to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout e48aa1eb443f80fc6953734c805add4fb694b835
vim +477 drivers/usb/chipidea/udc.c
e48aa1eb443f80 Peter Chen 2020-02-21 470
e48aa1eb443f80 Peter Chen 2020-02-21 471 static void ci_add_buffer_entry(struct td_node *node, struct scatterlist *s)
e48aa1eb443f80 Peter Chen 2020-02-21 472 {
e48aa1eb443f80 Peter Chen 2020-02-21 473 int empty_td_slot_index = (CI_MAX_BUF_SIZE - node->td_remaining_size)
e48aa1eb443f80 Peter Chen 2020-02-21 474 / CI_HDRC_PAGE_SIZE;
e48aa1eb443f80 Peter Chen 2020-02-21 475 int i;
e48aa1eb443f80 Peter Chen 2020-02-21 476
e48aa1eb443f80 Peter Chen 2020-02-21 @477 node->ptr->token +=
e48aa1eb443f80 Peter Chen 2020-02-21 478 cpu_to_le32(sg_dma_len(s) << __ffs(TD_TOTAL_BYTES));
e48aa1eb443f80 Peter Chen 2020-02-21 479
e48aa1eb443f80 Peter Chen 2020-02-21 480 for (i = empty_td_slot_index; i < TD_PAGE_COUNT; i++) {
e48aa1eb443f80 Peter Chen 2020-02-21 481 u32 page = (u32) sg_dma_address(s) +
e48aa1eb443f80 Peter Chen 2020-02-21 482 (i - empty_td_slot_index) * CI_HDRC_PAGE_SIZE;
e48aa1eb443f80 Peter Chen 2020-02-21 483
e48aa1eb443f80 Peter Chen 2020-02-21 484 page &= ~TD_RESERVED_MASK;
e48aa1eb443f80 Peter Chen 2020-02-21 485 node->ptr->page[i] = cpu_to_le32(page);
e48aa1eb443f80 Peter Chen 2020-02-21 486 }
e48aa1eb443f80 Peter Chen 2020-02-21 487 }
e48aa1eb443f80 Peter Chen 2020-02-21 488
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
drivers/net/macsec.c:430:22: sparse: expected restricted ssci_t [usertype] ssci
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f359287765c04711ff54fbd11645271d8e5ff763
commit: a21ecf0e033807b976967286e6c392f48ee2049f macsec: Support XPN frame handling - IEEE 802.1AEbw
date: 3 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago
config: nios2-randconfig-s032-20200602 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout a21ecf0e033807b976967286e6c392f48ee2049f
# save the attached .config to linux build tree
make W=1 C=1 ARCH=nios2 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/macsec.c:430:24: sparse: sparse: restricted ssci_t degrades to integer
drivers/net/macsec.c:430:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted ssci_t [usertype] ssci @@ got unsigned int @@
>> drivers/net/macsec.c:430:22: sparse: expected restricted ssci_t [usertype] ssci
>> drivers/net/macsec.c:430:22: sparse: got unsigned int
drivers/net/macsec.c:431:22: sparse: sparse: restricted __be64 degrades to integer
drivers/net/macsec.c:431:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] pn @@ got unsigned long long @@
>> drivers/net/macsec.c:431:20: sparse: expected restricted __be64 [usertype] pn
>> drivers/net/macsec.c:431:20: sparse: got unsigned long long
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: undefined identifier '__builtin_rdctl'
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: undefined identifier '__builtin_wrctl'
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:21:9: sparse: sparse: not a function <noident>
arch/nios2/include/asm/irqflags.h:12:16: sparse: sparse: not a function <noident>
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout a21ecf0e033807b976967286e6c392f48ee2049f
vim +430 drivers/net/macsec.c
c09440f7dcb304 Sabrina Dubroca 2016-03-11 424
a21ecf0e033807 Era Mayflower 2020-03-09 425 static void macsec_fill_iv_xpn(unsigned char *iv, ssci_t ssci, u64 pn,
a21ecf0e033807 Era Mayflower 2020-03-09 426 salt_t salt)
a21ecf0e033807 Era Mayflower 2020-03-09 427 {
a21ecf0e033807 Era Mayflower 2020-03-09 428 struct gcm_iv_xpn *gcm_iv = (struct gcm_iv_xpn *)iv;
a21ecf0e033807 Era Mayflower 2020-03-09 429
a21ecf0e033807 Era Mayflower 2020-03-09 @430 gcm_iv->ssci = ssci ^ salt.ssci;
a21ecf0e033807 Era Mayflower 2020-03-09 @431 gcm_iv->pn = cpu_to_be64(pn) ^ salt.pn;
a21ecf0e033807 Era Mayflower 2020-03-09 432 }
a21ecf0e033807 Era Mayflower 2020-03-09 433
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 5169/14131] drivers/firmware/efi/libstub/efi-stub-helper.c:390:44: sparse: expected unsigned short const [usertype] *optstr
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: f61900fd0ebf6c6b91719d63272a54f4d11051df [5169/14131] efi/libstub: Unify initrd loading across architectures
:::::: branch date: 3 days ago
:::::: commit date: 5 weeks ago
config: i386-randconfig-s031-20200601 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout f61900fd0ebf6c6b91719d63272a54f4d11051df
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/firmware/efi/libstub/efi-stub-helper.c:390:44: sparse: sparse: incorrect type in argument 2 (different type sizes) @@ expected unsigned short const [usertype] *optstr @@ got char * @@
>> drivers/firmware/efi/libstub/efi-stub-helper.c:390:44: sparse: expected unsigned short const [usertype] *optstr
>> drivers/firmware/efi/libstub/efi-stub-helper.c:390:44: sparse: got char *
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout f61900fd0ebf6c6b91719d63272a54f4d11051df
vim +390 drivers/firmware/efi/libstub/efi-stub-helper.c
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 376
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 377 static
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 378 efi_status_t efi_load_initrd_cmdline(efi_loaded_image_t *image,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 379 unsigned long *load_addr,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 380 unsigned long *load_size,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 381 unsigned long soft_limit,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 382 unsigned long hard_limit)
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 383 {
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 384 if (!IS_ENABLED(CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER) ||
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 385 (IS_ENABLED(CONFIG_X86) && (!efi_is_native() || image == NULL))) {
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 386 *load_addr = *load_size = 0;
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 387 return EFI_SUCCESS;
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 388 }
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 389
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 @390 return handle_cmdline_files(image, L"initrd=", sizeof(L"initrd=") - 2,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 391 soft_limit, hard_limit,
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 392 load_addr, load_size);
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 393 }
f61900fd0ebf6c6 Arvind Sankar 2020-04-30 394
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 4817/14131] drivers/net/ethernet/broadcom/genet/bcmgenet.c:688:24: sparse: got restricted __be16 [usertype]
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 3e370952287c55e5fd240cb8bb41ef8acff8829d [4817/14131] net: bcmgenet: add support for ethtool rxnfc flows
:::::: branch date: 3 days ago
:::::: commit date: 5 weeks ago
config: i386-randconfig-s001-20200601 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 3e370952287c55e5fd240cb8bb41ef8acff8829d
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/broadcom/genet/bcmgenet.c:688:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] val_16 @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/broadcom/genet/bcmgenet.c:688:24: sparse: expected unsigned short [usertype] val_16
>> drivers/net/ethernet/broadcom/genet/bcmgenet.c:688:24: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/broadcom/genet/bcmgenet.c:782:5: sparse: sparse: symbol 'bcmgenet_hfb_add_filter' was not declared. Should it be static?
include/linux/netdevice.h:4052:20: sparse: sparse: shift count is negative (-1)
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 3e370952287c55e5fd240cb8bb41ef8acff8829d
vim +688 drivers/net/ethernet/broadcom/genet/bcmgenet.c
3e370952287c55 Doug Berger 2020-04-29 631
3e370952287c55 Doug Berger 2020-04-29 632 static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv,
3e370952287c55 Doug Berger 2020-04-29 633 struct bcmgenet_rxnfc_rule *rule)
3e370952287c55 Doug Berger 2020-04-29 634 {
3e370952287c55 Doug Berger 2020-04-29 635 struct ethtool_rx_flow_spec *fs = &rule->fs;
3e370952287c55 Doug Berger 2020-04-29 636 int err = 0, offset = 0, f_length = 0;
3e370952287c55 Doug Berger 2020-04-29 637 u16 val_16, mask_16;
3e370952287c55 Doug Berger 2020-04-29 638 u8 val_8, mask_8;
3e370952287c55 Doug Berger 2020-04-29 639 size_t size;
3e370952287c55 Doug Berger 2020-04-29 640 u32 *f_data;
3e370952287c55 Doug Berger 2020-04-29 641
3e370952287c55 Doug Berger 2020-04-29 642 f_data = kcalloc(priv->hw_params->hfb_filter_size, sizeof(u32),
3e370952287c55 Doug Berger 2020-04-29 643 GFP_KERNEL);
3e370952287c55 Doug Berger 2020-04-29 644 if (!f_data)
3e370952287c55 Doug Berger 2020-04-29 645 return -ENOMEM;
3e370952287c55 Doug Berger 2020-04-29 646
3e370952287c55 Doug Berger 2020-04-29 647 if (fs->flow_type & FLOW_MAC_EXT) {
3e370952287c55 Doug Berger 2020-04-29 648 bcmgenet_hfb_insert_data(f_data, 0,
3e370952287c55 Doug Berger 2020-04-29 649 &fs->h_ext.h_dest, &fs->m_ext.h_dest,
3e370952287c55 Doug Berger 2020-04-29 650 sizeof(fs->h_ext.h_dest));
3e370952287c55 Doug Berger 2020-04-29 651 }
3e370952287c55 Doug Berger 2020-04-29 652
3e370952287c55 Doug Berger 2020-04-29 653 if (fs->flow_type & FLOW_EXT) {
3e370952287c55 Doug Berger 2020-04-29 654 if (fs->m_ext.vlan_etype ||
3e370952287c55 Doug Berger 2020-04-29 655 fs->m_ext.vlan_tci) {
3e370952287c55 Doug Berger 2020-04-29 656 bcmgenet_hfb_insert_data(f_data, 12,
3e370952287c55 Doug Berger 2020-04-29 657 &fs->h_ext.vlan_etype,
3e370952287c55 Doug Berger 2020-04-29 658 &fs->m_ext.vlan_etype,
3e370952287c55 Doug Berger 2020-04-29 659 sizeof(fs->h_ext.vlan_etype));
3e370952287c55 Doug Berger 2020-04-29 660 bcmgenet_hfb_insert_data(f_data, 14,
3e370952287c55 Doug Berger 2020-04-29 661 &fs->h_ext.vlan_tci,
3e370952287c55 Doug Berger 2020-04-29 662 &fs->m_ext.vlan_tci,
3e370952287c55 Doug Berger 2020-04-29 663 sizeof(fs->h_ext.vlan_tci));
3e370952287c55 Doug Berger 2020-04-29 664 offset += VLAN_HLEN;
3e370952287c55 Doug Berger 2020-04-29 665 f_length += DIV_ROUND_UP(VLAN_HLEN, 2);
3e370952287c55 Doug Berger 2020-04-29 666 }
3e370952287c55 Doug Berger 2020-04-29 667 }
3e370952287c55 Doug Berger 2020-04-29 668
3e370952287c55 Doug Berger 2020-04-29 669 switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
3e370952287c55 Doug Berger 2020-04-29 670 case ETHER_FLOW:
3e370952287c55 Doug Berger 2020-04-29 671 f_length += DIV_ROUND_UP(ETH_HLEN, 2);
3e370952287c55 Doug Berger 2020-04-29 672 bcmgenet_hfb_insert_data(f_data, 0,
3e370952287c55 Doug Berger 2020-04-29 673 &fs->h_u.ether_spec.h_dest,
3e370952287c55 Doug Berger 2020-04-29 674 &fs->m_u.ether_spec.h_dest,
3e370952287c55 Doug Berger 2020-04-29 675 sizeof(fs->h_u.ether_spec.h_dest));
3e370952287c55 Doug Berger 2020-04-29 676 bcmgenet_hfb_insert_data(f_data, ETH_ALEN,
3e370952287c55 Doug Berger 2020-04-29 677 &fs->h_u.ether_spec.h_source,
3e370952287c55 Doug Berger 2020-04-29 678 &fs->m_u.ether_spec.h_source,
3e370952287c55 Doug Berger 2020-04-29 679 sizeof(fs->h_u.ether_spec.h_source));
3e370952287c55 Doug Berger 2020-04-29 680 bcmgenet_hfb_insert_data(f_data, (2 * ETH_ALEN) + offset,
3e370952287c55 Doug Berger 2020-04-29 681 &fs->h_u.ether_spec.h_proto,
3e370952287c55 Doug Berger 2020-04-29 682 &fs->m_u.ether_spec.h_proto,
3e370952287c55 Doug Berger 2020-04-29 683 sizeof(fs->h_u.ether_spec.h_proto));
3e370952287c55 Doug Berger 2020-04-29 684 break;
3e370952287c55 Doug Berger 2020-04-29 685 case IP_USER_FLOW:
3e370952287c55 Doug Berger 2020-04-29 686 f_length += DIV_ROUND_UP(ETH_HLEN + 20, 2);
3e370952287c55 Doug Berger 2020-04-29 687 /* Specify IP Ether Type */
3e370952287c55 Doug Berger 2020-04-29 @688 val_16 = htons(ETH_P_IP);
3e370952287c55 Doug Berger 2020-04-29 689 mask_16 = 0xFFFF;
3e370952287c55 Doug Berger 2020-04-29 690 bcmgenet_hfb_insert_data(f_data, (2 * ETH_ALEN) + offset,
3e370952287c55 Doug Berger 2020-04-29 691 &val_16, &mask_16, sizeof(val_16));
3e370952287c55 Doug Berger 2020-04-29 692 bcmgenet_hfb_insert_data(f_data, 15 + offset,
3e370952287c55 Doug Berger 2020-04-29 693 &fs->h_u.usr_ip4_spec.tos,
3e370952287c55 Doug Berger 2020-04-29 694 &fs->m_u.usr_ip4_spec.tos,
3e370952287c55 Doug Berger 2020-04-29 695 sizeof(fs->h_u.usr_ip4_spec.tos));
3e370952287c55 Doug Berger 2020-04-29 696 bcmgenet_hfb_insert_data(f_data, 23 + offset,
3e370952287c55 Doug Berger 2020-04-29 697 &fs->h_u.usr_ip4_spec.proto,
3e370952287c55 Doug Berger 2020-04-29 698 &fs->m_u.usr_ip4_spec.proto,
3e370952287c55 Doug Berger 2020-04-29 699 sizeof(fs->h_u.usr_ip4_spec.proto));
3e370952287c55 Doug Berger 2020-04-29 700 bcmgenet_hfb_insert_data(f_data, 26 + offset,
3e370952287c55 Doug Berger 2020-04-29 701 &fs->h_u.usr_ip4_spec.ip4src,
3e370952287c55 Doug Berger 2020-04-29 702 &fs->m_u.usr_ip4_spec.ip4src,
3e370952287c55 Doug Berger 2020-04-29 703 sizeof(fs->h_u.usr_ip4_spec.ip4src));
3e370952287c55 Doug Berger 2020-04-29 704 bcmgenet_hfb_insert_data(f_data, 30 + offset,
3e370952287c55 Doug Berger 2020-04-29 705 &fs->h_u.usr_ip4_spec.ip4dst,
3e370952287c55 Doug Berger 2020-04-29 706 &fs->m_u.usr_ip4_spec.ip4dst,
3e370952287c55 Doug Berger 2020-04-29 707 sizeof(fs->h_u.usr_ip4_spec.ip4dst));
3e370952287c55 Doug Berger 2020-04-29 708 if (!fs->m_u.usr_ip4_spec.l4_4_bytes)
3e370952287c55 Doug Berger 2020-04-29 709 break;
3e370952287c55 Doug Berger 2020-04-29 710
3e370952287c55 Doug Berger 2020-04-29 711 /* Only supports 20 byte IPv4 header */
3e370952287c55 Doug Berger 2020-04-29 712 val_8 = 0x45;
3e370952287c55 Doug Berger 2020-04-29 713 mask_8 = 0xFF;
3e370952287c55 Doug Berger 2020-04-29 714 bcmgenet_hfb_insert_data(f_data, ETH_HLEN + offset,
3e370952287c55 Doug Berger 2020-04-29 715 &val_8, &mask_8,
3e370952287c55 Doug Berger 2020-04-29 716 sizeof(val_8));
3e370952287c55 Doug Berger 2020-04-29 717 size = sizeof(fs->h_u.usr_ip4_spec.l4_4_bytes);
3e370952287c55 Doug Berger 2020-04-29 718 bcmgenet_hfb_insert_data(f_data,
3e370952287c55 Doug Berger 2020-04-29 719 ETH_HLEN + 20 + offset,
3e370952287c55 Doug Berger 2020-04-29 720 &fs->h_u.usr_ip4_spec.l4_4_bytes,
3e370952287c55 Doug Berger 2020-04-29 721 &fs->m_u.usr_ip4_spec.l4_4_bytes,
3e370952287c55 Doug Berger 2020-04-29 722 size);
3e370952287c55 Doug Berger 2020-04-29 723 f_length += DIV_ROUND_UP(size, 2);
3e370952287c55 Doug Berger 2020-04-29 724 break;
3e370952287c55 Doug Berger 2020-04-29 725 }
3e370952287c55 Doug Berger 2020-04-29 726
3e370952287c55 Doug Berger 2020-04-29 727 if (!fs->ring_cookie) {
3e370952287c55 Doug Berger 2020-04-29 728 /* Ring 0 flows can be handled by the default Descriptor Ring
3e370952287c55 Doug Berger 2020-04-29 729 * We'll map them to ring 0, but don't enable the filter
3e370952287c55 Doug Berger 2020-04-29 730 */
3e370952287c55 Doug Berger 2020-04-29 731 bcmgenet_hfb_set_filter(priv, f_data, f_length, 0,
3e370952287c55 Doug Berger 2020-04-29 732 fs->location);
3e370952287c55 Doug Berger 2020-04-29 733 rule->state = BCMGENET_RXNFC_STATE_DISABLED;
3e370952287c55 Doug Berger 2020-04-29 734 } else {
3e370952287c55 Doug Berger 2020-04-29 735 /* Other Rx rings are direct mapped here */
3e370952287c55 Doug Berger 2020-04-29 736 bcmgenet_hfb_set_filter(priv, f_data, f_length,
3e370952287c55 Doug Berger 2020-04-29 737 fs->ring_cookie, fs->location);
3e370952287c55 Doug Berger 2020-04-29 738 bcmgenet_hfb_enable_filter(priv, fs->location);
3e370952287c55 Doug Berger 2020-04-29 739 rule->state = BCMGENET_RXNFC_STATE_ENABLED;
3e370952287c55 Doug Berger 2020-04-29 740 }
3e370952287c55 Doug Berger 2020-04-29 741
3e370952287c55 Doug Berger 2020-04-29 742 kfree(f_data);
3e370952287c55 Doug Berger 2020-04-29 743
3e370952287c55 Doug Berger 2020-04-29 744 return err;
3e370952287c55 Doug Berger 2020-04-29 745 }
3e370952287c55 Doug Berger 2020-04-29 746
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 3942/14131] net/core/neighbour.c:3460:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec( ... )
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 32927393dc1ccd60fb2bdc05b9e8e88753761469 [3942/14131] sysctl: pass kernel pointers to ->proc_handler
:::::: branch date: 3 days ago
:::::: commit date: 5 weeks ago
config: i386-randconfig-s002-20200601 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 32927393dc1ccd60fb2bdc05b9e8e88753761469
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
net/core/neighbour.c:3460:5: sparse: sparse: symbol 'neigh_proc_dointvec' redeclared with different type (incompatible argument 3 (different address spaces)):
>> net/core/neighbour.c:3460:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec( ... )
>> include/net/neighbour.h:394:5: sparse: note: previously declared as:
include/net/neighbour.h:394:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec( ... )
net/core/neighbour.c:3470:5: sparse: sparse: symbol 'neigh_proc_dointvec_jiffies' redeclared with different type (incompatible argument 3 (different address spaces)):
>> net/core/neighbour.c:3470:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec_jiffies( ... )
include/net/neighbour.h:396:5: sparse: note: previously declared as:
>> include/net/neighbour.h:396:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec_jiffies( ... )
net/core/neighbour.c:3490:5: sparse: sparse: symbol 'neigh_proc_dointvec_ms_jiffies' redeclared with different type (incompatible argument 3 (different address spaces)):
net/core/neighbour.c:3490:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec_ms_jiffies( ... )
include/net/neighbour.h:399:5: sparse: note: previously declared as:
include/net/neighbour.h:399:5: sparse: int extern [addressable] [signed] [toplevel] neigh_proc_dointvec_ms_jiffies( ... )
net/core/neighbour.c:348:12: sparse: sparse: context imbalance in '__neigh_ifdown' - wrong count at exit
net/core/neighbour.c:803:9: sparse: sparse: context imbalance in 'pneigh_ifdown_and_unlock' - unexpected unlock
--
drivers/char/random.c:2100:50: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void * @@ got void [noderef] <asn:1> *buffer @@
>> drivers/char/random.c:2100:50: sparse: expected void *
drivers/char/random.c:2100:50: sparse: got void [noderef] <asn:1> *buffer
drivers/char/random.c:2117:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
drivers/char/random.c:2117:35: sparse: expected int ( [usertype] *proc_handler )( ... )
>> drivers/char/random.c:2117:35: sparse: got int ( * )( ... )
--
net/ipv6/ndisc.c:1850:55: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void [noderef] <asn:1> *buffer @@ got void *buffer @@
>> net/ipv6/ndisc.c:1850:55: sparse: expected void [noderef] <asn:1> *buffer
net/ipv6/ndisc.c:1850:55: sparse: got void *buffer
net/ipv6/ndisc.c:1854:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void [noderef] <asn:1> *buffer @@ got void *buffer @@
net/ipv6/ndisc.c:1854:51: sparse: expected void [noderef] <asn:1> *buffer
net/ipv6/ndisc.c:1854:51: sparse: got void *buffer
net/ipv6/ndisc.c:1859:54: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void [noderef] <asn:1> *buffer @@ got void *buffer @@
net/ipv6/ndisc.c:1859:54: sparse: expected void [noderef] <asn:1> *buffer
net/ipv6/ndisc.c:1859:54: sparse: got void *buffer
net/ipv6/ndisc.c:1838:5: sparse: sparse: symbol 'ndisc_ifinfo_sysctl_change' redeclared with different type (incompatible argument 3 (different address spaces)):
net/ipv6/ndisc.c:1838:5: sparse: int extern [addressable] [signed] [toplevel] ndisc_ifinfo_sysctl_change( ... )
include/net/ndisc.h:496:5: sparse: note: previously declared as:
include/net/ndisc.h:496:5: sparse: int extern [addressable] [signed] [toplevel] ndisc_ifinfo_sysctl_change( ... )
include/net/addrconf.h:478:36: sparse: sparse: restricted __be32 degrades to integer
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 32927393dc1ccd60fb2bdc05b9e8e88753761469
vim +3460 net/core/neighbour.c
1f9248e5606afc Jiri Pirko 2013-12-07 3459
32927393dc1ccd Christoph Hellwig 2020-04-24 @3460 int neigh_proc_dointvec(struct ctl_table *ctl, int write, void *buffer,
32927393dc1ccd Christoph Hellwig 2020-04-24 3461 size_t *lenp, loff_t *ppos)
cb5b09c17fe600 Jiri Pirko 2013-12-07 3462 {
1d4c8c29841b99 Jiri Pirko 2013-12-07 3463 int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
1d4c8c29841b99 Jiri Pirko 2013-12-07 3464
1d4c8c29841b99 Jiri Pirko 2013-12-07 3465 neigh_proc_update(ctl, write);
1d4c8c29841b99 Jiri Pirko 2013-12-07 3466 return ret;
cb5b09c17fe600 Jiri Pirko 2013-12-07 3467 }
cb5b09c17fe600 Jiri Pirko 2013-12-07 3468 EXPORT_SYMBOL(neigh_proc_dointvec);
cb5b09c17fe600 Jiri Pirko 2013-12-07 3469
32927393dc1ccd Christoph Hellwig 2020-04-24 @3470 int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, void *buffer,
cb5b09c17fe600 Jiri Pirko 2013-12-07 3471 size_t *lenp, loff_t *ppos)
cb5b09c17fe600 Jiri Pirko 2013-12-07 3472 {
1d4c8c29841b99 Jiri Pirko 2013-12-07 3473 int ret = proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos);
1d4c8c29841b99 Jiri Pirko 2013-12-07 3474
1d4c8c29841b99 Jiri Pirko 2013-12-07 3475 neigh_proc_update(ctl, write);
1d4c8c29841b99 Jiri Pirko 2013-12-07 3476 return ret;
cb5b09c17fe600 Jiri Pirko 2013-12-07 3477 }
cb5b09c17fe600 Jiri Pirko 2013-12-07 3478 EXPORT_SYMBOL(neigh_proc_dointvec_jiffies);
cb5b09c17fe600 Jiri Pirko 2013-12-07 3479
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 2996/14131] sound/soc/fsl/fsl_asrc.c:1050:60: sparse: got restricted snd_pcm_format_t *
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 4520af41fd21863d026d53c7e1eb987509cb3c24 [2996/14131] ASoC: fsl_asrc: Support new property fsl,asrc-format
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago
config: openrisc-randconfig-s031-20200601 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 4520af41fd21863d026d53c7e1eb987509cb3c24
# save the attached .config to linux build tree
make W=1 C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
sound/soc/fsl/fsl_asrc.c:1050:60: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] *out_value @@ got restricted snd_pcm_format_t * @@
sound/soc/fsl/fsl_asrc.c:1050:60: sparse: expected unsigned int [usertype] *out_value
>> sound/soc/fsl/fsl_asrc.c:1050:60: sparse: got restricted snd_pcm_format_t *
sound/soc/fsl/fsl_asrc.c:1073:47: sparse: sparse: restricted snd_pcm_format_t degrades to integer
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 4520af41fd21863d026d53c7e1eb987509cb3c24
vim +1050 sound/soc/fsl/fsl_asrc.c
3117bb3109dc22 Nicolin Chen 2014-07-29 933
3117bb3109dc22 Nicolin Chen 2014-07-29 934 static int fsl_asrc_probe(struct platform_device *pdev)
3117bb3109dc22 Nicolin Chen 2014-07-29 935 {
3117bb3109dc22 Nicolin Chen 2014-07-29 936 struct device_node *np = pdev->dev.of_node;
7470704d8b425c Shengjiu Wang 2020-04-16 937 struct fsl_asrc *asrc;
3117bb3109dc22 Nicolin Chen 2014-07-29 938 struct resource *res;
3117bb3109dc22 Nicolin Chen 2014-07-29 939 void __iomem *regs;
3117bb3109dc22 Nicolin Chen 2014-07-29 940 int irq, ret, i;
c05f10f28ef697 Shengjiu Wang 2019-12-04 941 u32 map_idx;
3117bb3109dc22 Nicolin Chen 2014-07-29 942 char tmp[16];
4520af41fd2186 Shengjiu Wang 2020-04-16 943 u32 width;
3117bb3109dc22 Nicolin Chen 2014-07-29 944
7470704d8b425c Shengjiu Wang 2020-04-16 945 asrc = devm_kzalloc(&pdev->dev, sizeof(*asrc), GFP_KERNEL);
7470704d8b425c Shengjiu Wang 2020-04-16 946 if (!asrc)
3117bb3109dc22 Nicolin Chen 2014-07-29 947 return -ENOMEM;
3117bb3109dc22 Nicolin Chen 2014-07-29 948
7470704d8b425c Shengjiu Wang 2020-04-16 949 asrc->pdev = pdev;
3117bb3109dc22 Nicolin Chen 2014-07-29 950
3117bb3109dc22 Nicolin Chen 2014-07-29 951 /* Get the addresses and IRQ */
3117bb3109dc22 Nicolin Chen 2014-07-29 952 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
3117bb3109dc22 Nicolin Chen 2014-07-29 953 regs = devm_ioremap_resource(&pdev->dev, res);
3117bb3109dc22 Nicolin Chen 2014-07-29 954 if (IS_ERR(regs))
3117bb3109dc22 Nicolin Chen 2014-07-29 955 return PTR_ERR(regs);
3117bb3109dc22 Nicolin Chen 2014-07-29 956
7470704d8b425c Shengjiu Wang 2020-04-16 957 asrc->paddr = res->start;
3117bb3109dc22 Nicolin Chen 2014-07-29 958
7470704d8b425c Shengjiu Wang 2020-04-16 959 asrc->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "mem", regs,
3117bb3109dc22 Nicolin Chen 2014-07-29 960 &fsl_asrc_regmap_config);
7470704d8b425c Shengjiu Wang 2020-04-16 961 if (IS_ERR(asrc->regmap)) {
3117bb3109dc22 Nicolin Chen 2014-07-29 962 dev_err(&pdev->dev, "failed to init regmap\n");
7470704d8b425c Shengjiu Wang 2020-04-16 963 return PTR_ERR(asrc->regmap);
3117bb3109dc22 Nicolin Chen 2014-07-29 964 }
3117bb3109dc22 Nicolin Chen 2014-07-29 965
3117bb3109dc22 Nicolin Chen 2014-07-29 966 irq = platform_get_irq(pdev, 0);
cf9441adb1a355 Stephen Boyd 2019-07-30 967 if (irq < 0)
3117bb3109dc22 Nicolin Chen 2014-07-29 968 return irq;
3117bb3109dc22 Nicolin Chen 2014-07-29 969
3117bb3109dc22 Nicolin Chen 2014-07-29 970 ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
7470704d8b425c Shengjiu Wang 2020-04-16 971 dev_name(&pdev->dev), asrc);
3117bb3109dc22 Nicolin Chen 2014-07-29 972 if (ret) {
3117bb3109dc22 Nicolin Chen 2014-07-29 973 dev_err(&pdev->dev, "failed to claim irq %u: %d\n", irq, ret);
3117bb3109dc22 Nicolin Chen 2014-07-29 974 return ret;
3117bb3109dc22 Nicolin Chen 2014-07-29 975 }
3117bb3109dc22 Nicolin Chen 2014-07-29 976
7470704d8b425c Shengjiu Wang 2020-04-16 977 asrc->mem_clk = devm_clk_get(&pdev->dev, "mem");
7470704d8b425c Shengjiu Wang 2020-04-16 978 if (IS_ERR(asrc->mem_clk)) {
3117bb3109dc22 Nicolin Chen 2014-07-29 979 dev_err(&pdev->dev, "failed to get mem clock\n");
7470704d8b425c Shengjiu Wang 2020-04-16 980 return PTR_ERR(asrc->mem_clk);
3117bb3109dc22 Nicolin Chen 2014-07-29 981 }
3117bb3109dc22 Nicolin Chen 2014-07-29 982
7470704d8b425c Shengjiu Wang 2020-04-16 983 asrc->ipg_clk = devm_clk_get(&pdev->dev, "ipg");
7470704d8b425c Shengjiu Wang 2020-04-16 984 if (IS_ERR(asrc->ipg_clk)) {
3117bb3109dc22 Nicolin Chen 2014-07-29 985 dev_err(&pdev->dev, "failed to get ipg clock\n");
7470704d8b425c Shengjiu Wang 2020-04-16 986 return PTR_ERR(asrc->ipg_clk);
3117bb3109dc22 Nicolin Chen 2014-07-29 987 }
3117bb3109dc22 Nicolin Chen 2014-07-29 988
7470704d8b425c Shengjiu Wang 2020-04-16 989 asrc->spba_clk = devm_clk_get(&pdev->dev, "spba");
7470704d8b425c Shengjiu Wang 2020-04-16 990 if (IS_ERR(asrc->spba_clk))
13b8a97a760eee Shengjiu Wang 2015-11-24 991 dev_warn(&pdev->dev, "failed to get spba clock\n");
13b8a97a760eee Shengjiu Wang 2015-11-24 992
3117bb3109dc22 Nicolin Chen 2014-07-29 993 for (i = 0; i < ASRC_CLK_MAX_NUM; i++) {
3117bb3109dc22 Nicolin Chen 2014-07-29 994 sprintf(tmp, "asrck_%x", i);
7470704d8b425c Shengjiu Wang 2020-04-16 995 asrc->asrck_clk[i] = devm_clk_get(&pdev->dev, tmp);
7470704d8b425c Shengjiu Wang 2020-04-16 996 if (IS_ERR(asrc->asrck_clk[i])) {
3117bb3109dc22 Nicolin Chen 2014-07-29 997 dev_err(&pdev->dev, "failed to get %s clock\n", tmp);
7470704d8b425c Shengjiu Wang 2020-04-16 998 return PTR_ERR(asrc->asrck_clk[i]);
3117bb3109dc22 Nicolin Chen 2014-07-29 999 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1000 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1001
7470704d8b425c Shengjiu Wang 2020-04-16 1002 asrc->soc = of_device_get_match_data(&pdev->dev);
7470704d8b425c Shengjiu Wang 2020-04-16 1003 if (!asrc->soc) {
c05f10f28ef697 Shengjiu Wang 2019-12-04 1004 dev_err(&pdev->dev, "failed to get soc data\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04 1005 return -ENODEV;
c05f10f28ef697 Shengjiu Wang 2019-12-04 1006 }
c05f10f28ef697 Shengjiu Wang 2019-12-04 1007
f3d8ac8c4afea2 Fabio Estevam 2016-08-19 1008 if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16 1009 asrc->clk_map[IN] = input_clk_map_imx35;
7470704d8b425c Shengjiu Wang 2020-04-16 1010 asrc->clk_map[OUT] = output_clk_map_imx35;
c05f10f28ef697 Shengjiu Wang 2019-12-04 1011 } else if (of_device_is_compatible(np, "fsl,imx53-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16 1012 asrc->clk_map[IN] = input_clk_map_imx53;
7470704d8b425c Shengjiu Wang 2020-04-16 1013 asrc->clk_map[OUT] = output_clk_map_imx53;
c05f10f28ef697 Shengjiu Wang 2019-12-04 1014 } else if (of_device_is_compatible(np, "fsl,imx8qm-asrc") ||
c05f10f28ef697 Shengjiu Wang 2019-12-04 1015 of_device_is_compatible(np, "fsl,imx8qxp-asrc")) {
c05f10f28ef697 Shengjiu Wang 2019-12-04 1016 ret = of_property_read_u32(np, "fsl,asrc-clk-map", &map_idx);
c05f10f28ef697 Shengjiu Wang 2019-12-04 1017 if (ret) {
c05f10f28ef697 Shengjiu Wang 2019-12-04 1018 dev_err(&pdev->dev, "failed to get clk map index\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04 1019 return ret;
c05f10f28ef697 Shengjiu Wang 2019-12-04 1020 }
c05f10f28ef697 Shengjiu Wang 2019-12-04 1021
c05f10f28ef697 Shengjiu Wang 2019-12-04 1022 if (map_idx > 1) {
c05f10f28ef697 Shengjiu Wang 2019-12-04 1023 dev_err(&pdev->dev, "unsupported clk map index\n");
c05f10f28ef697 Shengjiu Wang 2019-12-04 1024 return -EINVAL;
c05f10f28ef697 Shengjiu Wang 2019-12-04 1025 }
c05f10f28ef697 Shengjiu Wang 2019-12-04 1026 if (of_device_is_compatible(np, "fsl,imx8qm-asrc")) {
7470704d8b425c Shengjiu Wang 2020-04-16 1027 asrc->clk_map[IN] = clk_map_imx8qm[map_idx];
7470704d8b425c Shengjiu Wang 2020-04-16 1028 asrc->clk_map[OUT] = clk_map_imx8qm[map_idx];
3117bb3109dc22 Nicolin Chen 2014-07-29 1029 } else {
7470704d8b425c Shengjiu Wang 2020-04-16 1030 asrc->clk_map[IN] = clk_map_imx8qxp[map_idx];
7470704d8b425c Shengjiu Wang 2020-04-16 1031 asrc->clk_map[OUT] = clk_map_imx8qxp[map_idx];
c05f10f28ef697 Shengjiu Wang 2019-12-04 1032 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1033 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1034
7470704d8b425c Shengjiu Wang 2020-04-16 1035 ret = fsl_asrc_init(asrc);
3117bb3109dc22 Nicolin Chen 2014-07-29 1036 if (ret) {
3117bb3109dc22 Nicolin Chen 2014-07-29 1037 dev_err(&pdev->dev, "failed to init asrc %d\n", ret);
c0296950851455 Fabio Estevam 2016-08-19 1038 return ret;
3117bb3109dc22 Nicolin Chen 2014-07-29 1039 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1040
7470704d8b425c Shengjiu Wang 2020-04-16 1041 asrc->channel_avail = 10;
3117bb3109dc22 Nicolin Chen 2014-07-29 1042
3117bb3109dc22 Nicolin Chen 2014-07-29 1043 ret = of_property_read_u32(np, "fsl,asrc-rate",
7470704d8b425c Shengjiu Wang 2020-04-16 1044 &asrc->asrc_rate);
3117bb3109dc22 Nicolin Chen 2014-07-29 1045 if (ret) {
3117bb3109dc22 Nicolin Chen 2014-07-29 1046 dev_err(&pdev->dev, "failed to get output rate\n");
c0296950851455 Fabio Estevam 2016-08-19 1047 return ret;
3117bb3109dc22 Nicolin Chen 2014-07-29 1048 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1049
4520af41fd2186 Shengjiu Wang 2020-04-16 @1050 ret = of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format);
4520af41fd2186 Shengjiu Wang 2020-04-16 1051 if (ret) {
4520af41fd2186 Shengjiu Wang 2020-04-16 1052 ret = of_property_read_u32(np, "fsl,asrc-width", &width);
3117bb3109dc22 Nicolin Chen 2014-07-29 1053 if (ret) {
4520af41fd2186 Shengjiu Wang 2020-04-16 1054 dev_err(&pdev->dev, "failed to decide output format\n");
c0296950851455 Fabio Estevam 2016-08-19 1055 return ret;
3117bb3109dc22 Nicolin Chen 2014-07-29 1056 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1057
4520af41fd2186 Shengjiu Wang 2020-04-16 1058 switch (width) {
4520af41fd2186 Shengjiu Wang 2020-04-16 1059 case 16:
4520af41fd2186 Shengjiu Wang 2020-04-16 1060 asrc->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16 1061 break;
4520af41fd2186 Shengjiu Wang 2020-04-16 1062 case 24:
4520af41fd2186 Shengjiu Wang 2020-04-16 1063 asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16 1064 break;
4520af41fd2186 Shengjiu Wang 2020-04-16 1065 default:
4520af41fd2186 Shengjiu Wang 2020-04-16 1066 dev_warn(&pdev->dev,
4520af41fd2186 Shengjiu Wang 2020-04-16 1067 "unsupported width, use default S24_LE\n");
4520af41fd2186 Shengjiu Wang 2020-04-16 1068 asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
4520af41fd2186 Shengjiu Wang 2020-04-16 1069 break;
4520af41fd2186 Shengjiu Wang 2020-04-16 1070 }
4520af41fd2186 Shengjiu Wang 2020-04-16 1071 }
4520af41fd2186 Shengjiu Wang 2020-04-16 1072
4520af41fd2186 Shengjiu Wang 2020-04-16 1073 if (!(FSL_ASRC_FORMATS & (1ULL << asrc->asrc_format))) {
4520af41fd2186 Shengjiu Wang 2020-04-16 1074 dev_warn(&pdev->dev, "unsupported width, use default S24_LE\n");
4520af41fd2186 Shengjiu Wang 2020-04-16 1075 asrc->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
3117bb3109dc22 Nicolin Chen 2014-07-29 1076 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1077
7470704d8b425c Shengjiu Wang 2020-04-16 1078 platform_set_drvdata(pdev, asrc);
3117bb3109dc22 Nicolin Chen 2014-07-29 1079 pm_runtime_enable(&pdev->dev);
7470704d8b425c Shengjiu Wang 2020-04-16 1080 spin_lock_init(&asrc->lock);
3117bb3109dc22 Nicolin Chen 2014-07-29 1081
3117bb3109dc22 Nicolin Chen 2014-07-29 1082 ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
3117bb3109dc22 Nicolin Chen 2014-07-29 1083 &fsl_asrc_dai, 1);
3117bb3109dc22 Nicolin Chen 2014-07-29 1084 if (ret) {
3117bb3109dc22 Nicolin Chen 2014-07-29 1085 dev_err(&pdev->dev, "failed to register ASoC DAI\n");
3117bb3109dc22 Nicolin Chen 2014-07-29 1086 return ret;
3117bb3109dc22 Nicolin Chen 2014-07-29 1087 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1088
3117bb3109dc22 Nicolin Chen 2014-07-29 1089 return 0;
3117bb3109dc22 Nicolin Chen 2014-07-29 1090 }
3117bb3109dc22 Nicolin Chen 2014-07-29 1091
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 3191/14131] drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse: got restricted __be16 [usertype]
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 86b956de119c09818d0aabaf668280d8e4bd0d4b [3191/14131] net: mscc: ocelot: support matching on EtherType
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago
config: openrisc-randconfig-s031-20200601 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 86b956de119c09818d0aabaf668280d8e4bd0d4b
# save the attached .config to linux build tree
make W=1 C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse: expected unsigned short [usertype]
>> drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse: got restricted __be16 [usertype]
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 86b956de119c09818d0aabaf668280d8e4bd0d4b
vim +184 drivers/net/ethernet/mscc/ocelot_flower.c
fe3490e6107e10 Horatiu Vultur 2019-05-31 48
f9e30088d20016 Pablo Neira Ayuso 2019-07-09 49 static int ocelot_flower_parse(struct flow_cls_offload *f,
ce6659c55b7dad Vladimir Oltean 2020-02-29 50 struct ocelot_ace_rule *ace)
fe3490e6107e10 Horatiu Vultur 2019-05-31 51 {
f9e30088d20016 Pablo Neira Ayuso 2019-07-09 52 struct flow_rule *rule = flow_cls_offload_flow_rule(f);
fe3490e6107e10 Horatiu Vultur 2019-05-31 53 struct flow_dissector *dissector = rule->match.dissector;
86b956de119c09 Vladimir Oltean 2020-04-20 54 u16 proto = ntohs(f->common.protocol);
86b956de119c09 Vladimir Oltean 2020-04-20 55 bool match_protocol = true;
fe3490e6107e10 Horatiu Vultur 2019-05-31 56
fe3490e6107e10 Horatiu Vultur 2019-05-31 57 if (dissector->used_keys &
fe3490e6107e10 Horatiu Vultur 2019-05-31 58 ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 59 BIT(FLOW_DISSECTOR_KEY_BASIC) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 60 BIT(FLOW_DISSECTOR_KEY_PORTS) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 61 BIT(FLOW_DISSECTOR_KEY_VLAN) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 62 BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 63 BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 64 BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 65 return -EOPNOTSUPP;
fe3490e6107e10 Horatiu Vultur 2019-05-31 66 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 67
fe3490e6107e10 Horatiu Vultur 2019-05-31 68 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 69 struct flow_match_control match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 70
fe3490e6107e10 Horatiu Vultur 2019-05-31 71 flow_rule_match_control(rule, &match);
fe3490e6107e10 Horatiu Vultur 2019-05-31 72 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 73
fe3490e6107e10 Horatiu Vultur 2019-05-31 74 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 75 struct flow_match_eth_addrs match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 76
fe3490e6107e10 Horatiu Vultur 2019-05-31 77 /* The hw support mac matches only for MAC_ETYPE key,
fe3490e6107e10 Horatiu Vultur 2019-05-31 78 * therefore if other matches(port, tcp flags, etc) are added
fe3490e6107e10 Horatiu Vultur 2019-05-31 79 * then just bail out
fe3490e6107e10 Horatiu Vultur 2019-05-31 80 */
fe3490e6107e10 Horatiu Vultur 2019-05-31 81 if ((dissector->used_keys &
fe3490e6107e10 Horatiu Vultur 2019-05-31 82 (BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 83 BIT(FLOW_DISSECTOR_KEY_BASIC) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 84 BIT(FLOW_DISSECTOR_KEY_CONTROL))) !=
fe3490e6107e10 Horatiu Vultur 2019-05-31 85 (BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 86 BIT(FLOW_DISSECTOR_KEY_BASIC) |
fe3490e6107e10 Horatiu Vultur 2019-05-31 87 BIT(FLOW_DISSECTOR_KEY_CONTROL)))
fe3490e6107e10 Horatiu Vultur 2019-05-31 88 return -EOPNOTSUPP;
fe3490e6107e10 Horatiu Vultur 2019-05-31 89
fe3490e6107e10 Horatiu Vultur 2019-05-31 90 if (proto == ETH_P_IP ||
fe3490e6107e10 Horatiu Vultur 2019-05-31 91 proto == ETH_P_IPV6 ||
fe3490e6107e10 Horatiu Vultur 2019-05-31 92 proto == ETH_P_ARP)
fe3490e6107e10 Horatiu Vultur 2019-05-31 93 return -EOPNOTSUPP;
fe3490e6107e10 Horatiu Vultur 2019-05-31 94
fe3490e6107e10 Horatiu Vultur 2019-05-31 95 flow_rule_match_eth_addrs(rule, &match);
ce6659c55b7dad Vladimir Oltean 2020-02-29 96 ace->type = OCELOT_ACE_TYPE_ETYPE;
ce6659c55b7dad Vladimir Oltean 2020-02-29 97 ether_addr_copy(ace->frame.etype.dmac.value,
fe3490e6107e10 Horatiu Vultur 2019-05-31 98 match.key->dst);
ce6659c55b7dad Vladimir Oltean 2020-02-29 99 ether_addr_copy(ace->frame.etype.smac.value,
fe3490e6107e10 Horatiu Vultur 2019-05-31 100 match.key->src);
ce6659c55b7dad Vladimir Oltean 2020-02-29 101 ether_addr_copy(ace->frame.etype.dmac.mask,
fe3490e6107e10 Horatiu Vultur 2019-05-31 102 match.mask->dst);
ce6659c55b7dad Vladimir Oltean 2020-02-29 103 ether_addr_copy(ace->frame.etype.smac.mask,
fe3490e6107e10 Horatiu Vultur 2019-05-31 104 match.mask->src);
fe3490e6107e10 Horatiu Vultur 2019-05-31 105 goto finished_key_parsing;
fe3490e6107e10 Horatiu Vultur 2019-05-31 106 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 107
fe3490e6107e10 Horatiu Vultur 2019-05-31 108 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 109 struct flow_match_basic match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 110
fe3490e6107e10 Horatiu Vultur 2019-05-31 111 flow_rule_match_basic(rule, &match);
fe3490e6107e10 Horatiu Vultur 2019-05-31 112 if (ntohs(match.key->n_proto) == ETH_P_IP) {
ce6659c55b7dad Vladimir Oltean 2020-02-29 113 ace->type = OCELOT_ACE_TYPE_IPV4;
ce6659c55b7dad Vladimir Oltean 2020-02-29 114 ace->frame.ipv4.proto.value[0] =
fe3490e6107e10 Horatiu Vultur 2019-05-31 115 match.key->ip_proto;
ce6659c55b7dad Vladimir Oltean 2020-02-29 116 ace->frame.ipv4.proto.mask[0] =
fe3490e6107e10 Horatiu Vultur 2019-05-31 117 match.mask->ip_proto;
86b956de119c09 Vladimir Oltean 2020-04-20 118 match_protocol = false;
fe3490e6107e10 Horatiu Vultur 2019-05-31 119 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 120 if (ntohs(match.key->n_proto) == ETH_P_IPV6) {
ce6659c55b7dad Vladimir Oltean 2020-02-29 121 ace->type = OCELOT_ACE_TYPE_IPV6;
ce6659c55b7dad Vladimir Oltean 2020-02-29 122 ace->frame.ipv6.proto.value[0] =
fe3490e6107e10 Horatiu Vultur 2019-05-31 123 match.key->ip_proto;
ce6659c55b7dad Vladimir Oltean 2020-02-29 124 ace->frame.ipv6.proto.mask[0] =
fe3490e6107e10 Horatiu Vultur 2019-05-31 125 match.mask->ip_proto;
86b956de119c09 Vladimir Oltean 2020-04-20 126 match_protocol = false;
fe3490e6107e10 Horatiu Vultur 2019-05-31 127 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 128 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 129
fe3490e6107e10 Horatiu Vultur 2019-05-31 130 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV4_ADDRS) &&
86b956de119c09 Vladimir Oltean 2020-04-20 131 proto == ETH_P_IP) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 132 struct flow_match_ipv4_addrs match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 133 u8 *tmp;
fe3490e6107e10 Horatiu Vultur 2019-05-31 134
fe3490e6107e10 Horatiu Vultur 2019-05-31 135 flow_rule_match_ipv4_addrs(rule, &match);
ce6659c55b7dad Vladimir Oltean 2020-02-29 136 tmp = &ace->frame.ipv4.sip.value.addr[0];
fe3490e6107e10 Horatiu Vultur 2019-05-31 137 memcpy(tmp, &match.key->src, 4);
fe3490e6107e10 Horatiu Vultur 2019-05-31 138
ce6659c55b7dad Vladimir Oltean 2020-02-29 139 tmp = &ace->frame.ipv4.sip.mask.addr[0];
fe3490e6107e10 Horatiu Vultur 2019-05-31 140 memcpy(tmp, &match.mask->src, 4);
fe3490e6107e10 Horatiu Vultur 2019-05-31 141
ce6659c55b7dad Vladimir Oltean 2020-02-29 142 tmp = &ace->frame.ipv4.dip.value.addr[0];
fe3490e6107e10 Horatiu Vultur 2019-05-31 143 memcpy(tmp, &match.key->dst, 4);
fe3490e6107e10 Horatiu Vultur 2019-05-31 144
ce6659c55b7dad Vladimir Oltean 2020-02-29 145 tmp = &ace->frame.ipv4.dip.mask.addr[0];
fe3490e6107e10 Horatiu Vultur 2019-05-31 146 memcpy(tmp, &match.mask->dst, 4);
86b956de119c09 Vladimir Oltean 2020-04-20 147 match_protocol = false;
fe3490e6107e10 Horatiu Vultur 2019-05-31 148 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 149
fe3490e6107e10 Horatiu Vultur 2019-05-31 150 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV6_ADDRS) &&
86b956de119c09 Vladimir Oltean 2020-04-20 151 proto == ETH_P_IPV6) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 152 return -EOPNOTSUPP;
fe3490e6107e10 Horatiu Vultur 2019-05-31 153 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 154
fe3490e6107e10 Horatiu Vultur 2019-05-31 155 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_PORTS)) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 156 struct flow_match_ports match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 157
fe3490e6107e10 Horatiu Vultur 2019-05-31 158 flow_rule_match_ports(rule, &match);
ce6659c55b7dad Vladimir Oltean 2020-02-29 159 ace->frame.ipv4.sport.value = ntohs(match.key->src);
ce6659c55b7dad Vladimir Oltean 2020-02-29 160 ace->frame.ipv4.sport.mask = ntohs(match.mask->src);
ce6659c55b7dad Vladimir Oltean 2020-02-29 161 ace->frame.ipv4.dport.value = ntohs(match.key->dst);
ce6659c55b7dad Vladimir Oltean 2020-02-29 162 ace->frame.ipv4.dport.mask = ntohs(match.mask->dst);
86b956de119c09 Vladimir Oltean 2020-04-20 163 match_protocol = false;
fe3490e6107e10 Horatiu Vultur 2019-05-31 164 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 165
fe3490e6107e10 Horatiu Vultur 2019-05-31 166 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) {
fe3490e6107e10 Horatiu Vultur 2019-05-31 167 struct flow_match_vlan match;
fe3490e6107e10 Horatiu Vultur 2019-05-31 168
fe3490e6107e10 Horatiu Vultur 2019-05-31 169 flow_rule_match_vlan(rule, &match);
ce6659c55b7dad Vladimir Oltean 2020-02-29 170 ace->type = OCELOT_ACE_TYPE_ANY;
ce6659c55b7dad Vladimir Oltean 2020-02-29 171 ace->vlan.vid.value = match.key->vlan_id;
ce6659c55b7dad Vladimir Oltean 2020-02-29 172 ace->vlan.vid.mask = match.mask->vlan_id;
ce6659c55b7dad Vladimir Oltean 2020-02-29 173 ace->vlan.pcp.value[0] = match.key->vlan_priority;
ce6659c55b7dad Vladimir Oltean 2020-02-29 174 ace->vlan.pcp.mask[0] = match.mask->vlan_priority;
86b956de119c09 Vladimir Oltean 2020-04-20 175 match_protocol = false;
fe3490e6107e10 Horatiu Vultur 2019-05-31 176 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 177
fe3490e6107e10 Horatiu Vultur 2019-05-31 178 finished_key_parsing:
86b956de119c09 Vladimir Oltean 2020-04-20 179 if (match_protocol && proto != ETH_P_ALL) {
86b956de119c09 Vladimir Oltean 2020-04-20 180 /* TODO: support SNAP, LLC etc */
86b956de119c09 Vladimir Oltean 2020-04-20 181 if (proto < ETH_P_802_3_MIN)
86b956de119c09 Vladimir Oltean 2020-04-20 182 return -EOPNOTSUPP;
86b956de119c09 Vladimir Oltean 2020-04-20 183 ace->type = OCELOT_ACE_TYPE_ETYPE;
86b956de119c09 Vladimir Oltean 2020-04-20 @184 *(u16 *)ace->frame.etype.etype.value = htons(proto);
86b956de119c09 Vladimir Oltean 2020-04-20 185 *(u16 *)ace->frame.etype.etype.mask = 0xffff;
86b956de119c09 Vladimir Oltean 2020-04-20 186 }
86b956de119c09 Vladimir Oltean 2020-04-20 187 /* else, a rule of type OCELOT_ACE_TYPE_ANY is implicitly added */
86b956de119c09 Vladimir Oltean 2020-04-20 188
ce6659c55b7dad Vladimir Oltean 2020-02-29 189 ace->prio = f->common.prio;
ce6659c55b7dad Vladimir Oltean 2020-02-29 190 ace->id = f->cookie;
ce6659c55b7dad Vladimir Oltean 2020-02-29 191 return ocelot_flower_parse_action(f, ace);
fe3490e6107e10 Horatiu Vultur 2019-05-31 192 }
fe3490e6107e10 Horatiu Vultur 2019-05-31 193
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 10504/14131] net/ipv6/mcast.c:606:34: sparse: expected void [noderef] <asn:1> *to
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 931ca7ab7fe804d77bc6952f1512950c0d870f26 [10504/14131] ip*_mc_gsfget(): lift copyout of struct group_filter into callers
:::::: branch date: 3 days ago
:::::: commit date: 12 days ago
config: microblaze-randconfig-s032-20200601 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 931ca7ab7fe804d77bc6952f1512950c0d870f26
# save the attached .config to linux build tree
make W=1 C=1 ARCH=microblaze CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
include/linux/byteorder/big_endian.h:8:2: sparse: sparse: inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN
net/ipv6/mcast.c:606:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got struct __kernel_sockaddr_storage *p @@
>> net/ipv6/mcast.c:606:34: sparse: expected void [noderef] <asn:1> *to
net/ipv6/mcast.c:606:34: sparse: got struct __kernel_sockaddr_storage *p
net/ipv6/mcast.c:549:5: sparse: sparse: symbol 'ip6_mc_msfget' redeclared with different type (incompatible argument 3 (different address spaces)):
net/ipv6/mcast.c:549:5: sparse: int extern [addressable] [signed] [toplevel] ip6_mc_msfget( ... )
>> include/net/ipv6.h:1140:5: sparse: note: previously declared as:
include/net/ipv6.h:1140:5: sparse: int extern [addressable] [signed] [toplevel] ip6_mc_msfget( ... )
net/ipv6/mcast.c:259:25: sparse: sparse: context imbalance in 'ip6_mc_find_dev_rcu' - different lock contexts for basic block
net/ipv6/mcast.c:453:9: sparse: sparse: context imbalance in 'ip6_mc_source' - unexpected unlock
net/ipv6/mcast.c:542:9: sparse: sparse: context imbalance in 'ip6_mc_msfilter' - unexpected unlock
net/ipv6/mcast.c:589:21: sparse: sparse: context imbalance in 'ip6_mc_msfget' - unexpected unlock
net/ipv6/mcast.c:2700:25: sparse: sparse: context imbalance in 'igmp6_mc_get_next' - unexpected unlock
net/ipv6/mcast.c:2722:9: sparse: sparse: context imbalance in 'igmp6_mc_get_idx' - wrong count at exit
net/ipv6/mcast.c:2749:9: sparse: sparse: context imbalance in 'igmp6_mc_seq_stop' - unexpected unlock
net/ipv6/mcast.c:2821:31: sparse: sparse: context imbalance in 'igmp6_mcf_get_next' - unexpected unlock
net/ipv6/mcast.c:2853:9: sparse: sparse: context imbalance in 'igmp6_mcf_get_idx' - wrong count at exit
net/ipv6/mcast.c:2870:9: sparse: sparse: context imbalance in 'igmp6_mcf_seq_next' - wrong count at exit
net/ipv6/mcast.c:2883:17: sparse: sparse: context imbalance in 'igmp6_mcf_seq_stop' - unexpected unlock
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 931ca7ab7fe804d77bc6952f1512950c0d870f26
vim +606 net/ipv6/mcast.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 548
^1da177e4c3f41 Linus Torvalds 2005-04-16 549 int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
931ca7ab7fe804 Al Viro 2020-03-29 550 struct sockaddr_storage *p)
^1da177e4c3f41 Linus Torvalds 2005-04-16 551 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 552 int err, i, count, copycount;
b71d1d426d263b Eric Dumazet 2011-04-22 553 const struct in6_addr *group;
^1da177e4c3f41 Linus Torvalds 2005-04-16 554 struct ipv6_mc_socklist *pmc;
^1da177e4c3f41 Linus Torvalds 2005-04-16 555 struct inet6_dev *idev;
^1da177e4c3f41 Linus Torvalds 2005-04-16 556 struct ipv6_pinfo *inet6 = inet6_sk(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 557 struct ip6_sf_socklist *psl;
3b1e0a655f8eba YOSHIFUJI Hideaki 2008-03-26 558 struct net *net = sock_net(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 559
^1da177e4c3f41 Linus Torvalds 2005-04-16 560 group = &((struct sockaddr_in6 *)&gsf->gf_group)->sin6_addr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 561
^1da177e4c3f41 Linus Torvalds 2005-04-16 562 if (!ipv6_addr_is_multicast(group))
^1da177e4c3f41 Linus Torvalds 2005-04-16 563 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 564
96b52e61be1ad4 Eric Dumazet 2010-06-07 565 rcu_read_lock();
96b52e61be1ad4 Eric Dumazet 2010-06-07 566 idev = ip6_mc_find_dev_rcu(net, group, gsf->gf_interface);
^1da177e4c3f41 Linus Torvalds 2005-04-16 567
96b52e61be1ad4 Eric Dumazet 2010-06-07 568 if (!idev) {
96b52e61be1ad4 Eric Dumazet 2010-06-07 569 rcu_read_unlock();
^1da177e4c3f41 Linus Torvalds 2005-04-16 570 return -ENODEV;
96b52e61be1ad4 Eric Dumazet 2010-06-07 571 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 572
^1da177e4c3f41 Linus Torvalds 2005-04-16 573 err = -EADDRNOTAVAIL;
f7ed925c1b4d62 WANG Cong 2014-09-11 574 /* changes to the ipv6_mc_list require the socket lock and
f7ed925c1b4d62 WANG Cong 2014-09-11 575 * rtnl lock. We have the socket lock and rcu read lock,
5ab4a6c81eb3db David L Stevens 2005-12-27 576 * so reading the list is safe.
5ab4a6c81eb3db David L Stevens 2005-12-27 577 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 578
456b61bca8ee32 Eric Dumazet 2010-11-23 579 for_each_pmc_rcu(inet6, pmc) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 580 if (pmc->ifindex != gsf->gf_interface)
^1da177e4c3f41 Linus Torvalds 2005-04-16 581 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 582 if (ipv6_addr_equal(group, &pmc->addr))
^1da177e4c3f41 Linus Torvalds 2005-04-16 583 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 584 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 585 if (!pmc) /* must have a prior join */
^1da177e4c3f41 Linus Torvalds 2005-04-16 586 goto done;
^1da177e4c3f41 Linus Torvalds 2005-04-16 587 gsf->gf_fmode = pmc->sfmode;
^1da177e4c3f41 Linus Torvalds 2005-04-16 588 psl = pmc->sflist;
^1da177e4c3f41 Linus Torvalds 2005-04-16 589 count = psl ? psl->sl_count : 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 590 read_unlock_bh(&idev->lock);
96b52e61be1ad4 Eric Dumazet 2010-06-07 591 rcu_read_unlock();
^1da177e4c3f41 Linus Torvalds 2005-04-16 592
^1da177e4c3f41 Linus Torvalds 2005-04-16 593 copycount = count < gsf->gf_numsrc ? count : gsf->gf_numsrc;
^1da177e4c3f41 Linus Torvalds 2005-04-16 594 gsf->gf_numsrc = count;
f7ed925c1b4d62 WANG Cong 2014-09-11 595 /* changes to psl require the socket lock, and a write lock
f7ed925c1b4d62 WANG Cong 2014-09-11 596 * on pmc->sflock. We have the socket lock so reading here is safe.
5ab4a6c81eb3db David L Stevens 2005-12-27 597 */
931ca7ab7fe804 Al Viro 2020-03-29 598 for (i = 0; i < copycount; i++, p++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 599 struct sockaddr_in6 *psin6;
^1da177e4c3f41 Linus Torvalds 2005-04-16 600 struct sockaddr_storage ss;
^1da177e4c3f41 Linus Torvalds 2005-04-16 601
^1da177e4c3f41 Linus Torvalds 2005-04-16 602 psin6 = (struct sockaddr_in6 *)&ss;
^1da177e4c3f41 Linus Torvalds 2005-04-16 603 memset(&ss, 0, sizeof(ss));
^1da177e4c3f41 Linus Torvalds 2005-04-16 604 psin6->sin6_family = AF_INET6;
^1da177e4c3f41 Linus Torvalds 2005-04-16 605 psin6->sin6_addr = psl->sl_addr[i];
931ca7ab7fe804 Al Viro 2020-03-29 @606 if (copy_to_user(p, &ss, sizeof(ss)))
^1da177e4c3f41 Linus Torvalds 2005-04-16 607 return -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 608 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 609 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 610 done:
^1da177e4c3f41 Linus Torvalds 2005-04-16 611 read_unlock_bh(&idev->lock);
96b52e61be1ad4 Eric Dumazet 2010-06-07 612 rcu_read_unlock();
^1da177e4c3f41 Linus Torvalds 2005-04-16 613 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 614 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 615
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 3942/14131] drivers/cdrom/cdrom.c:3597:42: sparse: got void [noderef] <asn:1> *buffer
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 32927393dc1ccd60fb2bdc05b9e8e88753761469 [3942/14131] sysctl: pass kernel pointers to ->proc_handler
:::::: branch date: 3 days ago
:::::: commit date: 5 weeks ago
config: i386-randconfig-s001-20200601 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 32927393dc1ccd60fb2bdc05b9e8e88753761469
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/cdrom/cdrom.c:3597:42: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void * @@ got void [noderef] <asn:1> *buffer @@
drivers/cdrom/cdrom.c:3597:42: sparse: expected void *
>> drivers/cdrom/cdrom.c:3597:42: sparse: got void [noderef] <asn:1> *buffer
drivers/cdrom/cdrom.c:3665:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
drivers/cdrom/cdrom.c:3665:35: sparse: expected int ( [usertype] *proc_handler )( ... )
>> drivers/cdrom/cdrom.c:3665:35: sparse: got int ( * )( ... )
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 32927393dc1ccd60fb2bdc05b9e8e88753761469
vim +3597 drivers/cdrom/cdrom.c
554988d6fe3697 Dave Young 2007-06-19 3519
90a3b89e00658b Joe Perches 2014-06-06 3520 static int cdrom_sysctl_info(struct ctl_table *ctl, int write,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3521 void __user *buffer, size_t *lenp, loff_t *ppos)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3522 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3523 int pos;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3524 char *info = cdrom_sysctl_settings.info;
554988d6fe3697 Dave Young 2007-06-19 3525 const int max_size = sizeof(cdrom_sysctl_settings.info);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3526
^1da177e4c3f41 Linus Torvalds 2005-04-16 3527 if (!*lenp || (*ppos && !write)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3528 *lenp = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3529 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3530 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3531
554988d6fe3697 Dave Young 2007-06-19 3532 mutex_lock(&cdrom_mutex);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3533
554988d6fe3697 Dave Young 2007-06-19 3534 pos = sprintf(info, "CD-ROM information, " VERSION "\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3535
554988d6fe3697 Dave Young 2007-06-19 3536 if (cdrom_print_info("\ndrive name:\t", 0, info, &pos, CTL_NAME))
554988d6fe3697 Dave Young 2007-06-19 3537 goto done;
554988d6fe3697 Dave Young 2007-06-19 3538 if (cdrom_print_info("\ndrive speed:\t", 0, info, &pos, CTL_SPEED))
554988d6fe3697 Dave Young 2007-06-19 3539 goto done;
554988d6fe3697 Dave Young 2007-06-19 3540 if (cdrom_print_info("\ndrive # of slots:", 0, info, &pos, CTL_SLOTS))
554988d6fe3697 Dave Young 2007-06-19 3541 goto done;
554988d6fe3697 Dave Young 2007-06-19 3542 if (cdrom_print_info("\nCan close tray:\t",
554988d6fe3697 Dave Young 2007-06-19 3543 CDC_CLOSE_TRAY, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3544 goto done;
554988d6fe3697 Dave Young 2007-06-19 3545 if (cdrom_print_info("\nCan open tray:\t",
554988d6fe3697 Dave Young 2007-06-19 3546 CDC_OPEN_TRAY, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3547 goto done;
554988d6fe3697 Dave Young 2007-06-19 3548 if (cdrom_print_info("\nCan lock tray:\t",
554988d6fe3697 Dave Young 2007-06-19 3549 CDC_LOCK, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3550 goto done;
554988d6fe3697 Dave Young 2007-06-19 3551 if (cdrom_print_info("\nCan change speed:",
554988d6fe3697 Dave Young 2007-06-19 3552 CDC_SELECT_SPEED, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3553 goto done;
554988d6fe3697 Dave Young 2007-06-19 3554 if (cdrom_print_info("\nCan select disk:",
554988d6fe3697 Dave Young 2007-06-19 3555 CDC_SELECT_DISC, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3556 goto done;
554988d6fe3697 Dave Young 2007-06-19 3557 if (cdrom_print_info("\nCan read multisession:",
554988d6fe3697 Dave Young 2007-06-19 3558 CDC_MULTI_SESSION, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3559 goto done;
554988d6fe3697 Dave Young 2007-06-19 3560 if (cdrom_print_info("\nCan read MCN:\t",
554988d6fe3697 Dave Young 2007-06-19 3561 CDC_MCN, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3562 goto done;
554988d6fe3697 Dave Young 2007-06-19 3563 if (cdrom_print_info("\nReports media changed:",
554988d6fe3697 Dave Young 2007-06-19 3564 CDC_MEDIA_CHANGED, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3565 goto done;
554988d6fe3697 Dave Young 2007-06-19 3566 if (cdrom_print_info("\nCan play audio:\t",
554988d6fe3697 Dave Young 2007-06-19 3567 CDC_PLAY_AUDIO, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3568 goto done;
554988d6fe3697 Dave Young 2007-06-19 3569 if (cdrom_print_info("\nCan write CD-R:\t",
554988d6fe3697 Dave Young 2007-06-19 3570 CDC_CD_R, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3571 goto done;
554988d6fe3697 Dave Young 2007-06-19 3572 if (cdrom_print_info("\nCan write CD-RW:",
554988d6fe3697 Dave Young 2007-06-19 3573 CDC_CD_RW, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3574 goto done;
554988d6fe3697 Dave Young 2007-06-19 3575 if (cdrom_print_info("\nCan read DVD:\t",
554988d6fe3697 Dave Young 2007-06-19 3576 CDC_DVD, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3577 goto done;
554988d6fe3697 Dave Young 2007-06-19 3578 if (cdrom_print_info("\nCan write DVD-R:",
554988d6fe3697 Dave Young 2007-06-19 3579 CDC_DVD_R, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3580 goto done;
554988d6fe3697 Dave Young 2007-06-19 3581 if (cdrom_print_info("\nCan write DVD-RAM:",
554988d6fe3697 Dave Young 2007-06-19 3582 CDC_DVD_RAM, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3583 goto done;
554988d6fe3697 Dave Young 2007-06-19 3584 if (cdrom_print_info("\nCan read MRW:\t",
554988d6fe3697 Dave Young 2007-06-19 3585 CDC_MRW, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3586 goto done;
554988d6fe3697 Dave Young 2007-06-19 3587 if (cdrom_print_info("\nCan write MRW:\t",
554988d6fe3697 Dave Young 2007-06-19 3588 CDC_MRW_W, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3589 goto done;
554988d6fe3697 Dave Young 2007-06-19 3590 if (cdrom_print_info("\nCan write RAM:\t",
554988d6fe3697 Dave Young 2007-06-19 3591 CDC_RAM, info, &pos, CTL_CAPABILITY))
554988d6fe3697 Dave Young 2007-06-19 3592 goto done;
554988d6fe3697 Dave Young 2007-06-19 3593 if (!scnprintf(info + pos, max_size - pos, "\n\n"))
554988d6fe3697 Dave Young 2007-06-19 3594 goto done;
554988d6fe3697 Dave Young 2007-06-19 3595 doit:
554988d6fe3697 Dave Young 2007-06-19 3596 mutex_unlock(&cdrom_mutex);
8d65af789f3e2c Alexey Dobriyan 2009-09-23 @3597 return proc_dostring(ctl, write, buffer, lenp, ppos);
554988d6fe3697 Dave Young 2007-06-19 3598 done:
e597cd09f711b2 Joe Perches 2010-07-01 3599 pr_info("info buffer too small\n");
554988d6fe3697 Dave Young 2007-06-19 3600 goto doit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3601 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3602
^1da177e4c3f41 Linus Torvalds 2005-04-16 3603 /* Unfortunately, per device settings are not implemented through
^1da177e4c3f41 Linus Torvalds 2005-04-16 3604 procfs/sysctl yet. When they are, this will naturally disappear. For now
^1da177e4c3f41 Linus Torvalds 2005-04-16 3605 just update all drives. Later this will become the template on which
^1da177e4c3f41 Linus Torvalds 2005-04-16 3606 new registered drives will be based. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3607 static void cdrom_update_settings(void)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3608 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3609 struct cdrom_device_info *cdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3610
032d8d90ba23e1 Akinobu Mita 2008-03-26 3611 mutex_lock(&cdrom_mutex);
7fd097d42b90af Akinobu Mita 2008-03-26 3612 list_for_each_entry(cdi, &cdrom_list, list) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3613 if (autoclose && CDROM_CAN(CDC_CLOSE_TRAY))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3614 cdi->options |= CDO_AUTO_CLOSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3615 else if (!autoclose)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3616 cdi->options &= ~CDO_AUTO_CLOSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3617 if (autoeject && CDROM_CAN(CDC_OPEN_TRAY))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3618 cdi->options |= CDO_AUTO_EJECT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3619 else if (!autoeject)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3620 cdi->options &= ~CDO_AUTO_EJECT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3621 if (lockdoor && CDROM_CAN(CDC_LOCK))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3622 cdi->options |= CDO_LOCK;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3623 else if (!lockdoor)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3624 cdi->options &= ~CDO_LOCK;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3625 if (check_media_type)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3626 cdi->options |= CDO_CHECK_TYPE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3627 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 3628 cdi->options &= ~CDO_CHECK_TYPE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3629 }
032d8d90ba23e1 Akinobu Mita 2008-03-26 3630 mutex_unlock(&cdrom_mutex);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3631 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3632
90a3b89e00658b Joe Perches 2014-06-06 3633 static int cdrom_sysctl_handler(struct ctl_table *ctl, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24 3634 void *buffer, size_t *lenp, loff_t *ppos)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3635 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3636 int ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3637
8d65af789f3e2c Alexey Dobriyan 2009-09-23 3638 ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3639
06489b4eec8322 Eric W. Biederman 2007-10-18 3640 if (write) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3641
^1da177e4c3f41 Linus Torvalds 2005-04-16 3642 /* we only care for 1 or 0. */
06489b4eec8322 Eric W. Biederman 2007-10-18 3643 autoclose = !!cdrom_sysctl_settings.autoclose;
06489b4eec8322 Eric W. Biederman 2007-10-18 3644 autoeject = !!cdrom_sysctl_settings.autoeject;
06489b4eec8322 Eric W. Biederman 2007-10-18 3645 debug = !!cdrom_sysctl_settings.debug;
06489b4eec8322 Eric W. Biederman 2007-10-18 3646 lockdoor = !!cdrom_sysctl_settings.lock;
06489b4eec8322 Eric W. Biederman 2007-10-18 3647 check_media_type = !!cdrom_sysctl_settings.check;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3648
^1da177e4c3f41 Linus Torvalds 2005-04-16 3649 /* update the option flags according to the changes. we
^1da177e4c3f41 Linus Torvalds 2005-04-16 3650 don't have per device options through sysctl yet,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3651 but we will have and then this will disappear. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3652 cdrom_update_settings();
^1da177e4c3f41 Linus Torvalds 2005-04-16 3653 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3654
^1da177e4c3f41 Linus Torvalds 2005-04-16 3655 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3656 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3657
^1da177e4c3f41 Linus Torvalds 2005-04-16 3658 /* Place files in /proc/sys/dev/cdrom */
90a3b89e00658b Joe Perches 2014-06-06 3659 static struct ctl_table cdrom_table[] = {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3660 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3661 .procname = "info",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3662 .data = &cdrom_sysctl_settings.info,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3663 .maxlen = CDROM_STR_SIZE,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3664 .mode = 0444,
6d4561110a3e9f Eric W. Biederman 2009-11-16 @3665 .proc_handler = cdrom_sysctl_info,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3666 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 3667 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3668 .procname = "autoclose",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3669 .data = &cdrom_sysctl_settings.autoclose,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3670 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 3671 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 3672 .proc_handler = cdrom_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3673 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 3674 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3675 .procname = "autoeject",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3676 .data = &cdrom_sysctl_settings.autoeject,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3677 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 3678 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 3679 .proc_handler = cdrom_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3680 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 3681 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3682 .procname = "debug",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3683 .data = &cdrom_sysctl_settings.debug,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3684 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 3685 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 3686 .proc_handler = cdrom_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3687 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 3688 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3689 .procname = "lock",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3690 .data = &cdrom_sysctl_settings.lock,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3691 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 3692 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 3693 .proc_handler = cdrom_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3694 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 3695 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3696 .procname = "check_media",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3697 .data = &cdrom_sysctl_settings.check,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3698 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 3699 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 3700 .proc_handler = cdrom_sysctl_handler
^1da177e4c3f41 Linus Torvalds 2005-04-16 3701 },
894d2491153a9f Eric W. Biederman 2009-11-05 3702 { }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3703 };
^1da177e4c3f41 Linus Torvalds 2005-04-16 3704
:::::: The code at line 3597 was first introduced by commit
:::::: 8d65af789f3e2cf4cfbdbf71a0f7a61ebcd41d38 sysctl: remove "struct file *" argument of ->proc_handler
:::::: TO: Alexey Dobriyan <adobriyan(a)gmail.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[hnaz-linux-mm:master 59/194] arch/powerpc/mm/pgtable.c:267:15: error: implicit declaration of function 'pmd_ptr'
by kernel test robot
tree: https://github.com/hnaz/linux-mm master
head: a017b085735719105714da692a82a6eeb8830718
commit: eb0f7fa78a5ced856259e759b6bad1bed2a9295c [59/194] mm: pgtable: add shortcuts for accessing kernel PMD and PTE
config: powerpc-ep88xc_defconfig (attached as .config)
compiler: powerpc-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 checkout eb0f7fa78a5ced856259e759b6bad1bed2a9295c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>, old ones prefixed by <<):
arch/powerpc/mm/pgtable.c: In function 'set_huge_pte_at':
>> arch/powerpc/mm/pgtable.c:267:15: error: implicit declaration of function 'pmd_ptr' [-Werror=implicit-function-declaration]
267 | pmd_t *pmd = pmd_ptr(mm, addr);
| ^~~~~~~
>> arch/powerpc/mm/pgtable.c:267:15: error: initialization of 'pmd_t *' {aka 'struct <anonymous> *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
arch/powerpc/mm/pgtable.c: At top level:
arch/powerpc/mm/pgtable.c:341:8: error: no previous prototype for '__find_linux_pte' [-Werror=missing-prototypes]
341 | pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/pmd_ptr +267 arch/powerpc/mm/pgtable.c
f159bcb25fdb31 Andrew Morton 2020-06-09 263
f159bcb25fdb31 Andrew Morton 2020-06-09 264 #if defined(CONFIG_PPC_8xx)
f159bcb25fdb31 Andrew Morton 2020-06-09 265 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
f159bcb25fdb31 Andrew Morton 2020-06-09 266 {
f159bcb25fdb31 Andrew Morton 2020-06-09 @267 pmd_t *pmd = pmd_ptr(mm, addr);
f159bcb25fdb31 Andrew Morton 2020-06-09 268 pte_basic_t val;
f159bcb25fdb31 Andrew Morton 2020-06-09 269 pte_basic_t *entry = &ptep->pte;
f159bcb25fdb31 Andrew Morton 2020-06-09 270 int num = is_hugepd(*((hugepd_t *)pmd)) ? 1 : SZ_512K / SZ_4K;
f159bcb25fdb31 Andrew Morton 2020-06-09 271 int i;
f159bcb25fdb31 Andrew Morton 2020-06-09 272
f159bcb25fdb31 Andrew Morton 2020-06-09 273 /*
f159bcb25fdb31 Andrew Morton 2020-06-09 274 * Make sure hardware valid bit is not set. We don't do
f159bcb25fdb31 Andrew Morton 2020-06-09 275 * tlb flush for this update.
f159bcb25fdb31 Andrew Morton 2020-06-09 276 */
f159bcb25fdb31 Andrew Morton 2020-06-09 277 VM_WARN_ON(pte_hw_valid(*ptep) && !pte_protnone(*ptep));
f159bcb25fdb31 Andrew Morton 2020-06-09 278
f159bcb25fdb31 Andrew Morton 2020-06-09 279 pte = pte_mkpte(pte);
f159bcb25fdb31 Andrew Morton 2020-06-09 280
f159bcb25fdb31 Andrew Morton 2020-06-09 281 pte = set_pte_filter(pte);
f159bcb25fdb31 Andrew Morton 2020-06-09 282
f159bcb25fdb31 Andrew Morton 2020-06-09 283 val = pte_val(pte);
f159bcb25fdb31 Andrew Morton 2020-06-09 284 for (i = 0; i < num; i++, entry++, val += SZ_4K)
f159bcb25fdb31 Andrew Morton 2020-06-09 285 *entry = val;
f159bcb25fdb31 Andrew Morton 2020-06-09 286 }
f159bcb25fdb31 Andrew Morton 2020-06-09 287 #endif
f069ff396d657a Aneesh Kumar K.V 2018-05-29 288 #endif /* CONFIG_HUGETLB_PAGE */
f069ff396d657a Aneesh Kumar K.V 2018-05-29 289
:::::: The code at line 267 was first introduced by commit
:::::: f159bcb25fdb31b93da0d50db40bc34e8cdcc713 origin
:::::: TO: Andrew Morton <akpm(a)linux-foundation.org>
:::::: CC: Johannes Weiner <hannes(a)cmpxchg.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months