Re: [PATCH v3 20/22] ACPI: platform_profile: Register class device for platform profile handlers
From: kernel test robot
Date: Fri Nov 01 2024 - 11:46:02 EST
Hi Mario,
kernel test robot noticed the following build errors:
[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on rafael-pm/bleeding-edge linus/master v6.12-rc5 next-20241101]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/ACPI-platform-profile-Add-a-name-member-to-handlers/20241031-121650
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20241031040952.109057-21-mario.limonciello%40amd.com
patch subject: [PATCH v3 20/22] ACPI: platform_profile: Register class device for platform profile handlers
config: x86_64-buildonly-randconfig-005-20241101 (https://download.01.org/0day-ci/archive/20241101/202411012317.1pQLOspC-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411012317.1pQLOspC-lkp@xxxxxxxxx/reproduce)
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
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411012317.1pQLOspC-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
drivers/acpi/platform_profile.c: In function 'platform_profile_register':
>> drivers/acpi/platform_profile.c:303:42: error: implicit declaration of function 'MKDEV' [-Werror=implicit-function-declaration]
303 | MKDEV(0, pprof->minor), NULL, "platform-profile-%s",
| ^~~~~
cc1: some warnings being treated as errors
vim +/MKDEV +303 drivers/acpi/platform_profile.c
261
262 int platform_profile_register(struct platform_profile_handler *pprof)
263 {
264 bool registered;
265 int err;
266
267 /* Sanity check the profile handler */
268 if (!pprof || bitmap_empty(pprof->choices, PLATFORM_PROFILE_LAST) ||
269 !pprof->profile_set || !pprof->profile_get) {
270 pr_err("platform_profile: handler is invalid\n");
271 return -EINVAL;
272 }
273 if (!test_bit(PLATFORM_PROFILE_BALANCED, pprof->choices)) {
274 pr_err("platform_profile: handler does not support balanced profile\n");
275 return -EINVAL;
276 }
277 if (!pprof->dev) {
278 pr_err("platform_profile: handler device is not set\n");
279 return -EINVAL;
280 }
281
282 guard(mutex)(&profile_lock);
283 /* We can only have one active profile */
284 if (cur_profile)
285 return -EEXIST;
286
287 registered = platform_profile_is_registered();
288 if (!registered) {
289 /* class for individual handlers */
290 err = class_register(&platform_profile_class);
291 if (err)
292 return err;
293 /* legacy sysfs files */
294 err = sysfs_create_group(acpi_kobj, &platform_profile_group);
295 if (err)
296 goto cleanup_class;
297
298 }
299
300 /* create class interface for individual handler */
301 pprof->minor = idr_alloc(&platform_profile_minor_idr, pprof, 0, 0, GFP_KERNEL);
302 pprof->class_dev = device_create(&platform_profile_class, pprof->dev,
> 303 MKDEV(0, pprof->minor), NULL, "platform-profile-%s",
304 pprof->name);
305 if (IS_ERR(pprof->class_dev)) {
306 err = PTR_ERR(pprof->class_dev);
307 goto cleanup_legacy;
308 }
309 err = sysfs_create_group(&pprof->class_dev->kobj, &platform_profile_group);
310 if (err)
311 goto cleanup_device;
312
313 list_add_tail(&pprof->list, &platform_profile_handler_list);
314 sysfs_notify(acpi_kobj, NULL, "platform_profile");
315
316 cur_profile = pprof;
317 return 0;
318
319 cleanup_device:
320 device_destroy(&platform_profile_class, MKDEV(0, pprof->minor));
321
322 cleanup_legacy:
323 if (!registered)
324 sysfs_remove_group(acpi_kobj, &platform_profile_group);
325 cleanup_class:
326 if (!registered)
327 class_unregister(&platform_profile_class);
328
329 return err;
330 }
331 EXPORT_SYMBOL_GPL(platform_profile_register);
332
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki