linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Nathan Lynch <nathanl@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Cc: Paul Moore <paul@paul-moore.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	cocci@inria.fr
Subject: Re: powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()
Date: Sat, 18 Mar 2023 08:30:24 +0100	[thread overview]
Message-ID: <2f5a00f6-f3fb-9f00-676a-acdcbef90c6c@web.de> (raw)
In-Reply-To: <87v8iz75ck.fsf@linux.ibm.com>

>>>> The label “out_err” was used to jump to another pointer check despite of
>>>> the detail in the implementation of the function “pSeries_reconfig_add_node”
>>>> that it was determined already that the corresponding variable contained
>>>> a null pointer (because of a failed function call in two cases).
>>>>
>>>> 1. Thus return directly after a call of the function “kzalloc” failed.
>>>>
>>>> 2. Use more appropriate labels instead.
>>>>
>>>> 3. Delete a redundant check.
>>>>
>>>> 4. Omit an explicit initialisation for the local variable “err”.
>>>>
>>>> This issue was detected by using the Coccinelle software.
>>> Is there a correctness or safety issue here?
>> I got the impression that the application of only a single label like “out_err”
>> resulted in improvable implementation details.
> I don't understand what you're trying to say here.

What does hinder you to understand the presented change description better
at the moment?


> It doesn't seem to answer my question.


I hope that my answer will trigger further helpful considerations.


>>> The subject uses the word "fix" but the commit message doesn't seem to identify one.
>> Can you find the proposed adjustments reasonable?
> In the absence of a bug fix or an improvement in readability, not really, sorry.

The views are varying for “programming bugs”, aren't they?


> It adds to the function more goto labels and another return,

This is the suggested source code transformation.


> apparently to avoid checks

Can the support grow for such a programming goal?



> that are sometimes redundant

Can such implementation details become undesirable?


> (but not incorrect) at the C source code level.

Will this aspect affect further development concerns?



>> Please take another look at available information sources.
>> https://lore.kernel.org/cocci/f9303bdc-b1a7-be5e-56c6-dfa8232b8b55@web.de/
> I wasn't cc'd on this and I'm not subscribed to any lists in the recipients
> for that message, so not sure how I would take "another" look. :-)

I imagine that you can benefit more from information which can be retrieved
by archive interfaces also according to the mailing list of the Coccinelle software.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/coccinelle.rst?h=v6.3-rc2#n9

Regards,
Markus

  reply	other threads:[~2023-03-18  7:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f9303bdc-b1a7-be5e-56c6-dfa8232b8b55@web.de>
2023-03-16 20:07 ` [PATCH 0/4] powerpc/4xx: Adjustments for four function implementations Markus Elfring
2023-03-16 20:10   ` [PATCH 1/4] powerpc/4xx: Fix exception handling in ppc4xx_pciex_port_setup_hose() Markus Elfring
2023-03-16 20:14   ` [PATCH 2/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pcix_bridge() Markus Elfring
2023-03-16 20:16   ` [PATCH 3/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pci_bridge() Markus Elfring
2023-03-16 20:18   ` [PATCH 4/4] powerpc/4xx: Delete unnecessary variable initialisations in four functions Markus Elfring
2023-03-25 15:30   ` [PATCH v2 0/4] powerpc/4xx: Adjustments for four function implementations Markus Elfring
2023-03-25 15:36     ` [PATCH v2 1/4] powerpc/4xx: Fix exception handling in ppc4xx_pciex_port_setup_hose() Markus Elfring
2023-03-25 15:38     ` [PATCH v2 2/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pcix_bridge() Markus Elfring
2023-03-25 15:40     ` [PATCH v2 3/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pci_bridge() Markus Elfring
2023-03-25 15:42     ` [PATCH v2 4/4] powerpc/4xx: Delete unnecessary variable initialisations in four functions Markus Elfring
2024-01-05 17:42     ` [PATCH v2 0/4] powerpc/4xx: Adjustments for four function implementations Markus Elfring
2023-03-17  8:50 ` [PATCH] powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node() Markus Elfring
2023-03-17 13:11   ` Nathan Lynch
2023-03-17 14:20     ` Markus Elfring
2023-03-17 15:41       ` Nathan Lynch
2023-03-18  7:30         ` Markus Elfring [this message]
2023-03-20 15:38           ` Nathan Lynch
2023-03-21  6:54             ` Markus Elfring
2023-03-21 10:30               ` [PATCH v2 0/2] powerpc/pseries: Fixes for " Markus Elfring
2023-03-21 10:33                 ` [PATCH v2 1/2] powerpc/pseries: Do not pass an error pointer to of_node_put() " Markus Elfring
2023-03-21 10:36                 ` [PATCH v2 2/2] powerpc/pseries: Fix exception handling " Markus Elfring
2023-03-25 13:40                 ` [PATCH resent v2 0/2] powerpc/pseries: Fixes for " Markus Elfring
2023-03-25 13:42                   ` [PATCH resent v2 1/2] powerpc/pseries: Do not pass an error pointer to of_node_put() " Markus Elfring
2023-03-25 13:44                   ` [PATCH resent v2 2/2] powerpc/pseries: Fix exception handling " Markus Elfring
2024-01-05 17:19                   ` [PATCH resent v2 0/2] powerpc/pseries: Fixes for " Markus Elfring

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=2f5a00f6-f3fb-9f00-676a-acdcbef90c6c@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nathanl@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=paul@paul-moore.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;
as well as URLs for NNTP newsgroup(s).