From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 11572/11714] drivers/mailbox/mailbox-mpfs.c:122:50: sparse: sparse: shift count is negative (-1)
Date: Tue, 22 Jun 2021 03:07:52 +0800 [thread overview]
Message-ID: <202106220338.PyY0SR4F-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 10986 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Conor Dooley <conor.dooley@microchip.com>
CC: Jassi Brar <jaswinder.singh@linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 889bab4c367a0ef58208fd80fafa74bb6e2dca26
commit: de5473936808627fa98c3d2e8e3fa3076338f601 [11572/11714] mbox: add polarfire soc system controller mailbox
:::::: branch date: 7 hours ago
:::::: commit date: 14 hours ago
config: h8300-randconfig-s032-20210621 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=de5473936808627fa98c3d2e8e3fa3076338f601
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout de5473936808627fa98c3d2e8e3fa3076338f601
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/mailbox/mailbox-mpfs.c: note: in included file:
include/soc/microchip/mpfs.h:49:28: sparse: sparse: symbol 'mpfs_sys_controller_get' was not declared. Should it be static?
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/mailbox/mailbox-mpfs.c:122:50: sparse: sparse: shift count is negative (-1)
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/mailbox-mpfs.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/mailbox/mailbox-mpfs.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
vim +122 drivers/mailbox/mailbox-mpfs.c
de5473936808627f Conor Dooley 2021-05-11 80
de5473936808627f Conor Dooley 2021-05-11 81 static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data)
de5473936808627f Conor Dooley 2021-05-11 82 {
de5473936808627f Conor Dooley 2021-05-11 83 struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
de5473936808627f Conor Dooley 2021-05-11 84 struct mpfs_mss_msg *msg = data;
de5473936808627f Conor Dooley 2021-05-11 85 u32 tx_trigger;
de5473936808627f Conor Dooley 2021-05-11 86 u16 opt_sel;
de5473936808627f Conor Dooley 2021-05-11 87 u32 val = 0u;
de5473936808627f Conor Dooley 2021-05-11 88
de5473936808627f Conor Dooley 2021-05-11 89 mbox->response = msg->response;
de5473936808627f Conor Dooley 2021-05-11 90 mbox->resp_offset = msg->resp_offset;
de5473936808627f Conor Dooley 2021-05-11 91
de5473936808627f Conor Dooley 2021-05-11 92 if (mpfs_mbox_busy(mbox))
de5473936808627f Conor Dooley 2021-05-11 93 return -EBUSY;
de5473936808627f Conor Dooley 2021-05-11 94
de5473936808627f Conor Dooley 2021-05-11 95 if (msg->cmd_data_size) {
de5473936808627f Conor Dooley 2021-05-11 96 u32 index;
de5473936808627f Conor Dooley 2021-05-11 97 u8 extra_bits = msg->cmd_data_size & 3;
de5473936808627f Conor Dooley 2021-05-11 98 u32 *word_buf = (u32 *)msg->cmd_data;
de5473936808627f Conor Dooley 2021-05-11 99
de5473936808627f Conor Dooley 2021-05-11 100 for (index = 0; index < (msg->cmd_data_size / 4); index++)
de5473936808627f Conor Dooley 2021-05-11 101 writel_relaxed(word_buf[index],
de5473936808627f Conor Dooley 2021-05-11 102 mbox->mbox_base + MAILBOX_REG_OFFSET + index * 0x4);
de5473936808627f Conor Dooley 2021-05-11 103 if (extra_bits) {
de5473936808627f Conor Dooley 2021-05-11 104 u8 i;
de5473936808627f Conor Dooley 2021-05-11 105 u8 byte_off = ALIGN_DOWN(msg->cmd_data_size, 4);
de5473936808627f Conor Dooley 2021-05-11 106 u8 *byte_buf = msg->cmd_data + byte_off;
de5473936808627f Conor Dooley 2021-05-11 107
de5473936808627f Conor Dooley 2021-05-11 108 val = readl_relaxed(mbox->mbox_base +
de5473936808627f Conor Dooley 2021-05-11 109 MAILBOX_REG_OFFSET + index * 0x4);
de5473936808627f Conor Dooley 2021-05-11 110
de5473936808627f Conor Dooley 2021-05-11 111 for (i = 0u; i < extra_bits; i++) {
de5473936808627f Conor Dooley 2021-05-11 112 val &= ~(0xffu << (i * 8u));
de5473936808627f Conor Dooley 2021-05-11 113 val |= (byte_buf[i] << (i * 8u));
de5473936808627f Conor Dooley 2021-05-11 114 }
de5473936808627f Conor Dooley 2021-05-11 115
de5473936808627f Conor Dooley 2021-05-11 116 writel_relaxed(val,
de5473936808627f Conor Dooley 2021-05-11 117 mbox->mbox_base + MAILBOX_REG_OFFSET + index * 0x4);
de5473936808627f Conor Dooley 2021-05-11 118 }
de5473936808627f Conor Dooley 2021-05-11 119 }
de5473936808627f Conor Dooley 2021-05-11 120
de5473936808627f Conor Dooley 2021-05-11 121 opt_sel = ((msg->mbox_offset << 7u) | (msg->cmd_opcode & 0x7fu));
de5473936808627f Conor Dooley 2021-05-11 @122 tx_trigger = (opt_sel << SCB_CTRL_POS) & SCB_CTRL_MASK;
de5473936808627f Conor Dooley 2021-05-11 123 tx_trigger |= SCB_CTRL_REQ_MASK | SCB_STATUS_NOTIFY_MASK;
de5473936808627f Conor Dooley 2021-05-11 124 writel_relaxed(tx_trigger, mbox->mbox_base + SERVICES_CR_OFFSET);
de5473936808627f Conor Dooley 2021-05-11 125
de5473936808627f Conor Dooley 2021-05-11 126 return 0;
de5473936808627f Conor Dooley 2021-05-11 127 }
de5473936808627f Conor Dooley 2021-05-11 128
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31493 bytes --]
reply other threads:[~2021-06-21 19:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202106220338.PyY0SR4F-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.