Skip to contentSkip to conversation

proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show()

PATCH In review Kaitao Cheng 5 participants 16 messages Jun 12, 2020 – Jul 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show()

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

---

v2 ChangeLog:
1. Fix some commit message
2. Remove unnecessary f_flags initialization

 fs/proc/fd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/proc/fd.c +3 -3
index 81882a13212d..d3854b76e95e 100644
@@ -19,9 +19,9 @@
 
 static int seq_show(struct seq_file *m, void *v)
 {
-	struct files_struct *files = NULL;
-	int f_flags = 0, ret = -ENOENT;
-	struct file *file = NULL;
+	struct files_struct *files;
+	int f_flags, ret = -ENOENT;
+	struct file *file;
 	struct task_struct *task;
 
 	task = get_proc_task(m->private);
Signature · 1 line
2.20.1
#1 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

* Should the mentioned identifiers refer to variables?

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b791d1bdf9212d944d749a5c7ff6febdba241771#n151

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret” also into a later assignment?

Regards,
Markus

#2 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 6 lines · Markus Elfring
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

Quoted 8 lines

* Should the mentioned identifiers refer to variables?

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id·91d1bdf9212d944d749a5c7ff6febdba241771#n151

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret� also into a later assignment?

Please stop commenting on people's changelogs. You add no value.

#3 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

* Should the mentioned identifiers refer to variables?

Quoted 8 lines
Quoted 6 lines

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b791d1bdf9212d944d749a5c7ff6febdba241771#n151

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret” also into a later assignment?

Please stop commenting on people's changelogs. You add no value.

Would you like to clarify concrete software development ideas?

Regards,
Markus

#4 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 11 lines · Markus Elfring
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

* Should the mentioned identifiers refer to variables?

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id·91d1bdf9212d944d749a5c7ff6febdba241771#n151

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret� also into a later assignment?

Please stop commenting on people's changelogs. You add no value.

Would you like to clarify concrete software development ideas?

Yes. Learn something deeply, then your opinion will have value.

#5 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 3 lines
Quoted 1 line

Would you like to clarify concrete software development ideas?

Yes. Learn something deeply, then your opinion will have value.

The presented suggestions trigger different views by involved contributors. In which directions can the desired clarification evolve?

How do you think about further function design alternatives?

Regards,
Markus

#6 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 5 lines · Markus Elfring
Quoted 3 lines
Quoted 1 line

Would you like to clarify concrete software development ideas?

Yes. Learn something deeply, then your opinion will have value.

The presented suggestions trigger different views by involved contributors.

Most of the views I've heard are "Markus, go away". Do you not hear these views?

Quoted 1 line

In which directions can the desired clarification evolve?

You could try communicating in a way that the rest of us do. For example, instead of saying something weird about "collateral evolution" you could say "I think there's a similar bug here".

Quoted 1 line

How do you think about further function design alternatives?

Could you repeat that in German? I don't know what you mean.

#7 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 4 lines
Quoted 1 line

The presented suggestions trigger different views by involved contributors.

Most of the views I've heard are "Markus, go away". Do you not hear these views?

I notice also this kind of feedback.
The clarification is still evolving for these concerns and communication difficulties.

I suggest to take another look at published software development activities.

Quoted 3 lines
Quoted 1 line

In which directions can the desired clarification evolve?

You could try communicating in a way that the rest of us do.

I got also used to some communication styles.
I am curious to find the differences out which hinder to achieve a better common understanding.

Quoted 2 lines

For example, instead of saying something weird about "collateral evolution" you could say "I think there's a similar bug here".

* Why do you repeat this topic here?

* Do try to distract from implementation details which were pointed out by two developers for this patch?

Quoted 3 lines
Quoted 1 line

How do you think about further function design alternatives?

Could you repeat that in German? I don't know what you mean.

I imagine that you could know affected software aspects better.

Regards,
Markus

#8 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 9 lines · Markus Elfring
Quoted 4 lines
Quoted 1 line

The presented suggestions trigger different views by involved contributors.

Most of the views I've heard are "Markus, go away". Do you not hear these views?

I notice also this kind of feedback.
The clarification is still evolving for these concerns and communication difficulties.

I suggest to take another look at published software development activities.

Do you collateral evolution in the twenty?

Quoted 3 lines

I got also used to some communication styles.
I am curious to find the differences out which hinder to achieve a better common understanding.

My quantum tunnelling eases the mind.

Quoted 4 lines
Quoted 2 lines

For example, instead of saying something weird about "collateral evolution" you could say "I think there's a similar bug here".

* Why do you repeat this topic here?

* Can communication be achieved?
* Will you twice the program?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

How do you think about further function design alternatives?

Could you repeat that in German? I don't know what you mean.

I imagine that you could know affected software aspects better.

Murph had other ideas.

#9 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 3 lines
Quoted 1 line

I suggest to take another look at published software development activities.

Do you collateral evolution in the twenty?

Evolutions and software refactorings are just happening. Can we continue to clarify the concrete programming items also for a more constructive review of this patch variant?

Regards,
Markus

#10 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

Quoted 7 lines · Markus Elfring
Quoted 3 lines
Quoted 1 line

I suggest to take another look at published software development activities.

Do you collateral evolution in the twenty?

Evolutions and software refactorings are just happening. Can we continue to clarify the concrete programming items also for a more constructive review of this patch variant?

Generationally, pandemics are an investment opportunity for the likeminded. Talking about human nature is the ultimate world view for the proletariat.

maintainer
#11 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

In reply to Markus Elfring
Quoted 7 lines · Markus Elfring
Quoted 3 lines
Quoted 1 line

I suggest to take another look at published software development activities.

Do you collateral evolution in the twenty?

Evolutions and software refactorings are just happening. Can we continue to clarify the concrete programming items also for a more constructive review of this patch variant?

The really shocking part is that apparently this thing is _not_ a bot - according to the people who'd been unfortunate enough to meet it, it's hosted by wetware and behaviour is the same face-to-face...

I'm still not convinced that it's not a sociology student collecting PhD material, though - something around strong programme crowd, with their religious avoidance of learning the subject matter, lest it taints their "research"...

#12 lore raw

Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

In reply to Matthew Wilcox
Quoted 3 lines
Quoted 1 line

I suggest to take another look at published software development activities.

Do you collateral evolution in the twenty?

Evolutions and software refactorings are just happening. Can we continue to clarify the concrete programming items also for a more constructive review of this patch variant?

Regards,
Markus

#13 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

In reply to Matthew Wilcox
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

* Should the mentioned identifiers refer to variables?

Quoted 8 lines
Quoted 6 lines

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b791d1bdf9212d944d749a5c7ff6febdba241771#n151

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret” also into a later assignment?

Please stop commenting on people's changelogs. You add no value.

Would you like to clarify concrete software development ideas?

Regards,
Markus

#14 lore raw

Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()

In reply to Markus Elfring
Quoted 11 lines · Markus Elfring
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

I suggest to improve also this change description.

* Should the mentioned identifiers refer to variables?

* Will another imperative wording be preferred?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id·91d1bdf9212d944d749a5c7ff6febdba241771#n151

Quoted 6 lines

* I propose to extend the patch a bit more.
How do you think about to convert the initialisation for the variable “ret� also into a later assignment?

Regards,
Markus

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless review comment to a patch submission on a Linux kernel developer mailing list. I strongly suggest that you not do this anymore. Please do not bother developers who are actively working to produce patches and features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to follow it at all. The person/bot/AI that sent it is being ignored by almost all Linux kernel maintainers for having a persistent pattern of behavior of producing distracting and pointless commentary, and inability to adapt to feedback. Please feel free to also ignore emails from them.

thanks,

greg k-h's patch email bot

#15 lore raw

Re: [PATCH v2] proc/fd: Adjust variable initialisations in seq_show()

In reply to Kaitao Cheng
Quoted 3 lines

'files' will be immediately reassigned. 'f_flags' and 'file' will be overwritten in the if{} or seq_show() directly exits with an error. so we don't need to consume CPU resources to initialize them.

How do you think about to reduce the scope for four local variables in this function implementation?
https://refactoring.com/catalog/reduceScopeOfVariable.html

Regards,
Markus