Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show()
@ 2020-06-12 16:09 Kaitao Cheng
  2020-06-12 16:45 ` [PATCH v2] proc/fd: Remove unnecessary variable initialisations " Markus Elfring
  2020-07-07  7:23 ` [PATCH v2] proc/fd: Adjust " Markus Elfring
  0 siblings, 2 replies; 16+ messages in thread
From: Kaitao Cheng @ 2020-06-12 16:09 UTC (permalink / raw)
  To: adobriyan, Markus.Elfring
  Cc: linux-kernel, linux-fsdevel, songmuchun, kernel-janitors, Kaitao Cheng

'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.

Signed-off-by: Kaitao Cheng <pilgrimtao@gmail.com>
---

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(-)

diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 81882a13212d..d3854b76e95e 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -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);
-- 
2.20.1


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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 16:09 [PATCH v2] proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show() Kaitao Cheng
@ 2020-06-12 16:45 ` Markus Elfring
  2020-06-12 17:00   ` Matthew Wilcox
  2020-06-14  7:12   ` [PATCH v2] " Greg KH
  2020-07-07  7:23 ` [PATCH v2] proc/fd: Adjust " Markus Elfring
  1 sibling, 2 replies; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 16:45 UTC (permalink / raw)
  To: Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

> '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

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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 16:45 ` [PATCH v2] proc/fd: Remove unnecessary variable initialisations " Markus Elfring
@ 2020-06-12 17:00   ` Matthew Wilcox
  2020-06-12 17:03     ` Markus Elfring
  2020-06-12 17:03     ` Markus Elfring
  2020-06-14  7:12   ` [PATCH v2] " Greg KH
  1 sibling, 2 replies; 16+ messages in thread
From: Matthew Wilcox @ 2020-06-12 17:00 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 06:45:57PM +0200, Markus Elfring wrote:
> > '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?

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

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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 17:00   ` Matthew Wilcox
  2020-06-12 17:03     ` Markus Elfring
@ 2020-06-12 17:03     ` Markus Elfring
  2020-06-12 17:04       ` Matthew Wilcox
  1 sibling, 1 reply; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 17:03 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>>> '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?
>
> Please stop commenting on people's changelogs.  You add no value.

Would you like to clarify concrete software development ideas?

Regards,
Markus

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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 17:00   ` Matthew Wilcox
@ 2020-06-12 17:03     ` Markus Elfring
  2020-06-12 17:03     ` Markus Elfring
  1 sibling, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 17:03 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>>> '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?
>
> Please stop commenting on people's changelogs.  You add no value.

Would you like to clarify concrete software development ideas?

Regards,
Markus

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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 17:03     ` Markus Elfring
@ 2020-06-12 17:04       ` Matthew Wilcox
  2020-06-12 18:22         ` [v2] " Markus Elfring
  0 siblings, 1 reply; 16+ messages in thread
From: Matthew Wilcox @ 2020-06-12 17:04 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 07:03:49PM +0200, Markus Elfring wrote:
> >>> '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?
> >
> > 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.

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 17:04       ` Matthew Wilcox
@ 2020-06-12 18:22         ` Markus Elfring
  2020-06-12 18:28           ` Matthew Wilcox
  0 siblings, 1 reply; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 18:22 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>> 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

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 18:22         ` [v2] " Markus Elfring
@ 2020-06-12 18:28           ` Matthew Wilcox
  2020-06-12 18:43             ` Markus Elfring
  0 siblings, 1 reply; 16+ messages in thread
From: Matthew Wilcox @ 2020-06-12 18:28 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 08:22:43PM +0200, Markus Elfring wrote:
> >> 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?

> 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".

> How do you think about further function design alternatives?

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

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 18:28           ` Matthew Wilcox
@ 2020-06-12 18:43             ` Markus Elfring
  2020-06-12 18:47               ` Matthew Wilcox
  0 siblings, 1 reply; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 18:43 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>> 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.


>> 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.


> 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?


>> 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

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 18:43             ` Markus Elfring
@ 2020-06-12 18:47               ` Matthew Wilcox
  2020-06-12 19:00                 ` Markus Elfring
  2020-06-12 19:00                 ` Markus Elfring
  0 siblings, 2 replies; 16+ messages in thread
From: Matthew Wilcox @ 2020-06-12 18:47 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 08:43:41PM +0200, Markus Elfring wrote:
> >> 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?

