linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/net/wireless/intel/iwlwifi/fw/uefi.c:51:14: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long'
@ 2021-07-26  0:16 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-07-26  0:16 UTC (permalink / raw)
  To: Luca Coelho; +Cc: clang-built-linux, kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4927 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ff1176468d368232b684f75e82563369208bc371
commit: 84c3c9952afbf7df39937095aa0ad70b58703e91 iwlwifi: move UEFI code to a separate file
date:   5 weeks ago
config: arm-randconfig-r002-20210726 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c63dbd850182797bc4b76124d08e1c320ab2365d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=84c3c9952afbf7df39937095aa0ad70b58703e91
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 84c3c9952afbf7df39937095aa0ad70b58703e91
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/intel/iwlwifi/fw/uefi.c:51:14: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long' [-Wformat]
                                err, package_size);
                                     ^~~~~~~~~~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:184:64: note: expanded from macro 'IWL_DEBUG_FW'
   #define IWL_DEBUG_FW(p, f, a...)        IWL_DEBUG(p, IWL_DL_FW, f, ## a)
                                                                   ~     ^
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:88:49: note: expanded from macro 'IWL_DEBUG'
           __IWL_DEBUG_DEV((m)->dev, level, false, fmt, ##args)
                                                   ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:85:49: note: expanded from macro '__IWL_DEBUG_DEV'
                   __iwl_dbg(dev, level, limit, __func__, fmt, ##args);    \
                                                          ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/fw/uefi.c:57:61: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long' [-Wformat]
           IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %zd\n", package_size);
                                                              ~~~     ^~~~~~~~~~~~
                                                              %lu
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:184:64: note: expanded from macro 'IWL_DEBUG_FW'
   #define IWL_DEBUG_FW(p, f, a...)        IWL_DEBUG(p, IWL_DL_FW, f, ## a)
                                                                   ~     ^
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:88:49: note: expanded from macro 'IWL_DEBUG'
           __IWL_DEBUG_DEV((m)->dev, level, false, fmt, ##args)
                                                   ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:85:49: note: expanded from macro '__IWL_DEBUG_DEV'
                   __iwl_dbg(dev, level, limit, __func__, fmt, ##args);    \
                                                          ~~~    ^~~~
   2 warnings generated.


vim +51 drivers/net/wireless/intel/iwlwifi/fw/uefi.c

    13	
    14	#define IWL_EFI_VAR_GUID EFI_GUID(0x92daaf2f, 0xc02b, 0x455b,	\
    15					  0xb2, 0xec, 0xf5, 0xa3,	\
    16					  0x59, 0x4f, 0x4a, 0xea)
    17	
    18	void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
    19	{
    20		struct efivar_entry *pnvm_efivar;
    21		void *data;
    22		unsigned long package_size;
    23		int err;
    24	
    25		pnvm_efivar = kzalloc(sizeof(*pnvm_efivar), GFP_KERNEL);
    26		if (!pnvm_efivar)
    27			return ERR_PTR(-ENOMEM);
    28	
    29		memcpy(&pnvm_efivar->var.VariableName, IWL_UEFI_OEM_PNVM_NAME,
    30		       sizeof(IWL_UEFI_OEM_PNVM_NAME));
    31		pnvm_efivar->var.VendorGuid = IWL_EFI_VAR_GUID;
    32	
    33		/*
    34		 * TODO: we hardcode a maximum length here, because reading
    35		 * from the UEFI is not working.  To implement this properly,
    36		 * we have to call efivar_entry_size().
    37		 */
    38		package_size = IWL_HARDCODED_PNVM_SIZE;
    39	
    40		data = kmalloc(package_size, GFP_KERNEL);
    41		if (!data) {
    42			data = ERR_PTR(-ENOMEM);
    43			*len = 0;
    44			goto out;
    45		}
    46	
    47		err = efivar_entry_get(pnvm_efivar, NULL, &package_size, data);
    48		if (err) {
    49			IWL_DEBUG_FW(trans,
    50				     "PNVM UEFI variable not found %d (len %zd)\n",
  > 51				     err, package_size);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37363 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/net/wireless/intel/iwlwifi/fw/uefi.c:51:14: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long'
@ 2021-08-26 11:01 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-08-26 11:01 UTC (permalink / raw)
  To: Luca Coelho; +Cc: llvm, kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4866 bytes --]

Hi Luca,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   73f3af7b4611d77bdaea303fb639333eb28e37d7
commit: 84c3c9952afbf7df39937095aa0ad70b58703e91 iwlwifi: move UEFI code to a separate file
date:   9 weeks ago
config: i386-randconfig-r023-20210826 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=84c3c9952afbf7df39937095aa0ad70b58703e91
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 84c3c9952afbf7df39937095aa0ad70b58703e91
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/intel/iwlwifi/fw/uefi.c:51:14: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long' [-Wformat]
                                err, package_size);
                                     ^~~~~~~~~~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:184:64: note: expanded from macro 'IWL_DEBUG_FW'
   #define IWL_DEBUG_FW(p, f, a...)        IWL_DEBUG(p, IWL_DL_FW, f, ## a)
                                                                   ~     ^
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:88:49: note: expanded from macro 'IWL_DEBUG'
           __IWL_DEBUG_DEV((m)->dev, level, false, fmt, ##args)
                                                   ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:85:49: note: expanded from macro '__IWL_DEBUG_DEV'
                   __iwl_dbg(dev, level, limit, __func__, fmt, ##args);    \
                                                          ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/fw/uefi.c:57:61: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long' [-Wformat]
           IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %zd\n", package_size);
                                                              ~~~     ^~~~~~~~~~~~
                                                              %lu
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:184:64: note: expanded from macro 'IWL_DEBUG_FW'
   #define IWL_DEBUG_FW(p, f, a...)        IWL_DEBUG(p, IWL_DL_FW, f, ## a)
                                                                   ~     ^
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:88:49: note: expanded from macro 'IWL_DEBUG'
           __IWL_DEBUG_DEV((m)->dev, level, false, fmt, ##args)
                                                   ~~~    ^~~~
   drivers/net/wireless/intel/iwlwifi/iwl-debug.h:85:49: note: expanded from macro '__IWL_DEBUG_DEV'
                   __iwl_dbg(dev, level, limit, __func__, fmt, ##args);    \
                                                          ~~~    ^~~~
   2 warnings generated.


vim +51 drivers/net/wireless/intel/iwlwifi/fw/uefi.c

    13	
    14	#define IWL_EFI_VAR_GUID EFI_GUID(0x92daaf2f, 0xc02b, 0x455b,	\
    15					  0xb2, 0xec, 0xf5, 0xa3,	\
    16					  0x59, 0x4f, 0x4a, 0xea)
    17	
    18	void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
    19	{
    20		struct efivar_entry *pnvm_efivar;
    21		void *data;
    22		unsigned long package_size;
    23		int err;
    24	
    25		pnvm_efivar = kzalloc(sizeof(*pnvm_efivar), GFP_KERNEL);
    26		if (!pnvm_efivar)
    27			return ERR_PTR(-ENOMEM);
    28	
    29		memcpy(&pnvm_efivar->var.VariableName, IWL_UEFI_OEM_PNVM_NAME,
    30		       sizeof(IWL_UEFI_OEM_PNVM_NAME));
    31		pnvm_efivar->var.VendorGuid = IWL_EFI_VAR_GUID;
    32	
    33		/*
    34		 * TODO: we hardcode a maximum length here, because reading
    35		 * from the UEFI is not working.  To implement this properly,
    36		 * we have to call efivar_entry_size().
    37		 */
    38		package_size = IWL_HARDCODED_PNVM_SIZE;
    39	
    40		data = kmalloc(package_size, GFP_KERNEL);
    41		if (!data) {
    42			data = ERR_PTR(-ENOMEM);
    43			*len = 0;
    44			goto out;
    45		}
    46	
    47		err = efivar_entry_get(pnvm_efivar, NULL, &package_size, data);
    48		if (err) {
    49			IWL_DEBUG_FW(trans,
    50				     "PNVM UEFI variable not found %d (len %zd)\n",
  > 51				     err, package_size);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40684 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-26 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26  0:16 drivers/net/wireless/intel/iwlwifi/fw/uefi.c:51:14: warning: format specifies type 'ssize_t' (aka 'int') but the argument has type 'unsigned long' kernel test robot
2021-08-26 11:01 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).