mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Tao pilgrim <pilgrimtao@gmail.com>, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: Re: proc/fd: Remove the initialization of variables in seq_show()
Date: Thu, 28 May 2020 18:04:04 +0200	[thread overview]
Message-ID: <826fc010-5002-c9f0-1af6-36346e922cdb@web.de> (raw)
In-Reply-To: <CAAWJmAYox7VNCzj7FnRdiX450wd=DtZAcZv3_2JiPmBuLvUMeQ@mail.gmail.com>

>>> The variables{files, file} will definitely be assigned,
>>
>> I find an other specification nicer for these identifiers.
>>
>>
>>> so we don't need to initialize them.
> We don't need to initialize the variable “file”.

I can agree to this interpretation of the software situation
because there is a precondition involved for the variable “ret”.
https://elixir.bootlin.com/linux/v5.7-rc7/source/fs/proc/fd.c#L20
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/proc/fd.c?id=b0c3ba31be3e45a130e13b278cf3b90f69bda6f6#n20


> I don't find the programming concerns around the handling of the null
> pointer for the variable “file”.

I find the initial change description too terse and therefore incomplete.


> If you have other suggestions, please elaborate on the details.

I propose to extend the patch.
How do you think about to convert initialisations for the variables
“f_flags” and “ret” also into later assignments?

Regards,
Markus

      reply	other threads:[~2020-05-28 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24  7:46 [PATCH] " Markus Elfring
2020-05-28 12:51 ` Tao pilgrim
2020-05-28 16:04   ` Markus Elfring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=826fc010-5002-c9f0-1af6-36346e922cdb@web.de \
    --to=markus.elfring@web.de \
    --cc=adobriyan@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pilgrimtao@gmail.com \
    --cc=songmuchun@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®