All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/kernel/setup_64.c:1168:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
@ 2020-12-30 12:53 kernel test robot
  2020-12-30 12:53 ` [PATCH] powerpc: fix debugfs_simple_attr.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-12-30 12:53 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Michael Ellerman <mpe@ellerman.id.au>

Hi Michael,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   139711f033f636cc78b6aaf7363252241b9698ef
commit: 178d52c6e89c38d0553b0ac8b99927b11eb995b0 powerpc: Only include kup-radix.h for 64-bit Book3S
date:   6 weeks ago
:::::: branch date: 13 hours ago
:::::: commit date: 6 weeks ago
config: powerpc-randconfig-c003-20201230 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.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>


"coccinelle warnings: (new ones prefixed by >>)"
>> arch/powerpc/kernel/setup_64.c:1168:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
   arch/powerpc/kernel/setup_64.c:1142:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
>> arch/powerpc/kernel/setup_64.c:1194:0-23: WARNING: fops_uaccess_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24481 bytes --]

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

* [PATCH] powerpc: fix debugfs_simple_attr.cocci warnings
  2020-12-30 12:53 arch/powerpc/kernel/setup_64.c:1168:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
@ 2020-12-30 12:53 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-12-30 12:53 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Michael Ellerman <mpe@ellerman.id.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Nicholas Piggin <npiggin@gmail.com>
CC: Daniel Axtens <dja@axtens.net>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
CC: Christophe Leroy <christophe.leroy@c-s.fr>
CC: Mike Rapoport <rppt@kernel.org>
CC: Chris Packham <chris.packham@alliedtelesis.co.nz>
CC: linuxppc-dev(a)lists.ozlabs.org

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

arch/powerpc/kernel/setup_64.c:1168:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/setup_64.c:1142:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/setup_64.c:1194:0-23: WARNING: fops_uaccess_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE

 Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
 for debugfs files.

Semantic patch information:
 Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
 imposes some significant overhead as compared to
 DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Fixes: 178d52c6e89c ("powerpc: Only include kup-radix.h for 64-bit Book3S")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   139711f033f636cc78b6aaf7363252241b9698ef
commit: 178d52c6e89c38d0553b0ac8b99927b11eb995b0 powerpc: Only include kup-radix.h for 64-bit Book3S
:::::: branch date: 13 hours ago
:::::: commit date: 6 weeks ago

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

 setup_64.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -1139,7 +1139,8 @@ static int rfi_flush_get(void *data, u64
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_rfi_flush, rfi_flush_get, rfi_flush_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_rfi_flush, rfi_flush_get, rfi_flush_set,
+			 "%llu\n");
 
 static int entry_flush_set(void *data, u64 val)
 {
@@ -1165,7 +1166,8 @@ static int entry_flush_get(void *data, u
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_entry_flush, entry_flush_get, entry_flush_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_entry_flush, entry_flush_get, entry_flush_set,
+			 "%llu\n");
 
 static int uaccess_flush_set(void *data, u64 val)
 {
@@ -1191,13 +1193,18 @@ static int uaccess_flush_get(void *data,
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_uaccess_flush, uaccess_flush_get, uaccess_flush_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_uaccess_flush, uaccess_flush_get,
+			 uaccess_flush_set, "%llu\n");
 
 static __init int rfi_flush_debugfs_init(void)
 {
-	debugfs_create_file("rfi_flush", 0600, powerpc_debugfs_root, NULL, &fops_rfi_flush);
-	debugfs_create_file("entry_flush", 0600, powerpc_debugfs_root, NULL, &fops_entry_flush);
-	debugfs_create_file("uaccess_flush", 0600, powerpc_debugfs_root, NULL, &fops_uaccess_flush);
+	debugfs_create_file_unsafe("rfi_flush", 0600, powerpc_debugfs_root,
+				   NULL, &fops_rfi_flush);
+	debugfs_create_file_unsafe("entry_flush", 0600, powerpc_debugfs_root,
+				   NULL, &fops_entry_flush);
+	debugfs_create_file_unsafe("uaccess_flush", 0600,
+				   powerpc_debugfs_root, NULL,
+				   &fops_uaccess_flush);
 	return 0;
 }
 device_initcall(rfi_flush_debugfs_init);

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

end of thread, other threads:[~2020-12-30 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 12:53 arch/powerpc/kernel/setup_64.c:1168:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
2020-12-30 12:53 ` [PATCH] powerpc: fix debugfs_simple_attr.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.