[PATCH] ARM: mvebu: Drop a write-only variable

Andrew Lunn andrew at lunn.ch
Tue Jul 9 06:00:20 PDT 2024


On Tue, Jul 09, 2024 at 09:04:43AM +0200, Uwe Kleine-König wrote:
> On Mon, Jul 08, 2024 at 03:42:40PM +0200, Andrew Lunn wrote:
> > On Mon, Jul 08, 2024 at 11:31:42AM +0200, Uwe Kleine-König wrote:
> > > This fixes a W=1 compiler error:
> > > 
> > > 	arch/arm/mach-mvebu/board-v7.c: In function ‘mvebu_scan_mem’:
> > > 	arch/arm/mach-mvebu/board-v7.c:84:27: error: variable ‘size’ set but not used [-Werror=unused-but-set-variable]
> > > 	   84 |                 u64 base, size;
> > > 	      |                           ^~~~
> > > 
> > > Fixes: 8da2b2f7ceee ("ARM: mvebu: reserve the first 10 KB of each memory bank for suspend/resume")
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
> > > ---
> > > Hello,
> > > 
> > > not entirely sure about the correctness of this patch. Maybe you want to
> > > error out if size < MVEBU_DDR_TRAINING_AREA_SZ?
> > 
> > I think it is too late for that now, although it would of been
> > correct. There could be DT blobs in use which have this wrong, and now
> > enforcing it would cause a regression. The best we can do is print a
> > warning.
> 
> What is the right incarnation to do so? I think this happens very early
> during boot, is pr_warn() suitable? Or better use WARN_ON? (Or was WARN_ON
> the one we're not supposed to use?)

WARN_ON() is being pushed back on, since in some setups it causes a
reboot. So pr_warn() would be better. It should work this early, but
it is likely to be cached and output later, unless ernlyprintk is
enabled.

	Andrew



More information about the linux-arm-kernel mailing list