From: kernel test robot <lkp@intel.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-kernel@vger.kernel.org,
Florian Fainelli <f.fainelli@gmail.com>
Subject: drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of array 'match->compatible' will always evaluate to 'true'
Date: Fri, 7 Aug 2020 20:17:57 +0800 [thread overview]
Message-ID: <202008072055.wnJA8q5i%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3163 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 86cfccb66937dd6cbf26ed619958b9e587e6a115
commit: 0b0e299720bb99428892a23ecbd2b4b7f61ccf6d net: dsa: sja1105: use detected device id instead of DT one on mismatch
date: 2 days ago
config: riscv-randconfig-r034-20200807 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project aa57cabae2fc5abc08ab3e17b45f2890fc7c9e42)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
git checkout 0b0e299720bb99428892a23ecbd2b4b7f61ccf6d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
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/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of array 'match->compatible' will always evaluate to 'true' [-Wpointer-bool-conversion]
for (match = sja1105_dt_ids; match->compatible; match++) {
~~~ ~~~~~~~^~~~~~~~~~
1 warning generated.
vim +3418 drivers/net/dsa/sja1105/sja1105_main.c
3395
3396 static int sja1105_check_device_id(struct sja1105_private *priv)
3397 {
3398 const struct sja1105_regs *regs = priv->info->regs;
3399 u8 prod_id[SJA1105_SIZE_DEVICE_ID] = {0};
3400 struct device *dev = &priv->spidev->dev;
3401 const struct of_device_id *match;
3402 u32 device_id;
3403 u64 part_no;
3404 int rc;
3405
3406 rc = sja1105_xfer_u32(priv, SPI_READ, regs->device_id, &device_id,
3407 NULL);
3408 if (rc < 0)
3409 return rc;
3410
3411 rc = sja1105_xfer_buf(priv, SPI_READ, regs->prod_id, prod_id,
3412 SJA1105_SIZE_DEVICE_ID);
3413 if (rc < 0)
3414 return rc;
3415
3416 sja1105_unpack(prod_id, &part_no, 19, 4, SJA1105_SIZE_DEVICE_ID);
3417
> 3418 for (match = sja1105_dt_ids; match->compatible; match++) {
3419 const struct sja1105_info *info = match->data;
3420
3421 /* Is what's been probed in our match table at all? */
3422 if (info->device_id != device_id || info->part_no != part_no)
3423 continue;
3424
3425 /* But is it what's in the device tree? */
3426 if (priv->info->device_id != device_id ||
3427 priv->info->part_no != part_no) {
3428 dev_warn(dev, "Device tree specifies chip %s but found %s, please fix it!\n",
3429 priv->info->name, info->name);
3430 /* It isn't. No problem, pick that up. */
3431 priv->info = info;
3432 }
3433
3434 return 0;
3435 }
3436
3437 dev_err(dev, "Unexpected {device ID, part number}: 0x%x 0x%llx\n",
3438 device_id, part_no);
3439
3440 return -ENODEV;
3441 }
3442
---
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: 32113 bytes --]
reply other threads:[~2020-08-07 12:18 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=202008072055.wnJA8q5i%lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=f.fainelli@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olteanv@gmail.com \
/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
all inboxes | Powered by JetHome®