From: Xiaofei Tan <hidden> Date: 2021-05-17 06:40:43
Fix some issues reported by checkpatch.pl. All of them are
coding style issues, no function changes.
Xiaofei Tan (9):
tty: hvc_console: Fix spaces required around that '='
tty: hvc_console: Fix "foo * bar" should be "foo *bar"
tty: hvc_console: Remove trailing whitespace
tty: hvc_console: Fix issues of code indent should use tabs
tty: hvc_console: Delete spaces prohibited around open parenthesis '('
and ')'
tty: hvc_console: Fix coding style issues of block comments
tty: hvc_console: Add a blank line after declarations
tty: hvc_console: Remove the repeated words 'no' and 'from'
tty: hvc_console: Move open brace { on the previous line
drivers/tty/hvc/hvc_console.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
--
2.8.1
From: Xiaofei Tan <hidden> Date: 2021-05-17 06:40:45
Fix issues that open brace { should be on the previous line,
reported by checkpatch.pl.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -268,7 +268,7 @@ static void hvc_check_console(int index)if(hvc_console.flags&CON_ENABLED)return;-/* If this index is what the user requested, then register+/* If this index is what the user requested, then register*now(setupwon'tfailatthispoint).It'soktojust*callregisteragainifpreviously.setupfailed.*/
From: Xiaofei Tan <hidden> Date: 2021-05-17 06:40:55
Add a blank line after declarations, reported by checkpatch.pl.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 1 +
1 file changed, 1 insertion(+)
@@ -922,6 +922,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,/* We wait until a driver actually comes along */if(atomic_inc_not_zero(&hvc_needs_init)){interr=hvc_init();+if(err)returnERR_PTR(err);}
From: Xiaofei Tan <hidden> Date: 2021-05-17 06:41:00
Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, add a period at the end of the sentenses.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
@@ -484,7 +485,8 @@ static int hvc_push(struct hvc_struct *hp)return0;}/* throw away output on error; this happens when-thereisnosessionconnectedtothevterm.*/+*thereisnosessionconnectedtothevterm.+*/hp->n_outbuf=0;}elsehp->n_outbuf-=n;
@@ -707,7 +709,8 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)/* XXX should support a sequence */if(buf[i]=='\x0f'){/* ^O *//* if ^O is pressed again, reset-*sysrq_pressedandflip^Ochar*/+*sysrq_pressedandflip^Ochar.+*/sysrq_pressed=!sysrq_pressed;if(sysrq_pressed)continue;
@@ -749,7 +752,8 @@ static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)if(read_total){/* Activity is occurring, so reset the polling backoff value to-aminimumforperformance.*/+*aminimumforperformance.+*/timeout=MIN_TIMEOUT;tty_flip_buffer_push(&hp->port);
@@ -1037,7 +1041,8 @@ static int hvc_init(void)tty_set_operations(drv,&hvc_ops);/* Always start the kthread because there can be hotplug vty adapters-*addedlater.*/+*addedlater.+*/hvc_task=kthread_run(khvcd,NULL,"khvcd");if(IS_ERR(hvc_task)){printk(KERN_ERR"Couldn't create kthread for console.\n");
From: Xiaofei Tan <hidden> Date: 2021-05-17 06:41:02
Delete spaces prohibited after that open parenthesis '(' and
before that close parenthesis ')', reported by checkpatch.pl.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -293,7 +293,7 @@ int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops)if(vtermnos[index]!=-1)return-1;-/* make sure no no tty has been registered in this index */+/* make sure no tty has been registered in this index */hp=hvc_get_by_index(index);if(hp){tty_port_put(&hp->port);
From: Johan Hovold <johan@kernel.org> Date: 2021-05-17 14:34:21
On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote:
quoted hunk
Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, add a period at the end of the sentenses.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Second, that sentence is not capitalised so why do add a period?
Third, why are you sending checkpatch.pl cleanups for files outside of
staging?
Unless doing some real changes to the files in question as well this is
mostly just churn and noise that makes it harder to backport fixes and
do code forensics for no real gain.
Greg may disagree, but I don't think we should be encouraging this kind
of patches.
Johan
From: Xiaofei Tan <hidden> Date: 2021-05-18 04:01:28
Hi Johan,
Thanks for reviewing this patch.
On 2021/5/17 22:15, Johan Hovold wrote:
On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote:
quoted
Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, add a period at the end of the sentenses.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Yes, mostly we use this style. I can follow it if new version is needed.
BTW, How about add the '/*' check into checkpatch.pl?
Second, that sentence is not capitalised so why do add a period?
How about capitalize the sentence, or just remove the period ?
Third, why are you sending checkpatch.pl cleanups for files outside of
staging?
I'm sorry, Is this a rule, or kind of tradition? I've never heard of
this before.
Unless doing some real changes to the files in question as well this is
mostly just churn and noise that makes it harder to backport fixes and
do code forensics for no real gain.
I'm not sure. But if cleanup patches have made it hard to backport fixes
and do code forensics, then the code quality may not be
good enough.
Greg may disagree, but I don't think we should be encouraging this kind
of patches.
Johan
.
From: Johan Hovold <johan@kernel.org> Date: 2021-05-20 08:21:46
On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote:
Hi Johan,
Thanks for reviewing this patch.
On 2021/5/17 22:15, Johan Hovold wrote:
quoted
On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote:
quoted
Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, add a period at the end of the sentenses.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Yes, mostly we use this style. I can follow it if new version is needed.
This is the preferred style outside of networking.
BTW, How about add the '/*' check into checkpatch.pl?
Checkpatch already has too many checks IMO and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
quoted
Second, that sentence is not capitalised so why do add a period?
How about capitalize the sentence, or just remove the period ?
How about just leaving this unchanged?
quoted
Third, why are you sending checkpatch.pl cleanups for files outside of
staging?
I'm sorry, Is this a rule, or kind of tradition? I've never heard of
this before.
Many subsystems reject pure style changes unless you're also doing some
real changes to the code in question. This is a good default rule, even
if some maintainers may occasionally accept churn like this.
You appear to be paid to do kernel work. Why don't you start fixing bugs
or help out reviewing new code instead of sending trivial patches like
this? We can always need another hand.
But if all you you want is to increase your company patch count then
please go work in drivers/staging where most trivial style changes are
currently accepted.
quoted
Unless doing some real changes to the files in question as well this is
mostly just churn and noise that makes it harder to backport fixes and
do code forensics for no real gain.
I'm not sure. But if cleanup patches have made it hard to backport fixes
and do code forensics, then the code quality may not be
good enough.
No, that has nothing to do with code quality, it's just that you
introduce noise in the logs and do pointless changes of context which
makes it harder to use tools like git blame and makes backporting harder
for no good reason.
Johan
From: Xiaofei Tan <hidden> Date: 2021-05-20 13:21:48
Hi Johan,
On 2021/5/20 16:21, Johan Hovold wrote:
On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote:
quoted
Hi Johan,
Thanks for reviewing this patch.
On 2021/5/17 22:15, Johan Hovold wrote:
quoted
On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote:
quoted
Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, add a period at the end of the sentenses.
Signed-off-by: Xiaofei Tan <redacted>
---
drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Yes, mostly we use this style. I can follow it if new version is needed.
This is the preferred style outside of networking.
quoted
BTW, How about add the '/*' check into checkpatch.pl?
Checkpatch already has too many checks IMO and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
quoted
quoted
Second, that sentence is not capitalised so why do add a period?
How about capitalize the sentence, or just remove the period ?
How about just leaving this unchanged?
OK
And I will keep the patch 8/9, and combine space issues into
one new patch, and remove the others.
quoted
quoted
Third, why are you sending checkpatch.pl cleanups for files outside of
staging?
I'm sorry, Is this a rule, or kind of tradition? I've never heard of
this before.
Many subsystems reject pure style changes unless you're also doing some
real changes to the code in question. This is a good default rule, even
if some maintainers may occasionally accept churn like this.
You appear to be paid to do kernel work. Why don't you start fixing bugs
or help out reviewing new code instead of sending trivial patches like
this? We can always need another hand.
But if all you you want is to increase your company patch count then
please go work in drivers/staging where most trivial style changes are
currently accepted.
quoted
quoted
Unless doing some real changes to the files in question as well this is
mostly just churn and noise that makes it harder to backport fixes and
do code forensics for no real gain.
I'm not sure. But if cleanup patches have made it hard to backport fixes
and do code forensics, then the code quality may not be
good enough.
No, that has nothing to do with code quality, it's just that you
introduce noise in the logs and do pointless changes of context which
makes it harder to use tools like git blame and makes backporting harder
for no good reason.
Johan
.
From: Johan Hovold <johan@kernel.org> Date: 2021-05-20 13:52:33
On Thu, May 20, 2021 at 09:21:25PM +0800, Xiaofei Tan wrote:
quoted
Checkpatch already has too many checks IMO and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
quoted
quoted
Second, that sentence is not capitalised so why do add a period?
How about capitalize the sentence, or just remove the period ?
How about just leaving this unchanged?
OK
And I will keep the patch 8/9, and combine space issues into
one new patch, and remove the others.
Yeah, 8/9 is arguably a fix even if it's for a very minor issue
(repeated words in a comment).
It doesn't look like any of the white space issues are worth fixing,
though. Such pedantry can usually be addressed when the code in question
is being modified for other reasons.
Johan
On Mon, May 17, 2021 at 02:37:04PM +0800, Xiaofei Tan wrote:
Fix some issues reported by checkpatch.pl. All of them are
coding style issues, no function changes.
Xiaofei Tan (9):
tty: hvc_console: Fix spaces required around that '='
tty: hvc_console: Fix "foo * bar" should be "foo *bar"
tty: hvc_console: Remove trailing whitespace
tty: hvc_console: Fix issues of code indent should use tabs
tty: hvc_console: Delete spaces prohibited around open parenthesis '('
and ')'
tty: hvc_console: Fix coding style issues of block comments
tty: hvc_console: Add a blank line after declarations
tty: hvc_console: Remove the repeated words 'no' and 'from'
tty: hvc_console: Move open brace { on the previous line
drivers/tty/hvc/hvc_console.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
Do you use this driver? If so, great, I'm sure there are other "real"
issues in it that need some work. But as Johan points out, doing
drive-by checkpatch cleanups on random files that you do not use, isn't
the best thing to do.
If you just want to do this type of work, please do so in
drivers/staging/ as it is most welcome there if you wish to get involved
in kernel work to get experience before doing "real" stuff.
thanks,
g
reg k-h
r = cons_ops[index]->put_chars(vtermnos[index], c, i);
if (r <= 0) {
/* throw away characters on error
- * but spin in case of -EAGAIN */
+ * but spin in case of -EAGAIN.
+ */
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Yes, mostly we use this style. I can follow it if new version is needed.
This is the preferred style outside of networking.
quoted
BTW, How about add the '/*' check into checkpatch.pl?
Checkpatch already has too many checks IMO
I sometimes agree. What checkpatch messages do you think are excessive?
and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
Likely not. If it was run on a suggested patch, checkpatch doesn't emit
many messages on unmodified patch context lines. And it shouldn't.
it's just that you
introduce noise in the logs and do pointless changes of context which
makes it harder to use tools like git blame and makes backporting harder
for no good reason.
Pretty pointless metric IMO. Context changes in comments are mostly harmless.
IMO: backporting of these sorts non-bug fix changes is done _far_ too often.
From: Xiaofei Tan <hidden> Date: 2021-05-21 02:18:10
Hi Greg,
On 2021/5/20 23:11, Greg KH wrote:
On Mon, May 17, 2021 at 02:37:04PM +0800, Xiaofei Tan wrote:
quoted
Fix some issues reported by checkpatch.pl. All of them are
coding style issues, no function changes.
Xiaofei Tan (9):
tty: hvc_console: Fix spaces required around that '='
tty: hvc_console: Fix "foo * bar" should be "foo *bar"
tty: hvc_console: Remove trailing whitespace
tty: hvc_console: Fix issues of code indent should use tabs
tty: hvc_console: Delete spaces prohibited around open parenthesis '('
and ')'
tty: hvc_console: Fix coding style issues of block comments
tty: hvc_console: Add a blank line after declarations
tty: hvc_console: Remove the repeated words 'no' and 'from'
tty: hvc_console: Move open brace { on the previous line
drivers/tty/hvc/hvc_console.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
Do you use this driver?
No, i don't use it.
If so, great, I'm sure there are other "real"
issues in it that need some work. But as Johan points out, doing
drive-by checkpatch cleanups on random files that you do not use, isn't
the best thing to do.
Sure
If you just want to do this type of work, please do so in
drivers/staging/ as it is most welcome there if you wish to get involved
in kernel work to get experience before doing "real" stuff.
From: Xiaofei Tan <hidden> Date: 2021-05-21 02:23:23
Hi Johan,
On 2021/5/20 21:52, Johan Hovold wrote:
On Thu, May 20, 2021 at 09:21:25PM +0800, Xiaofei Tan wrote:
quoted
quoted
Checkpatch already has too many checks IMO and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
quoted
quoted
Second, that sentence is not capitalised so why do add a period?
How about capitalize the sentence, or just remove the period ?
How about just leaving this unchanged?
OK
And I will keep the patch 8/9, and combine space issues into
one new patch, and remove the others.
Yeah, 8/9 is arguably a fix even if it's for a very minor issue
(repeated words in a comment).
It doesn't look like any of the white space issues are worth fixing,
though. Such pedantry can usually be addressed when the code in question
is being modified for other reasons.
From: Johan Hovold <johan@kernel.org> Date: 2021-05-21 08:44:21
On Thu, May 20, 2021 at 08:21:39AM -0700, Joe Perches wrote:
On Thu, 2021-05-20 at 10:21 +0200, Johan Hovold wrote:
quoted
On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote:
quoted
On 2021/5/17 22:15, Johan Hovold wrote:
quoted
quoted
quoted
How is this an improvement? First, the multi-line comment style is
/*
* ...
*/
Yes, mostly we use this style. I can follow it if new version is needed.
This is the preferred style outside of networking.
quoted
BTW, How about add the '/*' check into checkpatch.pl?
Checkpatch already has too many checks IMO
I sometimes agree. What checkpatch messages do you think are excessive?
The "unsigned" -> "unsigned int" one comes to mind (at least when
running with -f).
Most of the questionable ones are probably hidden behind --subjective,
but due to the unfortunate alias of that switch as --strict, people
don't get the message to use their own judgement and instead think
they'll get a gold star for "full compliance".
So my issue isn't so much which checkpatch itself rather than with how
it is being used and promoted, for example, to introduce aspiring
developers to kernel development in staging.
It's a great tool to run on your own patches before submission (as was
originally intended judging by the apt name), but if I could change
something I'd drop the --strict alias for the --subjective checks and
disable that switch for staging.
Perhaps also add a warning or similar when running with -f on in-tree
code outside of staging.
quoted
and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
Likely not. If it was run on a suggested patch, checkpatch doesn't emit
many messages on unmodified patch context lines. And it shouldn't.
Right, but here it appears to have been run using -f on in-tree code.
You could still check for this when adding new comments, and perhaps it
already does.
quoted
it's just that you
introduce noise in the logs and do pointless changes of context which
makes it harder to use tools like git blame and makes backporting harder
for no good reason.
Pretty pointless metric IMO. Context changes in comments are mostly harmless.
This isn't just about comment changes but the whole array of
white-space shifting and other pendantry. And also reformatted comments
makes it harder to do code forensics.
IMO: backporting of these sorts non-bug fix changes is done _far_ too often.
I have yet to see AUTOSEL pick up white-space cleanups but there are
certainly a few non-bug-fix patches currently being backported.
Johan