From: kernel test robot <lkp@intel.com>
To: Lukasz Luba <l.luba@partner.samsung.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>
Subject: drivers/devfreq/event/exynos-ppmu.c:529:21: warning: cast to smaller integer type 'enum exynos_ppmu_type' from 'const void *'
Date: Thu, 27 Feb 2025 22:18:36 +0800 [thread overview]
Message-ID: <202502272210.guXvXlHo-lkp@intel.com> (raw)
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@intel.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
reply other threads:[~2025-02-27 14:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202502272210.guXvXlHo-lkp@intel.com \
--to=lkp@intel.com \
--cc=cw00.choi@samsung.com \
--cc=l.luba@partner.samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=myungjoo.ham@samsung.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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
all inboxes | Powered by JetHome®