mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org,
	Ashok Raj <ashok.raj@oss.qualcomm.com>,
	James Morse <james.morse@arm.com>,
	Mark Brown <broonie@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Hanjun Guo <guohanjun@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Breno Leitao <leitao@debian.org>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Dan Williams <djbw@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Morduan Zang <zhangdandan@uniontech.com>,
	linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org,
	acpica-devel@lists.linux.dev
Subject: Re: [PATCH v4 11/12] EDAC/ghes: Small buffer fixes for mem other_detail helpers
Date: Wed, 25 Nov 2026 17:29:57 +0100	[thread overview]
Message-ID: <ca44753b-5d4c-4fc1-b4a7-acab1f009d04@arm.com> (raw)
In-Reply-To: <20261124043051.GNawUS-yBnVpnuUVhH@fat_crate.local>

Hello Borislav,

On 11/24/26 05:30, Borislav Petkov wrote:
> On Fri, Nov 13, 2026 at 02:24:53PM +0100, Pierre Gondois wrote:
>> scnprintf() already reserves space for the terminating NULL,
>> leaving one byte unused and under-flowing the capacity when len=0.
>> Callers also remove the last character unconditionally, which
>> can discard valid text after truncation.
>>
>> Update the following functions to fix the above issues.
>> - print_mem_error_other_detail()
>> - print_mem_error2_other_detail()
>>
>> Signed-off-by: Pierre Gondois<pierre.gondois@arm.com>
>> ---
>>   drivers/edac/ghes_edac.c | 18 ++++++++----------
>>   1 file changed, 8 insertions(+), 10 deletions(-)
> Fixes go *first* in a patchset. Then you don't have to fix a function you just
> added in your patchset.

Since the functions are effectively duplicated logic but must be
distinct as operating on different structures, I thought it would
be easier to review to first add the function duplicates and then
fix the 2 functions the same way.

I'll re-organize the patches following an order close to what
Yazen suggested at:
https://lore.kernel.org/all/20261124151417.GB2156781@yaz-khff2.amd.com/

I might take some 'fix' patches from:
https://lore.kernel.org/all/20261117111444.4185512-1-pierre.gondois@arm.com/
when possible/necessary.

> Also, the patch subject should have a verb.
Ok sure
> Also, those functions you're touching here look to me like they're duplicating
> a bunch of code...

I think this is what was advised by Jonathan at:

https://lore.kernel.org/all/20261014094744.00007c0c@oss.qualcomm.com/

Regards,
Pierre


  reply	other threads:[~2026-11-25 16:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 13:24 [PATCH v4 00/12] CPER: Add Memory Error Section 2 support Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 01/12] cper: use BIT_ULL() for processor and memory validation bits Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 02/12] cper: add Memory Error Section 2 structures Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 03/12] cper: add helpers to handle Memory Error Section 2 Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 04/12] cper: Return actual bytes written by DIMM location helpers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 05/12] EDAC/ghes: Extract error report initialization Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 06/12] ACPI: APEI: Extract common memory failure handling Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 07/12] ACPI: APEI: add separate Memory Error Section 2 handlers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 08/12] ACPI: extlog: add Memory Error Section 2 trace event Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 09/12] efi/cper: Pass buffer length to DIMM location helpers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 10/12] efi/cper: Pass buffer length to memory " Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 11/12] EDAC/ghes: Small buffer fixes for mem other_detail helpers Pierre Gondois
2026-11-24  4:30   ` Borislav Petkov
2026-11-25 16:29     ` Pierre Gondois [this message]
2026-11-13 13:24 ` [PATCH v4 12/12] efi/cper: Increase memory error location and detail buffer sizes Pierre Gondois
2026-11-24  4:24 ` [PATCH v4 00/12] CPER: Add Memory Error Section 2 support Borislav Petkov
2026-11-25 16:30   ` Pierre Gondois
2026-11-24 15:14 ` Yazen Ghannam
2026-11-25 16:30   ` Pierre Gondois
2026-11-25 16:58     ` Yazen Ghannam

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=ca44753b-5d4c-4fc1-b4a7-acab1f009d04@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=acpica-devel@lists.linux.dev \
    --cc=ardb@kernel.org \
    --cc=ashok.raj@oss.qualcomm.com \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=fabio.m.de.francesco@linux.intel.com \
    --cc=guohanjun@huawei.com \
    --cc=james.morse@arm.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=leitao@debian.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mchehab@kernel.org \
    --cc=pawel.chmielewski@intel.com \
    --cc=rafael@kernel.org \
    --cc=terry.bowman@amd.com \
    --cc=tony.luck@intel.com \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zhangdandan@uniontech.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®