All of lore.kernel.org
 help / color / mirror / Atom feed
* [cip:linux-4.4.y-cip 5512/23588] drivers/firmware/efi/capsule.c:249:16: warning: comparison between signed and unsigned integer expressions
@ 2024-09-09 21:11 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-09 21:11 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu, Pavel Machek; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git linux-4.4.y-cip
head:   309cb0b211f91a4c480ee93f99e73b723bea2c4a
commit: 03f417a59c6e2d6c62b7e2571049244bfc70e033 [5512/23588] efi: Add 'capsule' update support
config: arm64-randconfig-003-20240910 (https://download.01.org/0day-ci/archive/20240910/202409100533.8dGCN2ik-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240910/202409100533.8dGCN2ik-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409100533.8dGCN2ik-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/arm64/include/asm/hw_breakpoint.h:20:0,
                    from arch/arm64/include/asm/processor.h:33,
                    from arch/arm64/include/asm/spinlock.h:21,
                    from include/linux/spinlock.h:87,
                    from include/linux/mmzone.h:7,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from drivers/firmware/efi/capsule.c:12:
   arch/arm64/include/asm/cpufeature.h: In function 'arm64_ftr_value':
   arch/arm64/include/asm/cpufeature.h:152:68: warning: signed and unsigned type in conditional expression [-Wsign-compare]
      cpuid_feature_extract_field_width(val, ftrp->shift, ftrp->width) :
                                                                       ^
   drivers/firmware/efi/capsule.c: In function 'efi_capsule_update':
>> drivers/firmware/efi/capsule.c:249:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < sg_count; i++) {
                   ^
   drivers/firmware/efi/capsule.c:257:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < sg_count; i++) {
                   ^
   drivers/firmware/efi/capsule.c:266:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
                    ^
   drivers/firmware/efi/capsule.c:279:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if (i + 1 == sg_count)
                ^~
   drivers/firmware/efi/capsule.c:292:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; rv && i < sg_count; i++) {
                         ^


vim +249 drivers/firmware/efi/capsule.c

   194	
   195	/**
   196	 * efi_capsule_update - send a capsule to the firmware
   197	 * @capsule: capsule to send to firmware
   198	 * @pages: an array of capsule data pages
   199	 *
   200	 * Build a scatter gather list with EFI capsule block descriptors to
   201	 * map the capsule described by @capsule with its data in @pages and
   202	 * send it to the firmware via the UpdateCapsule() runtime service.
   203	 *
   204	 * @capsule must be a virtual mapping of the first page in @pages
   205	 * (@pages[0]) in the kernel address space. That is, a
   206	 * capsule_header_t that describes the entire contents of the capsule
   207	 * must be at the start of the first data page.
   208	 *
   209	 * Even though this function will validate that the firmware supports
   210	 * the capsule guid, users will likely want to check that
   211	 * efi_capsule_supported() returns true before calling this function
   212	 * because it makes it easier to print helpful error messages.
   213	 *
   214	 * If the capsule is successfully submitted to the firmware, any
   215	 * subsequent calls to efi_capsule_pending() will return true. @pages
   216	 * must not be released or modified if this function returns
   217	 * successfully.
   218	 *
   219	 * Callers must be prepared for this function to fail, which can
   220	 * happen if we raced with system reboot or if there is already a
   221	 * pending capsule that has a reset type that conflicts with the one
   222	 * required by @capsule. Do NOT use efi_capsule_pending() to detect
   223	 * this conflict since that would be racy. Instead, submit the capsule
   224	 * to efi_capsule_update() and check the return value.
   225	 *
   226	 * Return 0 on success, a converted EFI status code on failure.
   227	 */
   228	int efi_capsule_update(efi_capsule_header_t *capsule, struct page **pages)
   229	{
   230		u32 imagesize = capsule->imagesize;
   231		efi_guid_t guid = capsule->guid;
   232		unsigned int count, sg_count;
   233		u32 flags = capsule->flags;
   234		struct page **sg_pages;
   235		int rv, reset_type;
   236		int i, j;
   237	
   238		rv = efi_capsule_supported(guid, flags, imagesize, &reset_type);
   239		if (rv)
   240			return rv;
   241	
   242		count = DIV_ROUND_UP(imagesize, PAGE_SIZE);
   243		sg_count = sg_pages_num(count);
   244	
   245		sg_pages = kzalloc(sg_count * sizeof(*sg_pages), GFP_KERNEL);
   246		if (!sg_pages)
   247			return -ENOMEM;
   248	
 > 249		for (i = 0; i < sg_count; i++) {

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-09 21:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 21:11 [cip:linux-4.4.y-cip 5512/23588] drivers/firmware/efi/capsule.c:249:16: warning: comparison between signed and unsigned integer expressions kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.