libpayload: Fix compiler warnings

Following warnings occur when compiling with
`i386-elf-gcc (coreboot toolchain v2022-09-18_c8870b1334) 11.2.0`

drivers/serial/8250.c:75: [-Werror=unused-variable]
  Move variable declaration inside the
  `#if !CONFIG(LP_PL011_SERIAL_CONSOLE)` block

drivers/udc/dwc2.c:505: [-Werror=format=]
  use `%zd` to match type `size_t`

Change-Id: Id285c24cba790f181fa203f3117e5df35bed27c4
Signed-off-by: Thomas Heijligen <src@posteo.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69764
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Thomas Heijligen 2022-11-17 21:43:11 +01:00 committed by Arthur Heymans
parent 6202fbbe90
commit 2332d29ba9
2 changed files with 2 additions and 2 deletions

View File

@ -72,9 +72,9 @@ static void serial_write_reg(uint8_t val, int offset)
static void serial_hardware_init(int speed, int word_bits, static void serial_hardware_init(int speed, int word_bits,
int parity, int stop_bits) int parity, int stop_bits)
{ {
#if !CONFIG(LP_PL011_SERIAL_CONSOLE)
unsigned char reg; unsigned char reg;
#if !CONFIG(LP_PL011_SERIAL_CONSOLE)
/* Disable interrupts. */ /* Disable interrupts. */
serial_write_reg(0, 0x01); serial_write_reg(0, 0x01);

View File

@ -502,7 +502,7 @@ static void complete_ep_transfer(struct usbdev_ctrl *this, int endpoint,
} }
SIMPLEQ_REMOVE_HEAD(&p->eps[endpoint][in_dir].job_queue, queue); SIMPLEQ_REMOVE_HEAD(&p->eps[endpoint][in_dir].job_queue, queue);
usb_debug("%d-%d: scheduled %zd, now %d bytes\n", endpoint, in_dir, usb_debug("%d-%d: scheduled %zd, now %zd bytes\n", endpoint, in_dir,
job->length, job->xfered_length); job->length, job->xfered_length);
if (this->current_config && if (this->current_config &&