All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, zhangjian <zhangjian496@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-6.6 3493/3493] mm/gmem.c:383:13: warning: unused variable 'nid'
Date: Tue, 9 Dec 2025 00:12:01 +0800	[thread overview]
Message-ID: <202512090002.kbElJ2I7-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   36141432a37f7dedddde8825e724b07ce3a440fb
commit: 18b5064b5892580f89d7eca015f884ce10190bac [3493/3493] gmem: hmemcpy should use dma for phy addr
config: x86_64-randconfig-161-20251208 (https://download.01.org/0day-ci/archive/20251209/202512090002.kbElJ2I7-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251209/202512090002.kbElJ2I7-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/202512090002.kbElJ2I7-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/gmem.c: In function 'gm_as_attach':
>> mm/gmem.c:383:13: warning: unused variable 'nid' [-Wunused-variable]
     383 |         int nid;
         |             ^~~


vim +/nid +383 mm/gmem.c

380709c322aaa3 Cunshu Ni 2025-11-01  378  
380709c322aaa3 Cunshu Ni 2025-11-01  379  int gm_as_attach(struct gm_as *as, struct gm_dev *dev,
380709c322aaa3 Cunshu Ni 2025-11-01  380  			bool activate, struct gm_context **out_ctx)
380709c322aaa3 Cunshu Ni 2025-11-01  381  {
380709c322aaa3 Cunshu Ni 2025-11-01  382  	struct gm_context *ctx;
380709c322aaa3 Cunshu Ni 2025-11-01 @383  	int nid;
380709c322aaa3 Cunshu Ni 2025-11-01  384  
380709c322aaa3 Cunshu Ni 2025-11-01  385  	ctx = kmem_cache_alloc(gm_ctx_cache, GFP_KERNEL);
380709c322aaa3 Cunshu Ni 2025-11-01  386  	if (!ctx)
380709c322aaa3 Cunshu Ni 2025-11-01  387  		return -ENOMEM;
380709c322aaa3 Cunshu Ni 2025-11-01  388  
380709c322aaa3 Cunshu Ni 2025-11-01  389  	ctx->as = as;
380709c322aaa3 Cunshu Ni 2025-11-01  390  	ctx->dev = dev;
380709c322aaa3 Cunshu Ni 2025-11-01  391  
380709c322aaa3 Cunshu Ni 2025-11-01  392  	INIT_LIST_HEAD(&ctx->gm_dev_link);
380709c322aaa3 Cunshu Ni 2025-11-01  393  	INIT_LIST_HEAD(&ctx->gm_as_link);
380709c322aaa3 Cunshu Ni 2025-11-01  394  
380709c322aaa3 Cunshu Ni 2025-11-01  395  	if (!list_empty(&as->gm_ctx_list)) {
380709c322aaa3 Cunshu Ni 2025-11-01  396  		struct list_head *old_node;
380709c322aaa3 Cunshu Ni 2025-11-01  397  		struct gm_context *old_ctx;
380709c322aaa3 Cunshu Ni 2025-11-01  398  
380709c322aaa3 Cunshu Ni 2025-11-01  399  		old_node = as->gm_ctx_list.prev;
380709c322aaa3 Cunshu Ni 2025-11-01  400  		list_del_init(old_node);
380709c322aaa3 Cunshu Ni 2025-11-01  401  		old_ctx = list_entry(old_node, struct gm_context, gm_as_link);
380709c322aaa3 Cunshu Ni 2025-11-01  402  		kfree(old_ctx);
380709c322aaa3 Cunshu Ni 2025-11-01  403  	}
380709c322aaa3 Cunshu Ni 2025-11-01  404  
380709c322aaa3 Cunshu Ni 2025-11-01  405  	list_add_tail(&dev->gm_ctx_list, &ctx->gm_dev_link);
380709c322aaa3 Cunshu Ni 2025-11-01  406  	list_add_tail(&ctx->gm_as_link, &as->gm_ctx_list);
380709c322aaa3 Cunshu Ni 2025-11-01  407  
380709c322aaa3 Cunshu Ni 2025-11-01  408  	if (activate) {
380709c322aaa3 Cunshu Ni 2025-11-01  409  		/*
380709c322aaa3 Cunshu Ni 2025-11-01  410  		 * Here we should really have a callback function to perform the context switch
380709c322aaa3 Cunshu Ni 2025-11-01  411  		 * for the hardware. E.g. in x86 this function is effectively
380709c322aaa3 Cunshu Ni 2025-11-01  412  		 * flushing the CR3 value. Currently we do not care time-sliced context switch,
380709c322aaa3 Cunshu Ni 2025-11-01  413  		 * unless someone wants to support it.
380709c322aaa3 Cunshu Ni 2025-11-01  414  		 */
380709c322aaa3 Cunshu Ni 2025-11-01  415  		dev->current_ctx = ctx;
380709c322aaa3 Cunshu Ni 2025-11-01  416  	}
380709c322aaa3 Cunshu Ni 2025-11-01  417  	*out_ctx = ctx;
380709c322aaa3 Cunshu Ni 2025-11-01  418  
380709c322aaa3 Cunshu Ni 2025-11-01  419  	/*
380709c322aaa3 Cunshu Ni 2025-11-01  420  	 * gm_as_attach will be used to attach device to process address space.
380709c322aaa3 Cunshu Ni 2025-11-01  421  	 * Handle this case and add hnodes registered by device to process mems_allowed.
380709c322aaa3 Cunshu Ni 2025-11-01  422  	 */
18b5064b589258 Ni Cunshu 2025-12-08  423  #ifdef CONFIG_CPUSETS
380709c322aaa3 Cunshu Ni 2025-11-01  424  	for_each_node_mask(nid, dev->registered_hnodes)
380709c322aaa3 Cunshu Ni 2025-11-01  425  		node_set(nid, current->mems_allowed);
18b5064b589258 Ni Cunshu 2025-12-08  426  #endif
380709c322aaa3 Cunshu Ni 2025-11-01  427  	return 0;
380709c322aaa3 Cunshu Ni 2025-11-01  428  }
380709c322aaa3 Cunshu Ni 2025-11-01  429  EXPORT_SYMBOL_GPL(gm_as_attach);
2ce9e864fa288b Cunshu Ni 2025-11-02  430  

:::::: The code at line 383 was first introduced by commit
:::::: 380709c322aaa306b5ac3c278a0700043f7d33e2 gmem: prepare config, boot parameter, vma flag and basic GMEM related structs

:::::: TO: Cunshu Ni <nicunshu@huawei.com>
:::::: CC: zhangjian <zhangjian496@huawei.com>

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

                 reply	other threads:[~2025-12-08 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202512090002.kbElJ2I7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=zhangjian496@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.