From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.175.24.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796470554; b=vjVq0fuLkoWTVb7QtCyyd92CC+otjmFy8kwDR+G33uSqM6/XlH/+tTw6z9Y0VQ+AR5+P pdQl/5F8DtY65XZ6fT+LCYvMZKl7T977r3l1Kf4uIobZODZOWJORY6gS73gmvqAQnELKX WHjbLThbuYjob3L6ZB7/qhpMmPdLZbS3FdCr001gkhUto2/ZkJ2nTf8+6fLX7zvwO1THb dYIs4865GV8vBsvWuCuHxp7Bd17dEffjGUI3OiNZQtSHRdGnjermA8902BRF78uA254zf wE6mSN4+kG6gKViY5hMR3Jz6kYYuBsKbC1jrjJicyPnClTRKqS8JRA3N9CpwYU6GLTg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796470554; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=AIH8YLsC4xxkHDepDbCCnQbfScpNpnCZjkVLy5nhojc=; b=jerd/Kfz2wcsUnDoBbjG2s1m6OokqgSZNOEhoLi2VH3Y/MF645fEe6V34NzD2+jzzFtZ t2ds1UNDeQfyq9L2OhHQTrXtfCMj3LQBmGAEkOPvMLt3z3caM/BfmEWbbM7VR4TDVgAP+ Yxd5/H7zs5ugQjkgU2GKbbrL+RCGqT42D8dK32uIzRA3SWtKHPMemJHm0xiTilMtUceZn xuEzA5YrJ0okazeBKUUEmPym/OLUQITInGmQOKW7aHDF0c60k2uTZu+ddsxUvWAGPJAWJ vHhAlhkvcTdF9AKa6SSZa5iXf11VGsNmKQ2Hp+Lg/rHzIJIgcS+uWXHgiB1sVhnsp7g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.remote-ip=193.175.24.41 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B57606A330; Sat, 5 Dec 2026 11:35:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 55B57606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: by elvis.franken.de (Postfix, from userid 10) id 1B75B10042C; Sat, 5 Dec 2026 12:35:51 +0100 (CET) Received: by alpha.franken.de (Postfix, from userid 1000) id C069AC097F; Sat, 5 Dec 2026 12:32:39 +0100 (CET) Date: Sat, 5 Dec 2026 12:32:39 +0100 From: Thomas Bogendoerfer To: Aibing Chen Cc: Borislav Petkov , Tony Luck , 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 Message-ID: References: <20261114121516.1306-1-chenaibing@cmss.chinamobile.com> X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 ]