The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Aibing Chen <chenaibing@cmss.chinamobile.com>
Cc: Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
	linux-edac@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
Date: Sat, 5 Dec 2026 12:32:39 +0100	[thread overview]
Message-ID: <axP2Vz4eg87Tybol@alpha.franken.de> (raw)
In-Reply-To: <20261114121516.1306-1-chenaibing@cmss.chinamobile.com>

On Sat, Nov 14, 2026 at 08:15:15PM +0800, Aibing Chen wrote:
> _octeon_l2c_poll_oct2() builds an error message by prefixing buf1 with a
> short description.  buf1 holds up to 63 characters and the longest
> prefix is 33 characters ("Tag Single bit error (corrected):"), so the
> message needs up to 97 bytes, but buf2 is only 80 bytes.
> 
> Building with W=1 reports a -Wformat-truncation warning for each of the
> six snprintf() calls, e.g. for "L2D Double bit error (detected):%s" the
> compiler notes that the output can reach 97 bytes including the
> terminator, into a destination of size 80.  The printed message then
> loses the syndrome, type and way information that buf1 carries.
> 
> Size buf2 for the worst case.
> 
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
> ---
>  drivers/edac/octeon_edac-l2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
> index e6b1595a3..5eca6e204 100644
> --- a/drivers/edac/octeon_edac-l2c.c
> +++ b/drivers/edac/octeon_edac-l2c.c
> @@ -62,7 +62,7 @@ static void _octeon_l2c_poll_oct2(struct edac_device_ctl_info *l2c, int tad)
>  	union cvmx_l2c_err_tdtx err_tdtx, err_tdtx_reset;
>  	union cvmx_l2c_err_ttgx err_ttgx, err_ttgx_reset;
>  	char buf1[64];
> -	char buf2[80];
> +	char buf2[128];
>  
>  	err_tdtx_reset.u64 = 0;
>  	err_tdtx.u64 = cvmx_read_csr(CVMX_L2C_ERR_TDTX(tad));

applied to mips-next

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2026-12-05 11:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 12:15 [PATCH] EDAC/octeon: enlarge the L2C error message buffer Aibing Chen
2026-12-05 11:32 ` Thomas Bogendoerfer [this message]
2026-12-05 18:19   ` Borislav Petkov
2026-12-05 19:56     ` Thomas Bogendoerfer
2026-12-05 22:00       ` Borislav Petkov

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=axP2Vz4eg87Tybol@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=bp@alien8.de \
    --cc=chenaibing@cmss.chinamobile.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tony.luck@intel.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