From: kernel test robot <lkp@intel.com>
To: Nicolas Pitre <nico@fluxnic.net>,
Boris Brezillon <bbrezillon@kernel.org>,
linux-i3c@lists.infradead.org, devicetree@vger.kernel.org
Cc: kbuild-all@lists.01.org, Robert Gough <robert.gough@intel.com>,
Laura Nixon <laura.nixon@team.mipi.org>,
Nicolas Pitre <npitre@baylibre.com>,
clang-built-linux@googlegroups.com,
Rob Herring <robh+dt@kernel.org>,
Sakari Ailus <sakari.ailus@iki.fi>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Matthew Schnoor <matthew.schnoor@intel.com>
Subject: Re: [PATCH v3 2/2] i3c/master: introduce the mipi-i3c-hci driver
Date: Tue, 10 Nov 2020 19:09:22 +0800 [thread overview]
Message-ID: <202011101926.jGLulDPn-lkp@intel.com> (raw)
In-Reply-To: <20201102222220.1785859-3-nico@fluxnic.net>
[-- Attachment #1: Type: text/plain, Size: 4638 bytes --]
Hi Nicolas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.10-rc3 next-20201110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Nicolas-Pitre/MIPI-I3c-HCI-Host-Controller-Interface-driver/20201103-062951
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-randconfig-a015-20201110 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4d81c8adb6ed9840257f6cb6b93f60856d422a15)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/22eb21b92e463c7030855ecf6dfd5d6f187249a1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nicolas-Pitre/MIPI-I3c-HCI-Host-Controller-Interface-driver/20201103-062951
git checkout 22eb21b92e463c7030855ecf6dfd5d6f187249a1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/i3c/master/mipi-i3c-hci/cmd_v2.c:248:6: warning: variable 'next_addr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!xfer)
^~~~~
drivers/i3c/master/mipi-i3c-hci/cmd_v2.c:258:48: note: uninitialized use occurs here
ret = i3c_master_get_free_addr(&hci->master, next_addr);
^~~~~~~~~
drivers/i3c/master/mipi-i3c-hci/cmd_v2.c:248:2: note: remove the 'if' if its condition is always true
if (!xfer)
^~~~~~~~~~
drivers/i3c/master/mipi-i3c-hci/cmd_v2.c:243:14: note: initialize the variable 'next_addr' to silence this warning
u8 next_addr;
^
= '\0'
1 warning generated.
vim +248 drivers/i3c/master/mipi-i3c-hci/cmd_v2.c
238
239 static int hci_cmd_v2_daa(struct i3c_hci *hci)
240 {
241 struct hci_xfer *xfer;
242 int ret;
243 u8 next_addr;
244 u32 device_id[2];
245 DECLARE_COMPLETION_ONSTACK(done);
246
247 xfer = hci_alloc_xfer(2);
> 248 if (!xfer)
249 return -ENOMEM;
250
251 xfer[0].data = &device_id;
252 xfer[0].data_len = 8;
253 xfer[0].rnw = true;
254 xfer[0].cmd_desc[1] = CMD_A1_DATA_LENGTH(8);
255 xfer[1].completion = &done;
256
257 for (;;) {
258 ret = i3c_master_get_free_addr(&hci->master, next_addr);
259 if (ret < 0)
260 break;
261 next_addr = ret;
262 DBG("next_addr = 0x%02x", next_addr);
263 xfer[0].cmd_tid = hci_get_tid();
264 xfer[0].cmd_desc[0] =
265 CMD_0_ATTR_A |
266 CMD_A0_TID(xfer[0].cmd_tid) |
267 CMD_A0_ROC;
268 xfer[1].cmd_tid = hci_get_tid();
269 xfer[1].cmd_desc[0] =
270 CMD_0_ATTR_A |
271 CMD_A0_TID(xfer[1].cmd_tid) |
272 CMD_A0_ASSIGN_ADDRESS(next_addr) |
273 CMD_A0_ROC |
274 CMD_A0_TOC;
275 hci->io->queue_xfer(hci, xfer, 2);
276 if (!wait_for_completion_timeout(&done, HZ) &&
277 hci->io->dequeue_xfer(hci, xfer, 2)) {
278 ret = -ETIME;
279 break;
280 }
281 if (RESP_STATUS(xfer[0].response) != RESP_SUCCESS) {
282 ret = 0; /* no more devices to be assigned */
283 break;
284 }
285 if (RESP_STATUS(xfer[1].response) != RESP_SUCCESS) {
286 ret = -EIO;
287 break;
288 }
289 DBG("assigned address %#x to device %08x %08x",
290 next_addr, device_id[0], device_id[1]);
291 /*
292 * TODO: Extend the subsystem layer to allow for registering
293 * new device and provide BCR/DCR/PID at the same time.
294 */
295 ret = i3c_master_add_i3c_dev_locked(&hci->master, next_addr);
296 if (ret)
297 break;
298 }
299
300 hci_free_xfer(xfer, 2);
301 return ret;
302 }
303
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32172 bytes --]
[-- Attachment #3: Type: text/plain, Size: 111 bytes --]
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
prev parent reply other threads:[~2020-11-25 9:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 22:22 [PATCH v3 0/2] MIPI I3c HCI (Host Controller Interface) driver Nicolas Pitre
2020-11-02 22:22 ` [PATCH v3 1/2] dt-bindings: i3c: MIPI I3C Host Controller Interface Nicolas Pitre
2020-11-04 18:33 ` Rob Herring
2020-11-04 18:34 ` Rob Herring
2020-11-04 19:28 ` Nicolas Pitre
2020-11-02 22:22 ` [PATCH v3 2/2] i3c/master: introduce the mipi-i3c-hci driver Nicolas Pitre
2020-11-10 11:09 ` kernel test robot [this message]
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=202011101926.jGLulDPn-lkp@intel.com \
--to=lkp@intel.com \
--cc=bbrezillon@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=devicetree@vger.kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=laura.nixon@team.mipi.org \
--cc=linux-i3c@lists.infradead.org \
--cc=matthew.schnoor@intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=nico@fluxnic.net \
--cc=npitre@baylibre.com \
--cc=robert.gough@intel.com \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@iki.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).