linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] kunit: fix checkpatch warning
@ 2021-03-03  2:03 Lucas Stankus
  2021-03-03 20:56 ` Brendan Higgins
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Stankus @ 2021-03-03  2:03 UTC (permalink / raw)
  To: brendanhiggins; +Cc: linux-kselftest, kunit-dev, linux-kernel

Tidy up code by fixing the following checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: Lines should not end with a '('

Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com>
---
Change log v1 -> v2
fixed signed-off-by tag
 lib/kunit/assert.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/lib/kunit/assert.c b/lib/kunit/assert.c
index e0ec7d6fed6f..acfbf86bddd6 100644
--- a/lib/kunit/assert.c
+++ b/lib/kunit/assert.c
@@ -25,7 +25,7 @@ void kunit_base_assert_format(const struct kunit_assert *assert,
 	}
 
 	string_stream_add(stream, "%s FAILED at %s:%d\n",
-			 expect_or_assert, assert->file, assert->line);
+			  expect_or_assert, assert->file, assert->line);
 }
 EXPORT_SYMBOL_GPL(kunit_base_assert_format);
 
@@ -48,8 +48,9 @@ EXPORT_SYMBOL_GPL(kunit_fail_assert_format);
 void kunit_unary_assert_format(const struct kunit_assert *assert,
 			       struct string_stream *stream)
 {
-	struct kunit_unary_assert *unary_assert = container_of(
-			assert, struct kunit_unary_assert, assert);
+	struct kunit_unary_assert *unary_assert;
+
+	unary_assert = container_of(assert, struct kunit_unary_assert, assert);
 
 	kunit_base_assert_format(assert, stream);
 	if (unary_assert->expected_true)
@@ -67,8 +68,10 @@ EXPORT_SYMBOL_GPL(kunit_unary_assert_format);
 void kunit_ptr_not_err_assert_format(const struct kunit_assert *assert,
 				     struct string_stream *stream)
 {
-	struct kunit_ptr_not_err_assert *ptr_assert = container_of(
-			assert, struct kunit_ptr_not_err_assert, assert);
+	struct kunit_ptr_not_err_assert *ptr_assert;
+
+	ptr_assert = container_of(assert, struct kunit_ptr_not_err_assert,
+				  assert);
 
 	kunit_base_assert_format(assert, stream);
 	if (!ptr_assert->value) {
@@ -111,8 +114,10 @@ static bool is_literal(struct kunit *test, const char *text, long long value,
 void kunit_binary_assert_format(const struct kunit_assert *assert,
 				struct string_stream *stream)
 {
-	struct kunit_binary_assert *binary_assert = container_of(
-			assert, struct kunit_binary_assert, assert);
+	struct kunit_binary_assert *binary_assert;
+
+	binary_assert = container_of(assert, struct kunit_binary_assert,
+				     assert);
 
 	kunit_base_assert_format(assert, stream);
 	string_stream_add(stream,
@@ -137,8 +142,10 @@ EXPORT_SYMBOL_GPL(kunit_binary_assert_format);
 void kunit_binary_ptr_assert_format(const struct kunit_assert *assert,
 				    struct string_stream *stream)
 {
-	struct kunit_binary_ptr_assert *binary_assert = container_of(
-			assert, struct kunit_binary_ptr_assert, assert);
+	struct kunit_binary_ptr_assert *binary_assert;
+
+	binary_assert = container_of(assert, struct kunit_binary_ptr_assert,
+				     assert);
 
 	kunit_base_assert_format(assert, stream);
 	string_stream_add(stream,
@@ -159,8 +166,10 @@ EXPORT_SYMBOL_GPL(kunit_binary_ptr_assert_format);
 void kunit_binary_str_assert_format(const struct kunit_assert *assert,
 				    struct string_stream *stream)
 {
-	struct kunit_binary_str_assert *binary_assert = container_of(
-			assert, struct kunit_binary_str_assert, assert);
+	struct kunit_binary_str_assert *binary_assert;
+
+	binary_assert = container_of(assert, struct kunit_binary_str_assert,
+				     assert);
 
 	kunit_base_assert_format(assert, stream);
 	string_stream_add(stream,
-- 
2.30.1


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

* Re: [PATCH v2] kunit: fix checkpatch warning
  2021-03-03  2:03 [PATCH v2] kunit: fix checkpatch warning Lucas Stankus
@ 2021-03-03 20:56 ` Brendan Higgins
  2021-03-04  4:35   ` Lucas Stankus
  0 siblings, 1 reply; 5+ messages in thread
From: Brendan Higgins @ 2021-03-03 20:56 UTC (permalink / raw)
  To: Lucas Stankus
  Cc: open list:KERNEL SELFTEST FRAMEWORK, KUnit Development,
	Linux Kernel Mailing List

On Tue, Mar 2, 2021 at 6:03 PM Lucas Stankus <lucas.p.stankus@gmail.com> wrote:
>
> Tidy up code by fixing the following checkpatch warnings:
> CHECK: Alignment should match open parenthesis
> CHECK: Lines should not end with a '('
>
> Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com>

Did you change anything other than fixing the Signed-off-by that Shuah
requested?

Generally when you make a small change after receiving a Reviewed-by
(especially one so small as here), you are supposed to include the
Reviewed-by with the other git commit message footers directly below
the "Signed-off-by". Please remember to do so in the future.

Also, when you make a change to a patch and send out a subsequent
revision, it is best practice to make note explaining the changes you
made since the last revision in the "comment section" [1] of the
git-diff, right after the three dashes and before the change log as
you can see in this example [2] (note that everything after
"Signed-off-by: David Gow <davidgow@google.com>\n ---" and before
"tools/testing/kunit/configs/broken_on_uml.config | 2 ++" is discarded
by git am).

Anyway, aside from these minor points of LKML best practices, this
patch still looks good to me:

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

[1] https://stackoverflow.com/questions/18979120/is-it-possible-to-add-a-comment-to-a-diff-file-unified
[2] https://lore.kernel.org/lkml/20210209071034.3268897-1-davidgow@google.com/T/

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

* Re: [PATCH v2] kunit: fix checkpatch warning
  2021-03-03 20:56 ` Brendan Higgins
