All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
@ 2021-09-13 10:21 kernel test robot
  2021-09-13 10:22 ` [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings kernel test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-09-13 10:21 UTC (permalink / raw)
  To: kbuild

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

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
commit: c6b4c9147f8b85d159f670d7bce71a93d16062a2 powerpc/64: Move security code into security.c
date:   5 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 5 months ago
config: powerpc64-randconfig-c003-20210912 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 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 >>)
>> arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
>> arch/powerpc/kernel/security.c:781:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
>> arch/powerpc/kernel/security.c:833: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: 35044 bytes --]

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

* [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings
  2021-09-13 10:21 arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
@ 2021-09-13 10:22 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-13 10:22 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3399 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: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:781:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:833: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: c6b4c9147f8b ("powerpc/64: Move security code into security.c")
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:   6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
commit: c6b4c9147f8b85d159f670d7bce71a93d16062a2 powerpc/64: Move security code into security.c
:::::: branch date: 11 hours ago
:::::: commit date: 5 months ago

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

 security.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -778,7 +778,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)
 {
@@ -804,7 +805,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)
 {
@@ -830,13 +832,17 @@ 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, arch_debugfs_dir, NULL, &fops_rfi_flush);
-	debugfs_create_file("entry_flush", 0600, arch_debugfs_dir, NULL, &fops_entry_flush);
-	debugfs_create_file("uaccess_flush", 0600, arch_debugfs_dir, NULL, &fops_uaccess_flush);
+	debugfs_create_file_unsafe("rfi_flush", 0600, arch_debugfs_dir, NULL,
+				   &fops_rfi_flush);
+	debugfs_create_file_unsafe("entry_flush", 0600, arch_debugfs_dir,
+				   NULL, &fops_entry_flush);
+	debugfs_create_file_unsafe("uaccess_flush", 0600, arch_debugfs_dir,
+				   NULL, &fops_uaccess_flush);
 	return 0;
 }
 device_initcall(rfi_flush_debugfs_init);

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

* [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings
  2021-06-25 16:34 arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
@ 2021-06-25 16:34 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-06-25 16:34 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3433 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: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:781:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:833: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: c6b4c9147f8b ("powerpc/64: Move security code into security.c")
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:   44db63d1ad8d71c6932cbe007eb41f31c434d140
commit: c6b4c9147f8b85d159f670d7bce71a93d16062a2 powerpc/64: Move security code into security.c
:::::: branch date: 20 hours ago
:::::: commit date: 3 months ago

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

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

--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -778,7 +778,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)
 {
@@ -804,7 +805,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)
 {
@@ -830,13 +832,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] 4+ messages in thread

* [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings
  2021-04-09 16:15 [linux-next:master 11082/11648] arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
@ 2021-04-09 16:15 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-04-09 16:15 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.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: Jordan Niethe <jniethe5@gmail.com>
CC: Alistair Popple <alistair@popple.id.au>
CC: Gustavo Walbon <gwalbon@linux.ibm.com>
CC: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:781:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
arch/powerpc/kernel/security.c:833: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: c6b4c9147f8b ("powerpc/64: Move security code into security.c")
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/next/linux-next.git master
head:   e99d8a8495175df8cb8b739f8cf9b0fc9d0cd3b5
commit: c6b4c9147f8b85d159f670d7bce71a93d16062a2 [11082/11648] powerpc/64: Move security code into security.c
:::::: branch date: 5 hours ago
:::::: commit date: 29 hours ago

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

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

--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -778,7 +778,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)
 {
@@ -804,7 +805,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)
 {
@@ -830,13 +832,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] 4+ messages in thread

end of thread, other threads:[~2021-09-13 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 10:21 arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
2021-09-13 10:22 ` [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-06-25 16:34 arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
2021-06-25 16:34 ` [PATCH] powerpc/64: fix debugfs_simple_attr.cocci warnings kernel test robot
2021-04-09 16:15 [linux-next:master 11082/11648] arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE kernel test robot
2021-04-09 16:15 ` [PATCH] powerpc/64: 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.