All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel_pmc_core: fix kobj_to_dev.cocci warnings
  2022-04-26 11:23 [intel-lts:5.10/yocto 2/21] drivers/platform/x86/intel/pmc/core.c:702:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
@ 2022-04-26 11:21 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-04-26 11:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "Dutta, Ranjan" <ranjan.dutta@intel.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

From: kernel test robot <lkp@intel.com>

drivers/platform/x86/intel/pmc/core.c:702:60-61: WARNING opportunity for kobj_to_dev()


 Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

CC: Kate Hsuan <hpa@redhat.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://github.com/intel/linux-intel-lts.git 5.10/yocto
head:   6410aba3b60feba47b9713f297d9b3bdb79981f5
commit: 7dedd84bf98ed8d614e6803403d773c9566b333a [2/21] platform/x86: intel_pmc_core: Move to intel sub-directory
:::::: branch date: 6 days ago
:::::: commit date: 7 months ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/platform/x86/intel/pmc/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -699,7 +699,7 @@ static umode_t etr3_is_visible(struct ko
 				struct attribute *attr,
 				int idx)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct pmc_dev *pmcdev = dev_get_drvdata(dev);
 	const struct pmc_reg_map *map = pmcdev->map;
 	u32 reg;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [intel-lts:5.10/yocto 2/21] drivers/platform/x86/intel/pmc/core.c:702:60-61: WARNING opportunity for kobj_to_dev()
@ 2022-04-26 11:23 kernel test robot
  2022-04-26 11:21 ` [PATCH] platform/x86: intel_pmc_core: fix kobj_to_dev.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-04-26 11:23 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "Dutta, Ranjan" <ranjan.dutta@intel.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

tree:   https://github.com/intel/linux-intel-lts.git 5.10/yocto
head:   6410aba3b60feba47b9713f297d9b3bdb79981f5
commit: 7dedd84bf98ed8d614e6803403d773c9566b333a [2/21] platform/x86: intel_pmc_core: Move to intel sub-directory
:::::: branch date: 6 days ago
:::::: commit date: 7 months ago
config: i386-randconfig-c021-20220425 (https://download.01.org/0day-ci/archive/20220426/202204261959.XjOAEMVu-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/platform/x86/intel/pmc/core.c:702:60-61: WARNING opportunity for kobj_to_dev()

Please review and possibly fold the followup patch.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-26 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 11:23 [intel-lts:5.10/yocto 2/21] drivers/platform/x86/intel/pmc/core.c:702:60-61: WARNING opportunity for kobj_to_dev() kernel test robot
2022-04-26 11:21 ` [PATCH] platform/x86: intel_pmc_core: fix kobj_to_dev.cocci warnings 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.