@ 2021-03-04  4:35   ` Lucas Stankus
  2021-03-04 23:12     ` Shuah Khan
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Stankus @ 2021-03-04  4:35 UTC (permalink / raw)
  To: Brendan Higgins
  Cc: open list:KERNEL SELFTEST FRAMEWORK, KUnit Development,
	Linux Kernel Mailing List

On Wed, Mar 03, 2021 at 12:56:05PM -0800, Brendan Higgins wrote:
> Did you change anything other than fixing the Signed-off-by that Shuah
> requested?

No, I only fixed the Signed-off-by warning.

> Generally when you make a small change after receiving a Reviewed-by
> (especially one so small as here), you are supposed to include the
> Reviewed-by with the other git commit message footers directly below
> the "Signed-off-by". Please remember to do so in the future.
> 
> Also, when you make a change to a patch and send out a subsequent
> revision, it is best practice to make note explaining the changes you
> made since the last revision in the "comment section" [1] of the
> git-diff, right after the three dashes and before the change log as
> you can see in this example [2] (note that everything after
> "Signed-off-by: David Gow <davidgow@google.com>\n ---" and before
> "tools/testing/kunit/configs/broken_on_uml.config | 2 ++" is discarded
> by git am).

Sorry for the incovenience regarding best practices, I'll keep that
noted for further contributions.

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

* Re: [PATCH v2] kunit: fix checkpatch warning
  2021-03-04  4:35   ` Lucas Stankus
@ 2021-03-04 23:12     ` Shuah Khan
  2021-03-10 15:54       ` Shuah Khan
  0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2021-03-04 23:12 UTC (permalink / raw)
  To: Lucas Stankus, Brendan Higgins
  Cc: open list:KERNEL SELFTEST FRAMEWORK, KUnit Development,
	Linux Kernel Mailing List, Shuah Khan

On 3/3/21 9:35 PM, Lucas Stankus wrote:
> On Wed, Mar 03, 2021 at 12:56:05PM -0800, Brendan Higgins wrote:
>> Did you change anything other than fixing the Signed-off-by that Shuah
>> requested?
> 
> No, I only fixed the Signed-off-by warning.
> 
>> Generally when you make a small change after receiving a Reviewed-by
>> (especially one so small as here), you are supposed to include the
>> Reviewed-by with the other git commit message footers directly below
>> the "Signed-off-by". Please remember to do so in the future.
>>
>> Also, when you make a change to a patch and send out a subsequent
>> revision, it is best practice to make note explaining the changes you
>> made since the last revision in the "comment section" [1] of the
>> git-diff, right after the three dashes and before the change log as
>> you can see in this example [2] (note that everything after
>> "Signed-off-by: David Gow <davidgow@google.com>\n ---" and before
>> "tools/testing/kunit/configs/broken_on_uml.config | 2 ++" is discarded
>> by git am).
> 
> Sorry for the incovenience regarding best practices, I'll keep that
> noted for further contributions.
> 

Thank you both.

I will pick this up.

thanks,
-- Shuah

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

* Re: [PATCH v2] kunit: fix checkpatch warning
  2021-03-04 23:12     ` Shuah Khan
@ 2021-03-10 15:54       ` Shuah Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2021-03-10 15:54 UTC (permalink / raw)
  To: Lucas Stankus, Brendan Higgins
  Cc: open list:KERNEL SELFTEST FRAMEWORK, KUnit Development,
	Linux Kernel Mailing List, Shuah Khan

On 3/4/21 4:12 PM, Shuah Khan wrote:
> On 3/3/21 9:35 PM, Lucas Stankus wrote:
>> On Wed, Mar 03, 2021 at 12:56:05PM -0800, Brendan Higgins wrote:
>>> Did you change anything other than fixing the Signed-off-by that Shuah
>>> requested?
>>
>> No, I only fixed the Signed-off-by warning.
>>
>>> Generally when you make a small change after receiving a Reviewed-by
>>> (especially one so small as here), you are supposed to include the
>>> Reviewed-by with the other git commit message footers directly below
>>> the "Signed-off-by". Please remember to do so in the future.
>>>
>>> Also, when you make a change to a patch and send out a subsequent
>>> revision, it is best practice to make note explaining the changes you
>>> made since the last revision in the "comment section" [1] of the
>>> git-diff, right after the three dashes and before the change log as
>>> you can see in this example [2] (note that everything after
>>> "Signed-off-by: David Gow <davidgow@google.com>\n ---" and before
>>> "tools/testing/kunit/configs/broken_on_uml.config | 2 ++" is discarded
>>> by git am).
>>
>> Sorry for the incovenience regarding best practices, I'll keep that
>> noted for further contributions.
>>
> 

Sorry I should have asked you about this. I like to see what is being
fixed in the subject line.

Can you update the subject line. The current one doesn't say anything
about the nature of the fix.

Also please run the checkpatch script on your patches. This tool useful
and can offer you tips on improving your commit log as well as code.

thanks,
-- Shuah

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

end of thread, other threads:[~2021-03-10 15:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  2:03 [PATCH v2] kunit: fix checkpatch warning Lucas Stankus
2021-03-03 20:56 ` Brendan Higgins
2021-03-04  4:35   ` Lucas Stankus
2021-03-04 23:12     ` Shuah Khan
2021-03-10 15:54       ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).