Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "longwei (I)" <longwei27@huawei.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>, <kexec@lists.infradead.org>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<hewenliang4@huawei.com>
Subject: Re: [PATCH V2] kho: Convert error handling to immediate return pattern
Date: Mon, 31 Aug 2026 19:58:35 +0800	[thread overview]
Message-ID: <b5979755-6089-4e6e-844d-2e6f32f687a6@huawei.com> (raw)
In-Reply-To: <178817571946.3691424.3757525664520719609.b4-review@b4>

Hi Mike Rapoport,

Thanks for the review.
To be honest, I haven't observed any actual failures in this path in our production environment.
This change was identified during our internal team code review—the err |= func() pattern looked concerning to us at first glance, so we attempted to clean it up.

However, I agree with your assessment: the caller doesn't care about the exact error value, libfdt uses its own error codes, and this is a cold path where failures are unlikely. The change is indeed unnecessary churn without a concrete bug to fix.

I'll drop this patch. Please ignore this submission.

Thanks,
Long Wei

在 2026/8/31 19:28, Mike Rapoport 写道:
> Hi,
> 
> 
>> Replace the chained error accumulation (err |= func()) with immediate
>> per-step error checking and early return in kho_out_fdt_setup().
>>
>> Two problems with the current approach:
>> 1. It continues executing FDT operations even after a failure, which
>>    is pointless and potentially unsafe on an invalid FDT context.
> 
> Did you actually see failures here or was it an LLM suggesting that they
> may happen?
> 
>> 2. Bitwise OR of multiple negative error codes produces a result that
>>    may not represent any actual error, making debugging misleading.
>>
>> Early return fails fast and preserves the original error code for
>> accurate diagnosis.
> 
> The caller does not care about the exact error value, so the diagnosis
> statement is moot at best.
> Moreover, libfdt does not return Linux error values.
> 



      reply	other threads:[~2026-08-31 11:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00c96a62-f783-497c-a7ac-1de495e4af06@huawei.com>
2026-08-24  2:44 ` [PATCH V2] kho: Convert error handling to immediate return pattern LongWei27
2026-08-24  2:54   ` Matthew Wilcox
2026-08-24  6:34     ` longwei (I)
2026-08-31 11:28   ` Mike Rapoport
2026-08-31 11:58     ` longwei (I) [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=b5979755-6089-4e6e-844d-2e6f32f687a6@huawei.com \
    --to=longwei27@huawei.com \
    --cc=graf@amazon.com \
    --cc=hewenliang4@huawei.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    /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