All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: drivers/mtd/mtd_virt_concat.c:170:16: sparse: sparse: Initializer entry defined twice
Date: Thu, 03 Dec 2026 20:40:16 +0100	[thread overview]
Message-ID: <20261203202937.iOSgJnmB-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "sparse: Initializer entry defined twice"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
CC: Miquel Raynal <miquel.raynal@bootlin.com>
CC: Luca Ceresoli <luca.ceresoli@bootlin.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   007722b8211f7b34fdf21b1e6a9c32497633ea29
commit: 43db6366fc2de02050e66389f5628d3fdc9af10a mtd: Add driver for concatenating devices
date:   9 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 9 months ago
config: alpha-randconfig-r2305-20261203 (https://download.01.org/0day-ci/archive/20261203/20261203202937.iOSgJnmB-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.5.0
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261203/20261203202937.iOSgJnmB-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
| Fixes: 43db6366fc2d ("mtd: Add driver for concatenating devices")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261203202937.iOSgJnmB-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/mtd_virt_concat.c:170:16: sparse: sparse: Initializer entry defined twice
   drivers/mtd/mtd_virt_concat.c:170:16: sparse:   also defined here
   drivers/mtd/mtd_virt_concat.c:175:23: sparse: sparse: Initializer entry defined twice
   drivers/mtd/mtd_virt_concat.c:175:23: sparse:   also defined here
   drivers/mtd/mtd_virt_concat.c:191:18: sparse: sparse: Initializer entry defined twice
   drivers/mtd/mtd_virt_concat.c:191:18: sparse:   also defined here
   drivers/mtd/mtd_virt_concat.c:197:26: sparse: sparse: Initializer entry defined twice
   drivers/mtd/mtd_virt_concat.c:197:26: sparse:   also defined here
   drivers/mtd/mtd_virt_concat.c:322:32: sparse: sparse: Initializer entry defined twice
   drivers/mtd/mtd_virt_concat.c:322:32: sparse:   also defined here

vim +170 drivers/mtd/mtd_virt_concat.c

43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  149  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  150  /**
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  151   * mtd_virt_concat_create_item - Create a concat item
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  152   * @parts:        pointer to 'device_node'
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  153   * @count:        number of mtd devices that make up
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  154   *                the concatenated device.
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  155   *
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  156   * Return: 0 on success, -error otherwise.
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  157   */
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  158  static int mtd_virt_concat_create_item(struct device_node *parts,
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  159  				       unsigned int count)
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  160  {
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  161  	struct mtd_virt_concat_node *item;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  162  	struct mtd_concat *concat;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  163  	int i;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  164  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  165  	for (i = 0; i < (count - 1); i++) {
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  166  		if (mtd_is_part_concat(of_parse_phandle(parts, CONCAT_PROP, i)))
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  167  			return 0;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  168  	}
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  169  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04 @170  	item = kzalloc(sizeof(*item), GFP_KERNEL);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  171  	if (!item)
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  172  		return -ENOMEM;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  173  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  174  	item->count = count;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  175  	item->nodes = kcalloc(count, sizeof(*item->nodes), GFP_KERNEL);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  176  	if (!item->nodes) {
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  177  		kfree(item);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  178  		return -ENOMEM;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  179  	}
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  180  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  181  	/*
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  182  	 * The partition in which "part-concat-next" property
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  183  	 * is defined is the first device in the list of concat
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  184  	 * devices.
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  185  	 */
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  186  	item->nodes[0] = parts;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  187  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  188  	for (i = 1; i < count; i++)
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  189  		item->nodes[i] = of_parse_phandle(parts, CONCAT_PROP, (i - 1));
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  190  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  191  	concat = kzalloc(sizeof(*concat), GFP_KERNEL);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  192  	if (!concat) {
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  193  		kfree(item);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  194  		return -ENOMEM;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  195  	}
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  196  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  197  	concat->subdev = kcalloc(count, sizeof(*concat->subdev), GFP_KERNEL);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  198  	if (!concat->subdev) {
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  199  		kfree(item);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  200  		kfree(concat);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  201  		return -ENOMEM;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  202  	}
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  203  	item->concat = concat;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  204  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  205  	list_add_tail(&item->head, &concat_node_list);
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  206  
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  207  	return 0;
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  208  }
43db6366fc2de0 Amit Kumar Mahapatra 2026-02-04  209  

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

                 reply	other threads:[~2026-12-03 19:40 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=20261203202937.iOSgJnmB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.