Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mukesh Pilaniya <mpilaniy@redhat.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>,
	Philipp Rudo <prudo@redhat.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>, Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Andrew Morton <akpm@linux-foundation.org>,
	Baoquan He <baoquan.he@linux.dev>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Tao Liu <ltao@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	linux-riscv@lists.infradead.org, kexec@lists.infradead.org
Subject: Re: [PATCH v2 2/2] kexec: fix error propagation in kexec_image_probe_default()
Date: Fri, 21 Aug 2026 18:52:44 +0530	[thread overview]
Message-ID: <62cb1c7d-aa17-4d6d-b780-97cc40b7ff91@redhat.com> (raw)
In-Reply-To: <aogHeKQ8UnudNAMu@kernel.org>

Hi Mike, thanks for review.

On 21/08/26 1:38 pm, Mike Rapoport wrote:
> On Fri, Aug 21, 2026 at 12:48:15PM +0530, Mukesh Pilaniya wrote:
>> Hi Philipp,
>>
>> On 20/08/26 11:41 pm, Pratyush Yadav wrote:
>>> On Thu, Aug 20 2026, Philipp Rudo wrote:
>>>
>>>> Hi Mukesh,
>>>> Hi Pratyush,
>>>>
>>>> having this patch makes sense. Personally I'd go with having a
>>>> switch-case rather than individual if-blocks. E.g.
>>>>
>>>> 	switch (ret) {
>>>> 		case 0:
>>>> 			image->fops = *fops;
>>>> 			return 0;
>>>> 		case -ENOEXEC:
>>>> 			continue;
>>>> 		default:
>>>> 			return ret;
>>>> 	}
>>>>
>>>> IMHO that is better readable and easier to extend in case other error
>>>> codes need special handling as well. But that is only my personal
>>>> opinion.
>>>
>>> Well, IMO both look roughly the same so I unless Mukesh prefers your
>>> version more, we can keep it as-is.
>>>
>> Thanks for the review. I agree the switch-case reads nicely, but since
>> the current version is functionally equivalent and already
>> reviewed, I'll keep it as-is to avoid re-spinning for a style change.
>> Happy to switch if you or Pratyush feel strongly about it.
> 
> I'd like to request another style change :)
> 
> In newer code we often use 'err' rather than 'ret', so it's more obvious
> what this variable about.
> 
> I don't feel strong about if or switch, but if you go with if, please don't
> compare to 0, use !err.
>

Makes sense, will rename ret to err and use !err in v3.

-- 
Regards,
Mukesh Pilaniya



  reply	other threads:[~2026-08-21 13:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 17:47 [PATCH v2 0/2] kexec: fix probe error codes and error propagation Mukesh Pilaniya
2026-08-19 17:47 ` [PATCH v2 1/2] kexec: return -ENOEXEC from image probe functions on mismatch Mukesh Pilaniya
2026-08-19 18:33   ` Bradley Morgan
2026-08-19 17:47 ` [PATCH v2 2/2] kexec: fix error propagation in kexec_image_probe_default() Mukesh Pilaniya
2026-08-20 12:21   ` Philipp Rudo
2026-08-20 18:11     ` Pratyush Yadav
2026-08-21  7:18       ` Mukesh Pilaniya
2026-08-21  8:08         ` Mike Rapoport
2026-08-21 13:22           ` Mukesh Pilaniya [this message]
2026-08-21  8:40       ` Philipp Rudo
2026-08-20 18:08   ` Pratyush Yadav

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=62cb1c7d-aa17-4d6d-b780-97cc40b7ff91@redhat.com \
    --to=mpilaniy@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=baoquan.he@linux.dev \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=loongarch@lists.linux.dev \
    --cc=ltao@redhat.com \
    --cc=mark.rutland@arm.com \
    --cc=palmer@dabbelt.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pjw@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=prudo@redhat.com \
    --cc=rppt@kernel.org \
    --cc=will@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