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

Uwe Kleine-König u.kleine-koenig at baylibre.com
Tue Jul 9 00:04:43 PDT 2024


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?)

Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240709/66d24751/attachment.sig>


More information about the linux-arm-kernel mailing list