Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: quickstart: Fix compilation warning on 64 bit arch

acpi_size is u32 or u64 depending on architecture. Cast it to
unsigned long and use %lu for printing.

This fix following build warning:
drivers/staging/quickstart/quickstart.c: In function ‘quickstart_acpi_ghid’:
drivers/staging/quickstart/quickstart.c:212:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘acpi_size’ [-Wformat]

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Szymon Janc and committed by
Greg Kroah-Hartman
5f01f7f3 af5728e0

+3 -2
+3 -2
drivers/staging/quickstart/quickstart.c
··· 209 209 quickstart->button->id = *(uint64_t *)buffer.pointer; 210 210 break; 211 211 default: 212 - pr_err("%s GHID method returned buffer of unexpected length %u\n", 213 - quickstart->button->name, buffer.length); 212 + pr_err("%s GHID method returned buffer of unexpected length %lu\n", 213 + quickstart->button->name, 214 + (unsigned long)buffer.length); 214 215 ret = -EINVAL; 215 216 break; 216 217 }