From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 30 May 2016 13:56:16 -0400 Subject: [U-Boot] cmd: disk: Fix unused variable warning In-Reply-To: <1462055754-6357-1-git-send-email-marex@denx.de> References: <1462055754-6357-1-git-send-email-marex@denx.de> Message-ID: <20160530175616.GH7419@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, May 01, 2016 at 12:35:54AM +0200, Marek Vasut wrote: > If serial support is not compiled into U-Boot, which may be the case > for some SPL builds, the following warning will be generated in disk.c: > > cmd/disk.c: In function 'common_diskboot': > cmd/disk.c:16:6: warning: variable 'dev' set but not used [-Wunused-but-set-variable] > int dev, part; > ^ > The warning is a result of printf() calls being optimized away, and > thus the whole dev variable becomes indeed unused. Mark the variable > as __maybe_unused . > > Signed-off-by: Marek Vasut > Cc: Simon Glass > Cc: Tom Rini > Reviewed-by: Simon Glass > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: