Skip to content

Commit 1476ff2

Browse files
committed
iwl: fix debug printf format strings
The variable 'package_size' is an unsigned long, and should be printed out using '%lu', not '%zd' (that would be for a size_t). Yes, on many architectures (including x86-64), 'size_t' is in fact the same type as 'long', but that's a fairly random architecture definition, and on some platforms 'size_t' is in fact 'int' rather than 'long'. That is the case on traditional 32-bit x86. Yes, both types are the exact same 32-bit size, and it would all print out perfectly correctly, but '%zd' ends up still being wrong. And we can't make 'package_size' be a 'size_t', because we get the actual value using efivar_entry_get() that takes a pointer to an 'unsigned long'. So '%lu' it is. This fixes two of the i386 allmodconfig build warnings (that is now an error due to -Werror). Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1dbe7e3 commit 1476ff2

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/fw

1 file changed

+2
-2
lines changed

drivers/net/wireless/intel/iwlwifi/fw/uefi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
4949
err = efivar_entry_get(pnvm_efivar, NULL, &package_size, data);
5050
if (err) {
5151
IWL_DEBUG_FW(trans,
52-
"PNVM UEFI variable not found %d (len %zd)\n",
52+
"PNVM UEFI variable not found %d (len %lu)\n",
5353
err, package_size);
5454
kfree(data);
5555
data = ERR_PTR(err);
5656
goto out;
5757
}
5858

59-
IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %zd\n", package_size);
59+
IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %lu\n", package_size);
6060
*len = package_size;
6161

6262
out:

0 commit comments

Comments
 (0)