All of lore.kernel.org
 help / color / mirror / Atom feed
* [leon-rdma:rdma-next 43/50] drivers/infiniband/hw/mlx5/odp.c:572:3: warning: variable 'access_mask' is uninitialized when used here
@ 2024-02-01  1:11 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-02-01  1:11 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
head:   17282587cdc0f20c27d7404ac1caa5ebe4e9d87b
commit: 0f8d73f33588b9e1db56ab89f2eb7d1cb7f30583 [43/50] RDMA/umem: Store ODP access mask information in PFN
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20240201/202402010925.gklK6eFn-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fdac7d0b6f74f919d319b31a0680c77f66732586)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240201/202402010925.gklK6eFn-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/202402010925.gklK6eFn-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/infiniband/hw/mlx5/odp.c:572:3: warning: variable 'access_mask' is uninitialized when used here [-Wuninitialized]
     572 |                 access_mask |= HMM_PFN_WRITE;
         |                 ^~~~~~~~~~~
   drivers/infiniband/hw/mlx5/odp.c:557:17: note: initialize the variable 'access_mask' to silence this warning
     557 |         u64 access_mask;
         |                        ^
         |                         = 0
   1 warning generated.


vim +/access_mask +572 drivers/infiniband/hw/mlx5/odp.c

   547	
   548	#define MLX5_PF_FLAGS_DOWNGRADE BIT(1)
   549	#define MLX5_PF_FLAGS_SNAPSHOT BIT(2)
   550	#define MLX5_PF_FLAGS_ENABLE BIT(3)
   551	static int pagefault_real_mr(struct mlx5_ib_mr *mr, struct ib_umem_odp *odp,
   552				     u64 user_va, size_t bcnt, u32 *bytes_mapped,
   553				     u32 flags)
   554	{
   555		int page_shift, ret, np;
   556		bool downgrade = flags & MLX5_PF_FLAGS_DOWNGRADE;
   557		u64 access_mask;
   558		u64 start_idx;
   559		bool fault = !(flags & MLX5_PF_FLAGS_SNAPSHOT);
   560		u32 xlt_flags = MLX5_IB_UPD_XLT_ATOMIC;
   561	
   562		if (flags & MLX5_PF_FLAGS_ENABLE)
   563			xlt_flags |= MLX5_IB_UPD_XLT_ENABLE;
   564	
   565		if (flags & MLX5_PF_FLAGS_DOWNGRADE)
   566			xlt_flags |= MLX5_IB_UPD_XLT_DOWNGRADE;
   567	
   568		page_shift = odp->page_shift;
   569		start_idx = (user_va - ib_umem_start(odp)) >> page_shift;
   570	
   571		if (odp->umem.writable && !downgrade)
 > 572			access_mask |= HMM_PFN_WRITE;
   573	
   574		np = ib_umem_odp_map_dma_and_lock(odp, user_va, bcnt, access_mask, fault);
   575		if (np < 0)
   576			return np;
   577	
   578		/*
   579		 * No need to check whether the MTTs really belong to this MR, since
   580		 * ib_umem_odp_map_dma_and_lock already checks this.
   581		 */
   582		ret = mlx5r_umr_update_xlt(mr, start_idx, np, page_shift, xlt_flags);
   583		mutex_unlock(&odp->umem_mutex);
   584	
   585		if (ret < 0) {
   586			if (ret != -EAGAIN)
   587				mlx5_ib_err(mr_to_mdev(mr),
   588					    "Failed to update mkey page tables\n");
   589			goto out;
   590		}
   591	
   592		if (bytes_mapped) {
   593			u32 new_mappings = (np << page_shift) -
   594				(user_va - round_down(user_va, 1 << page_shift));
   595	
   596			*bytes_mapped += min_t(u32, new_mappings, bcnt);
   597		}
   598	
   599		return np << (page_shift - PAGE_SHIFT);
   600	
   601	out:
   602		return ret;
   603	}
   604	

-- 
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-02-01  1:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01  1:11 [leon-rdma:rdma-next 43/50] drivers/infiniband/hw/mlx5/odp.c:572:3: warning: variable 'access_mask' is uninitialized when used here 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.