[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <826fc010-5002-c9f0-1af6-36346e922cdb@web.de>
Date: Thu, 28 May 2020 18:04:04 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Tao pilgrim <pilgrimtao@...il.com>, linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Alexey Dobriyan <adobriyan@...il.com>,
Muchun Song <songmuchun@...edance.com>
Subject: Re: proc/fd: Remove the initialization of variables in seq_show()
>>> 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
Powered by blists - more mailing lists