* drivers/resctrl/mpam_devices.c:127:35-38: WARNING: Suspicious code. resource_size is maybe missing with msc_res
@ 2026-11-27 19:57 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-27 19:57 UTC (permalink / raw)
To: James Morse
Cc: oe-kbuild-all, linux-kernel, Catalin Marinas, Jonathan Cameron,
Fenghua Yu, Shaopeng Tan, Ben Horgan
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 822ba3a89c7896b26e4beb70e2ebffb881924dfe
commit: f04046f2577a5c76167333ca99d3903ee5331ba0 arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate
date: 1 year ago
config: arm64-randconfig-r2111-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127205221.92qYTzCE-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 3a9f981aab0cc32f74ffac36a87891cda8889c37)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: f04046f2577a ("arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261127205221.92qYTzCE-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/resctrl/mpam_devices.c:127:35-38: WARNING: Suspicious code. resource_size is maybe missing with msc_res
vim +127 drivers/resctrl/mpam_devices.c
79
80 static struct mpam_msc *do_mpam_msc_drv_probe(struct platform_device *pdev)
81 {
82 int err;
83 u32 tmp;
84 struct mpam_msc *msc;
85 struct resource *msc_res;
86 struct device *dev = &pdev->dev;
87
88 lockdep_assert_held(&mpam_list_lock);
89
90 msc = devm_kzalloc(&pdev->dev, sizeof(*msc), GFP_KERNEL);
91 if (!msc)
92 return ERR_PTR(-ENOMEM);
93
94 err = devm_mutex_init(dev, &msc->probe_lock);
95 if (err)
96 return ERR_PTR(err);
97
98 err = devm_mutex_init(dev, &msc->part_sel_lock);
99 if (err)
100 return ERR_PTR(err);
101
102 msc->id = pdev->id;
103 msc->pdev = pdev;
104 INIT_LIST_HEAD_RCU(&msc->all_msc_list);
105 INIT_LIST_HEAD_RCU(&msc->ris);
106
107 update_msc_accessibility(msc);
108 if (cpumask_empty(&msc->accessibility)) {
109 dev_err_once(dev, "MSC is not accessible from any CPU!");
110 return ERR_PTR(-EINVAL);
111 }
112
113 if (device_property_read_u32(&pdev->dev, "pcc-channel", &tmp))
114 msc->iface = MPAM_IFACE_MMIO;
115 else
116 msc->iface = MPAM_IFACE_PCC;
117
118 if (msc->iface == MPAM_IFACE_MMIO) {
119 void __iomem *io;
120
121 io = devm_platform_get_and_ioremap_resource(pdev, 0,
122 &msc_res);
123 if (IS_ERR(io)) {
124 dev_err_once(dev, "Failed to map MSC base address\n");
125 return ERR_CAST(io);
126 }
> 127 msc->mapped_hwpage_sz = msc_res->end - msc_res->start;
128 msc->mapped_hwpage = io;
129 } else {
130 return ERR_PTR(-EINVAL);
131 }
132
133 list_add_rcu(&msc->all_msc_list, &mpam_all_msc);
134 platform_set_drvdata(pdev, msc);
135
136 return msc;
137 }
138
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-27 19:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 19:57 drivers/resctrl/mpam_devices.c:127:35-38: WARNING: Suspicious code. resource_size is maybe missing with msc_res 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.