All of lore.kernel.org
 help / color / mirror / Atom feed
* [gmprice:mempolicy2_mbind2 3/13] mm/mempolicy.c:1965:40: warning: variable 'cur_node' set but not used
@ 2024-01-11  2:22 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-01-11  2:22 UTC (permalink / raw)
  To: Gregory Price
  Cc: oe-kbuild-all, Gregory Price, Rakie Kim, Honggyu Kim,
	Hyeongtak Ji, Srinivasulu Thanneeru, Ravi Jonnalagadda

tree:   https://github.com/gmprice/linux mempolicy2_mbind2
head:   5dc13fbba4bf6f4a96d78938d99006aebed9613e
commit: cabe4e50f46d000ff06b4702d62be0c0a51a128c [3/13] mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240111/202401111048.C45IHXRI-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240111/202401111048.C45IHXRI-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/202401111048.C45IHXRI-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/mempolicy.c: In function 'weighted_interleave_nid':
>> mm/mempolicy.c:1965:40: warning: variable 'cur_node' set but not used [-Wunused-but-set-variable]
    1965 |         unsigned int target, nr_nodes, cur_node;
         |                                        ^~~~~~~~
   mm/mempolicy.c: In function 'mpol_parse_str':
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~
   mm/mempolicy.c:3236:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    3236 |                 *--flags = '=';
         |                 ~~~~~~~~~^~~~~
   mm/mempolicy.c:3118:26: note: destination object 'str' of size [0, 9223372036854775807]
    3118 | int mpol_parse_str(char *str, struct mempolicy **mpol)
         |                    ~~~~~~^~~


vim +/cur_node +1965 mm/mempolicy.c

  1961	
  1962	static unsigned int weighted_interleave_nid(struct mempolicy *pol, pgoff_t ilx)
  1963	{
  1964		nodemask_t nodemask;
> 1965		unsigned int target, nr_nodes, cur_node;
  1966		struct iw_table *table;
  1967		unsigned int weight_total = 0;
  1968		u8 weight;
  1969		int nid;
  1970	
  1971		nr_nodes = read_once_policy_nodemask(pol, &nodemask);
  1972		if (!nr_nodes)
  1973			return numa_node_id();
  1974	
  1975		rcu_read_lock();
  1976		table = rcu_dereference(iw_table);
  1977		/* calculate the total weight */
  1978		for_each_node_mask(nid, nodemask)
  1979			weight_total += table->weights[nid];
  1980	
  1981		/* Calculate the node offset based on totals */
  1982		target = ilx % weight_total;
  1983		nid = first_node(nodemask);
  1984		cur_node = 0;
  1985		while (target) {
  1986			weight = table->weights[nid];
  1987			if (target < weight)
  1988				break;
  1989			target -= weight;
  1990			nid = next_node_in(nid, nodemask);
  1991		}
  1992		rcu_read_unlock();
  1993		return nid;
  1994	}
  1995	

-- 
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-01-11  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11  2:22 [gmprice:mempolicy2_mbind2 3/13] mm/mempolicy.c:1965:40: warning: variable 'cur_node' set but not used 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.