> 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.

> > 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?

> >> 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.

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 18:47               ` Matthew Wilcox
  2020-06-12 19:00                 ` Markus Elfring
@ 2020-06-12 19:00                 ` Markus Elfring
  2020-06-12 19:02                   ` Matthew Wilcox
  2020-06-12 19:49                   ` Al Viro
  1 sibling, 2 replies; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 19:00 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>> 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

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 18:47               ` Matthew Wilcox
@ 2020-06-12 19:00                 ` Markus Elfring
  2020-06-12 19:00                 ` Markus Elfring
  1 sibling, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2020-06-12 19:00 UTC (permalink / raw)
  To: Matthew Wilcox, Kaitao Cheng, linux-fsdevel
  Cc: linux-kernel, kernel-janitors, Alexey Dobriyan, Colin Ian King,
	Muchun Song

>> 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

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 19:00                 ` Markus Elfring
@ 2020-06-12 19:02                   ` Matthew Wilcox
  2020-06-12 19:49                   ` Al Viro
  1 sibling, 0 replies; 16+ messages in thread
From: Matthew Wilcox @ 2020-06-12 19:02 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 09:00:14PM +0200, Markus Elfring wrote:
> >> 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.

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

* Re: [v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 19:00                 ` Markus Elfring
  2020-06-12 19:02                   ` Matthew Wilcox
@ 2020-06-12 19:49                   ` Al Viro
  1 sibling, 0 replies; 16+ messages in thread
From: Al Viro @ 2020-06-12 19:49 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Matthew Wilcox, Kaitao Cheng, linux-fsdevel, linux-kernel,
	kernel-janitors, Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 09:00:14PM +0200, Markus Elfring wrote:
> >> 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"...

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

* Re: [PATCH v2] proc/fd: Remove unnecessary variable initialisations in seq_show()
  2020-06-12 16:45 ` [PATCH v2] proc/fd: Remove unnecessary variable initialisations " Markus Elfring
  2020-06-12 17:00   ` Matthew Wilcox
@ 2020-06-14  7:12   ` Greg KH
  1 sibling, 0 replies; 16+ messages in thread
From: Greg KH @ 2020-06-14  7:12 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Kaitao Cheng, linux-fsdevel, linux-kernel, kernel-janitors,
	Alexey Dobriyan, Colin Ian King, Muchun Song

On Fri, Jun 12, 2020 at 06:45:57PM +0200, Markus Elfring wrote:
> > '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

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

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

* Re: [PATCH v2] proc/fd: Adjust variable initialisations in seq_show()
  2020-06-12 16:09 [PATCH v2] proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show() Kaitao Cheng
  2020-06-12 16:45 ` [PATCH v2] proc/fd: Remove unnecessary variable initialisations " Markus Elfring
@ 2020-07-07  7:23 ` Markus Elfring
  1 sibling, 0 replies; 16+ messages in thread
From: Markus Elfring @ 2020-07-07  7:23 UTC (permalink / raw)
  To: Kaitao Cheng, linux-fsdevel
  Cc: kernel-janitors, linux-kernel, Alexey Dobriyan, Colin Ian King,
	Matthew Wilcox, Muchun Song

> '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

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

end of thread, other threads:[~2020-07-07  7:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 16:09 [PATCH v2] proc/fd: Remove unnecessary {files, f_flags, file} initialization in seq_show() Kaitao Cheng
2020-06-12 16:45 ` [PATCH v2] proc/fd: Remove unnecessary variable initialisations " Markus Elfring
2020-06-12 17:00   ` Matthew Wilcox
2020-06-12 17:03     ` Markus Elfring
2020-06-12 17:03     ` Markus Elfring
2020-06-12 17:04       ` Matthew Wilcox
2020-06-12 18:22         ` [v2] " Markus Elfring
2020-06-12 18:28           ` Matthew Wilcox
2020-06-12 18:43             ` Markus Elfring
2020-06-12 18:47               ` Matthew Wilcox
2020-06-12 19:00                 ` Markus Elfring
2020-06-12 19:00                 ` Markus Elfring
2020-06-12 19:02                   ` Matthew Wilcox
2020-06-12 19:49                   ` Al Viro
2020-06-14  7:12   ` [PATCH v2] " Greg KH
2020-07-07  7:23 ` [PATCH v2] proc/fd: Adjust " Markus Elfring

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).