* [asahilinux:dart/dev 3/4] drivers/iommu/apple-dart-iommu.c:776:52: warning: variable 'i' is uninitialized when used here
@ 2021-05-31 0:38 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-31 0:38 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4066 bytes --]
tree: https://github.com/AsahiLinux/linux dart/dev
head: 8e50fc895233f960967b879dbcccf85f20da023f
commit: fccb340722b1082ef97d03a0f1427ef2ee9d5e32 [3/4] iommu: dart: Add DART iommu driver
config: arm64-randconfig-r014-20210531 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bc6799f2f79f0ae87e9f1ebf9d25ba799fbd25a9)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/AsahiLinux/linux/commit/fccb340722b1082ef97d03a0f1427ef2ee9d5e32
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux dart/dev
git checkout fccb340722b1082ef97d03a0f1427ef2ee9d5e32
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
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/iommu/apple-dart-iommu.c:776:52: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
^
drivers/iommu/apple-dart-iommu.c:760:7: note: initialize the variable 'i' to silence this warning
int i;
^
= 0
1 warning generated.
vim +/i +776 drivers/iommu/apple-dart-iommu.c
756
757 static int apple_dart_probe(struct platform_device *pdev)
758 {
759 int ret;
760 int i;
761 u32 dart_info;
762 struct resource *res;
763 struct apple_dart *dart;
764 struct device *dev = &pdev->dev;
765
766 dart = devm_kzalloc(dev, sizeof(*dart), GFP_KERNEL);
767 if (!dart)
768 return -ENOMEM;
769
770 dart->dev = dev;
771 spin_lock_init(&dart->lock);
772
773 if (pdev->num_resources < 1)
774 return -ENODEV;
775
> 776 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
777 if (resource_size(res) < 0x4000) {
778 dev_err(dev, "MMIO region too small (%pr)\n", res);
779 return -EINVAL;
780 }
781
782 dart->regs = devm_ioremap_resource(dev, res);
783 if (IS_ERR(dart->regs))
784 return PTR_ERR(dart->regs);
785
786 ret = devm_clk_bulk_get_all(dev, &dart->clks);
787 if (ret < 0)
788 return ret;
789 dart->num_clks = ret;
790
791 ret = clk_bulk_prepare_enable(dart->num_clks, dart->clks);
792 if (ret)
793 return ret;
794
795 ret = apple_dart_hw_reset(dart);
796 if (ret)
797 return ret;
798
799 dart_info = readl(dart->regs + DART_INFO);
800 dart->pgsize = 1 << FIELD_GET(DART_INFO_PAGE_SHIFT, dart_info);
801
802 dart->irq = platform_get_irq(pdev, 0);
803 if (dart->irq < 0)
804 return -ENODEV;
805
806 ret = devm_request_irq(dart->dev, dart->irq, apple_dart_irq,
807 IRQF_SHARED, "apple-dart fault handler", dart);
808 if (ret)
809 return ret;
810
811 platform_set_drvdata(pdev, dart);
812
813 ret = iommu_device_sysfs_add(&dart->iommu, dev, NULL, "apple-dart.%s",
814 dev_name(&pdev->dev));
815 if (ret)
816 return ret;
817
818 ret = iommu_device_register(&dart->iommu, &apple_dart_iommu_ops, dev);
819 if (ret)
820 return ret;
821
822 if (dev->bus->iommu_ops != &apple_dart_iommu_ops) {
823 ret = bus_set_iommu(dev->bus, &apple_dart_iommu_ops);
824 if (ret)
825 return ret;
826 }
827
828 return 0;
829 }
830
---
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: 42712 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-31 0:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 0:38 [asahilinux:dart/dev 3/4] drivers/iommu/apple-dart-iommu.c:776:52: warning: variable 'i' is uninitialized when used here kernel test robot
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.