blob: c96858131932c3da06119f9afa2d56fbe16222b1 [file] [log] [blame]
From: Andrew Morton <akpm@linux-foundation.org>
Subject: lib-math-add-int_log-test-suite-checkpatch-fixes
Date: Tue Sep 24 03:52:27 PM PDT 2024
ERROR: trailing whitespace
#36: FILE: lib/Kconfig.debug:3098:
+^I This option enables the KUnit test suite for the int_log library, which $
ERROR: trailing whitespace
#37: FILE: lib/Kconfig.debug:3099:
+^I provides two functions to compute the integer logarithm in base 2 and $
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#54:
new file mode 100644
ERROR: code indent should use tabs where possible
#77: FILE: lib/math/tests/int_log_kunit.c:20:
+ ^I{16, 67108864, "Log base 2 of 16"},$
WARNING: please, no space before tabs
#77: FILE: lib/math/tests/int_log_kunit.c:20:
+ ^I{16, 67108864, "Log base 2 of 16"},$
WARNING: please, no spaces at the start of a line
#77: FILE: lib/math/tests/int_log_kunit.c:20:
+ ^I{16, 67108864, "Log base 2 of 16"},$
ERROR: trailing whitespace
#78: FILE: lib/math/tests/int_log_kunit.c:21:
+^I{32, 83886080, "Log base 2 of 32"},^I$
ERROR: trailing whitespace
#95: FILE: lib/math/tests/int_log_kunit.c:38:
+^Istrscpy(desc, tc->name, KUNIT_PARAM_DESC_SIZE); $
ERROR: trailing whitespace
#99: FILE: lib/math/tests/int_log_kunit.c:42:
+KUNIT_ARRAY_PARAM(intlog2, intlog2_params, get_desc); $
ERROR: trailing whitespace
#103: FILE: lib/math/tests/int_log_kunit.c:46:
+^Iconst struct test_case_params *tc = (const struct test_case_params *)test->param_value;^I^I$
WARNING: line length of 104 exceeds 100 columns
#103: FILE: lib/math/tests/int_log_kunit.c:46:
+ const struct test_case_params *tc = (const struct test_case_params *)test->param_value;
ERROR: trailing whitespace
#104: FILE: lib/math/tests/int_log_kunit.c:47:
+^I$
total: 8 errors, 4 warnings, 102 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
NOTE: Whitespace errors detected.
You may wish to use scripts/cleanpatch or scripts/cleanfile
./patches/lib-math-add-int_log-test-suite.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Please run checkpatch prior to sending patches
Cc: Bruno Sobreira Franรงa <brunofrancadevsec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/math/tests/int_log_kunit.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--- a/lib/math/tests/int_log_kunit.c~lib-math-add-int_log-test-suite-checkpatch-fixes
+++ a/lib/math/tests/int_log_kunit.c
@@ -17,8 +17,8 @@ static const struct test_case_params int
{3, 26591232, "Log base 2 of 3"},
{4, 33554432, "Log base 2 of 4"},
{8, 50331648, "Log base 2 of 8"},
- {16, 67108864, "Log base 2 of 16"},
- {32, 83886080, "Log base 2 of 32"},
+ {16, 67108864, "Log base 2 of 16"},
+ {32, 83886080, "Log base 2 of 32"},
{U32_MAX, 536870911, "Log base 2 of MAX"},
};
@@ -35,16 +35,18 @@ static const struct test_case_params int
static void get_desc(const struct test_case_params *tc, char *desc)
{
- strscpy(desc, tc->name, KUNIT_PARAM_DESC_SIZE);
+ strscpy(desc, tc->name, KUNIT_PARAM_DESC_SIZE);
}
-KUNIT_ARRAY_PARAM(intlog2, intlog2_params, get_desc);
+KUNIT_ARRAY_PARAM(intlog2, intlog2_params, get_desc);
static void intlog2_test(struct kunit *test)
{
- const struct test_case_params *tc = (const struct test_case_params *)test->param_value;
-
+ const struct test_case_params *tc;
+
+ tc = (const struct test_case_params *)test->param_value;
+
KUNIT_EXPECT_EQ(test, tc->expected_result, intlog2(tc->value));
}
_