[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202502272210.guXvXlHo-lkp@intel.com>
Date: Thu, 27 Feb 2025 22:18:36 +0800
From: kernel test robot <lkp@...el.com>
To: Lukasz Luba <l.luba@...tner.samsung.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>
Subject: drivers/devfreq/event/exynos-ppmu.c:529:21: warning: cast to smaller
integer type 'enum exynos_ppmu_type' from 'const void *'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd83757f6e686a2188997cb58b5975f744bb7786
commit: 0ae9c3213c2ca34f7e7ebad1436267778d37ba9f PM / devfreq: exynos-events: change matching code during probe
date: 6 years ago
config: x86_64-buildonly-randconfig-006-20250127 (https://download.01.org/0day-ci/archive/20250227/202502272210.guXvXlHo-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250227/202502272210.guXvXlHo-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502272210.guXvXlHo-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/devfreq/event/exynos-ppmu.c:19:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:20:
include/linux/mm.h:162:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
162 | case 72:
| ^
include/linux/mm.h:162:2: note: insert '__attribute__((fallthrough));' to silence this warning
162 | case 72:
| ^
| __attribute__((fallthrough));
include/linux/mm.h:162:2: note: insert 'break;' to avoid fall-through
162 | case 72:
| ^
| break;
include/linux/mm.h:164:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
164 | case 64:
| ^
include/linux/mm.h:164:2: note: insert '__attribute__((fallthrough));' to silence this warning
164 | case 64:
| ^
| __attribute__((fallthrough));
include/linux/mm.h:164:2: note: insert 'break;' to avoid fall-through
164 | case 64:
| ^
| break;
include/linux/mm.h:166:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
166 | case 56:
| ^
include/linux/mm.h:166:2: note: insert '__attribute__((fallthrough));' to silence this warning
166 | case 56:
| ^
| __attribute__((fallthrough));
include/linux/mm.h:166:2: note: insert 'break;' to avoid fall-through
166 | case 56:
| ^
| break;
>> drivers/devfreq/event/exynos-ppmu.c:529:21: warning: cast to smaller integer type 'enum exynos_ppmu_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
529 | info->ppmu_type = (enum exynos_ppmu_type)of_id->data;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
vim +529 drivers/devfreq/event/exynos-ppmu.c
504
505 static int of_get_devfreq_events(struct device_node *np,
506 struct exynos_ppmu *info)
507 {
508 struct devfreq_event_desc *desc;
509 struct device *dev = info->dev;
510 struct device_node *events_np, *node;
511 int i, j, count;
512 const struct of_device_id *of_id;
513
514 events_np = of_get_child_by_name(np, "events");
515 if (!events_np) {
516 dev_err(dev,
517 "failed to get child node of devfreq-event devices\n");
518 return -EINVAL;
519 }
520
521 count = of_get_child_count(events_np);
522 desc = devm_kcalloc(dev, count, sizeof(*desc), GFP_KERNEL);
523 if (!desc)
524 return -ENOMEM;
525 info->num_events = count;
526
527 of_id = of_match_device(exynos_ppmu_id_match, dev);
528 if (of_id)
> 529 info->ppmu_type = (enum exynos_ppmu_type)of_id->data;
530 else
531 return -EINVAL;
532
533 j = 0;
534 for_each_child_of_node(events_np, node) {
535 for (i = 0; i < ARRAY_SIZE(ppmu_events); i++) {
536 if (!ppmu_events[i].name)
537 continue;
538
539 if (of_node_name_eq(node, ppmu_events[i].name))
540 break;
541 }
542
543 if (i == ARRAY_SIZE(ppmu_events)) {
544 dev_warn(dev,
545 "don't know how to configure events : %pOFn\n",
546 node);
547 continue;
548 }
549
550 switch (info->ppmu_type) {
551 case EXYNOS_TYPE_PPMU:
552 desc[j].ops = &exynos_ppmu_ops;
553 break;
554 case EXYNOS_TYPE_PPMU_V2:
555 desc[j].ops = &exynos_ppmu_v2_ops;
556 break;
557 }
558
559 desc[j].driver_data = info;
560
561 of_property_read_string(node, "event-name", &desc[j].name);
562
563 j++;
564 }
565 info->desc = desc;
566
567 of_node_put(events_np);
568
569 return 0;
570 }
571
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists