From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3371586015957329130==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] selftests/fpu: fix debugfs_simple_attr.cocci warnings Date: Thu, 03 Dec 2020 00:17:17 +0800 Message-ID: <20201202161717.GA16736@22fb0f0fb22e> In-Reply-To: <202012030051.iKVEEK8g-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============3371586015957329130== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Petteri Aimonen CC: Borislav Petkov CC: Nick Desaulniers CC: linux-kernel(a)vger.kernel.org From: kernel test robot lib/test_fpu.c:66:0-23: WARNING: test_fpu_fops should be defined with DEFIN= E_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: 4185b3b92792 ("selftests/fpu: Add an FPU selftest") CC: Petteri Aimonen Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 509a15421674b9e1a3e1916939d0d0efd3e578da commit: 4185b3b92792eaec5869266e594338343421ffb0 selftests/fpu: Add an FPU = selftest :::::: branch date: 17 hours ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! test_fpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/lib/test_fpu.c +++ b/lib/test_fpu.c @@ -63,7 +63,7 @@ static int test_fpu_get(void *data, u64 return status; } = -DEFINE_SIMPLE_ATTRIBUTE(test_fpu_fops, test_fpu_get, NULL, "%lld\n"); +DEFINE_DEBUGFS_ATTRIBUTE(test_fpu_fops, test_fpu_get, NULL, "%lld\n"); static struct dentry *selftest_dir; = static int __init test_fpu_init(void) @@ -72,8 +72,8 @@ static int __init test_fpu_init(void) if (!selftest_dir) return -ENOMEM; = - debugfs_create_file("test_fpu", 0444, selftest_dir, NULL, - &test_fpu_fops); + debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL, + &test_fpu_fops); = return 0; } --===============3371586015957329130==--