From: kernel test robot <lkp@intel.com>
To: Russ Weight <russell.h.weight@intel.com>,
mdf@kernel.org, linux-fpga@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
trix@redhat.com, lgoncalv@redhat.com, yilun.xu@intel.com,
hao.wu@intel.com, matthew.gerlach@intel.com,
richard.gong@intel.com, Russ Weight <russell.h.weight@intel.com>
Subject: Re: [PATCH v1 1/3] fpga: mgr: Use standard dev_release for class driver
Date: Sun, 23 May 2021 04:35:46 +0800 [thread overview]
Message-ID: <202105230422.J3kpuvPD-lkp@intel.com> (raw)
In-Reply-To: <20210521010359.635717-2-russell.h.weight@intel.com>
[-- Attachment #1: Type: text/plain, Size: 8019 bytes --]
Hi Russ,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.13-rc2 next-20210521]
[cannot apply to xlnx/master]
[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/Russ-Weight/fpga-Use-standard-class-dev_release-function/20210522-205631
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: x86_64-randconfig-a014-20210522 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e84a9b9bb3051c35dea993cdad7b3d2575638f85)
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/fe4ee184f8a9b9acbf00d536ec38d8d793f8dcee
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Russ-Weight/fpga-Use-standard-class-dev_release-function/20210522-205631
git checkout fe4ee184f8a9b9acbf00d536ec38d8d793f8dcee
# 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/fpga/fpga-mgr.c:581:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (id < 0)
^~~~~~
drivers/fpga/fpga-mgr.c:620:17: note: uninitialized use occurs here
return ERR_PTR(ret);
^~~
drivers/fpga/fpga-mgr.c:581:2: note: remove the 'if' if its condition is always false
if (id < 0)
^~~~~~~~~~~
drivers/fpga/fpga-mgr.c:562:13: note: initialize the variable 'ret' to silence this warning
int id, ret;
^
= 0
1 warning generated.
vim +581 drivers/fpga/fpga-mgr.c
ebf877a51ad7b6 Alan Tull 2017-11-15 547
6a8c3be7ec8eb3 Alan Tull 2015-10-07 548 /**
fe4ee184f8a9b9 Russ Weight 2021-05-20 549 * fpga_mgr_register - create and register a FPGA manager struct
6a8c3be7ec8eb3 Alan Tull 2015-10-07 550 * @dev: fpga manager device from pdev
6a8c3be7ec8eb3 Alan Tull 2015-10-07 551 * @name: fpga manager name
6a8c3be7ec8eb3 Alan Tull 2015-10-07 552 * @mops: pointer to structure of fpga manager ops
6a8c3be7ec8eb3 Alan Tull 2015-10-07 553 * @priv: fpga manager private data
6a8c3be7ec8eb3 Alan Tull 2015-10-07 554 *
fe4ee184f8a9b9 Russ Weight 2021-05-20 555 * Returns a struct fpga_manager pointer on success, or ERR_PTR() on error.
6a8c3be7ec8eb3 Alan Tull 2015-10-07 556 */
fe4ee184f8a9b9 Russ Weight 2021-05-20 557 struct fpga_manager *
fe4ee184f8a9b9 Russ Weight 2021-05-20 558 fpga_mgr_register(struct device *dev, const char *name,
fe4ee184f8a9b9 Russ Weight 2021-05-20 559 const struct fpga_manager_ops *mops, void *priv)
6a8c3be7ec8eb3 Alan Tull 2015-10-07 560 {
6a8c3be7ec8eb3 Alan Tull 2015-10-07 561 struct fpga_manager *mgr;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 562 int id, ret;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 563
baa6d396635129 Jason Gunthorpe 2017-02-01 564 if (!mops || !mops->write_complete || !mops->state ||
baa6d396635129 Jason Gunthorpe 2017-02-01 565 !mops->write_init || (!mops->write && !mops->write_sg) ||
baa6d396635129 Jason Gunthorpe 2017-02-01 566 (mops->write && mops->write_sg)) {
6a8c3be7ec8eb3 Alan Tull 2015-10-07 567 dev_err(dev, "Attempt to register without fpga_manager_ops\n");
fe4ee184f8a9b9 Russ Weight 2021-05-20 568 return ERR_PTR(-EINVAL);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 569 }
6a8c3be7ec8eb3 Alan Tull 2015-10-07 570
6a8c3be7ec8eb3 Alan Tull 2015-10-07 571 if (!name || !strlen(name)) {
6a8c3be7ec8eb3 Alan Tull 2015-10-07 572 dev_err(dev, "Attempt to register with no name!\n");
fe4ee184f8a9b9 Russ Weight 2021-05-20 573 return ERR_PTR(-EINVAL);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 574 }
6a8c3be7ec8eb3 Alan Tull 2015-10-07 575
6a8c3be7ec8eb3 Alan Tull 2015-10-07 576 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 577 if (!mgr)
fe4ee184f8a9b9 Russ Weight 2021-05-20 578 return ERR_PTR(-ENOMEM);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 579
6a8c3be7ec8eb3 Alan Tull 2015-10-07 580 id = ida_simple_get(&fpga_mgr_ida, 0, 0, GFP_KERNEL);
88aaab9218f87c Tom Rix 2020-06-08 @581 if (id < 0)
6a8c3be7ec8eb3 Alan Tull 2015-10-07 582 goto error_kfree;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 583
6a8c3be7ec8eb3 Alan Tull 2015-10-07 584 mutex_init(&mgr->ref_mutex);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 585
6a8c3be7ec8eb3 Alan Tull 2015-10-07 586 mgr->name = name;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 587 mgr->mops = mops;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 588 mgr->priv = priv;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 589
6a8c3be7ec8eb3 Alan Tull 2015-10-07 590 mgr->dev.class = fpga_mgr_class;
845089bbf589be Alan Tull 2017-11-15 591 mgr->dev.groups = mops->groups;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 592 mgr->dev.parent = dev;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 593 mgr->dev.of_node = dev->of_node;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 594 mgr->dev.id = id;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 595
6a8c3be7ec8eb3 Alan Tull 2015-10-07 596 ret = dev_set_name(&mgr->dev, "fpga%d", id);
07687c031d14a1 Alan Tull 2015-10-29 597 if (ret)
07687c031d14a1 Alan Tull 2015-10-29 598 goto error_device;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 599
7085e2a94f7df5 Alan Tull 2018-05-16 600 /*
7085e2a94f7df5 Alan Tull 2018-05-16 601 * Initialize framework state by requesting low level driver read state
7085e2a94f7df5 Alan Tull 2018-05-16 602 * from device. FPGA may be in reset mode or may have been programmed
7085e2a94f7df5 Alan Tull 2018-05-16 603 * by bootloader or EEPROM.
7085e2a94f7df5 Alan Tull 2018-05-16 604 */
7085e2a94f7df5 Alan Tull 2018-05-16 605 mgr->state = mgr->mops->state(mgr);
7085e2a94f7df5 Alan Tull 2018-05-16 606
fe4ee184f8a9b9 Russ Weight 2021-05-20 607 ret = device_register(&mgr->dev);
fe4ee184f8a9b9 Russ Weight 2021-05-20 608 if (ret) {
fe4ee184f8a9b9 Russ Weight 2021-05-20 609 put_device(&mgr->dev);
fe4ee184f8a9b9 Russ Weight 2021-05-20 610 return ERR_PTR(ret);
fe4ee184f8a9b9 Russ Weight 2021-05-20 611 }
6a8c3be7ec8eb3 Alan Tull 2015-10-07 612
fe4ee184f8a9b9 Russ Weight 2021-05-20 613 return mgr;
6a8c3be7ec8eb3 Alan Tull 2015-10-07 614
6a8c3be7ec8eb3 Alan Tull 2015-10-07 615 error_device:
fe4ee184f8a9b9 Russ Weight 2021-05-20 616 ida_simple_remove(&fpga_mgr_ida, id);
fe4ee184f8a9b9 Russ Weight 2021-05-20 617 error_kfree:
fe4ee184f8a9b9 Russ Weight 2021-05-20 618 kfree(mgr);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 619
fe4ee184f8a9b9 Russ Weight 2021-05-20 620 return ERR_PTR(ret);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 621 }
6a8c3be7ec8eb3 Alan Tull 2015-10-07 622 EXPORT_SYMBOL_GPL(fpga_mgr_register);
6a8c3be7ec8eb3 Alan Tull 2015-10-07 623
---
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: 40776 bytes --]
next prev parent reply other threads:[~2021-05-22 20:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 1:03 [PATCH v1 0/3] fpga: Use standard class dev_release function Russ Weight
2021-05-21 1:03 ` [PATCH v1 1/3] fpga: mgr: Use standard dev_release for class driver Russ Weight
2021-05-21 15:27 ` Xu Yilun
2021-05-21 16:30 ` Moritz Fischer
2021-05-21 16:33 ` Russ Weight
2021-05-22 20:35 ` kernel test robot [this message]
2021-05-24 0:55 ` kernel test robot
2021-05-21 1:03 ` [PATCH v1 2/3] fpga: bridge: " Russ Weight
2021-05-21 1:03 ` [PATCH v1 3/3] fpga: region: " Russ Weight
2021-05-22 23:30 ` kernel test robot
2021-05-22 23:31 ` kernel test robot
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=202105230422.J3kpuvPD-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=hao.wu@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=lgoncalv@redhat.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.gerlach@intel.com \
--cc=mdf@kernel.org \
--cc=richard.gong@intel.com \
--cc=russell.h.weight@intel.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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;
as well as URLs for NNTP newsgroup(s).