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, Dan Carpenter <error27@gmail.com>
Subject: drivers/of/device.c:40 of_dma_set_restricted_buffer() warn: iterator 'i' not incremented
Date: Sat, 13 Dec 2025 06:41:53 +0800	[thread overview]
Message-ID: <202512130644.4FfBmwDO-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Rob Herring (Arm)" <robh@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   187d0801404f415f22c0b31531982c7ea97fa341
commit: df56b2443e14e8288baf76aa5ee39a26289874e8 of: Simplify of_dma_set_restricted_buffer() to use of_for_each_phandle()
date:   7 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 7 months ago
config: sparc-randconfig-r071-20251212 (https://download.01.org/0day-ci/archive/20251213/202512130644.4FfBmwDO-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 15.1.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202512130644.4FfBmwDO-lkp@intel.com/

New smatch warnings:
drivers/of/device.c:40 of_dma_set_restricted_buffer() warn: iterator 'i' not incremented

Old smatch warnings:
drivers/of/device.c:300 of_device_make_bus_id() warn: excess argument passed to 'dev_set_name'
drivers/of/device.c:304 of_device_make_bus_id() warn: excess argument passed to 'dev_set_name'
drivers/of/device.c:310 of_device_make_bus_id() warn: excess argument passed to 'dev_set_name'

vim +/i +40 drivers/of/device.c

f85ff3056cefdf4 Stephen Rothwell  2007-05-01  34  
f3cfd136aef0184 Will Deacon       2021-08-16  35  static void
ce5cb67c664fbc9 Will Deacon       2021-08-16  36  of_dma_set_restricted_buffer(struct device *dev, struct device_node *np)
ce5cb67c664fbc9 Will Deacon       2021-08-16  37  {
df56b2443e14e82 Rob Herring (Arm  2025-04-23  38) 	struct device_node *of_node = dev->of_node;
df56b2443e14e82 Rob Herring (Arm  2025-04-23  39) 	struct of_phandle_iterator it;
df56b2443e14e82 Rob Herring (Arm  2025-04-23 @40) 	int rc, i = 0;
ce5cb67c664fbc9 Will Deacon       2021-08-16  41  
f3cfd136aef0184 Will Deacon       2021-08-16  42  	if (!IS_ENABLED(CONFIG_DMA_RESTRICTED_POOL))
f3cfd136aef0184 Will Deacon       2021-08-16  43  		return;
f3cfd136aef0184 Will Deacon       2021-08-16  44  
ce5cb67c664fbc9 Will Deacon       2021-08-16  45  	/*
ce5cb67c664fbc9 Will Deacon       2021-08-16  46  	 * If dev->of_node doesn't exist or doesn't contain memory-region, try
ce5cb67c664fbc9 Will Deacon       2021-08-16  47  	 * the OF node having DMA configuration.
ce5cb67c664fbc9 Will Deacon       2021-08-16  48  	 */
df56b2443e14e82 Rob Herring (Arm  2025-04-23  49) 	if (!of_property_present(of_node, "memory-region"))
ce5cb67c664fbc9 Will Deacon       2021-08-16  50  		of_node = np;
ce5cb67c664fbc9 Will Deacon       2021-08-16  51  
df56b2443e14e82 Rob Herring (Arm  2025-04-23  52) 	of_for_each_phandle(&it, rc, of_node, "memory-region", NULL, 0) {
ce5cb67c664fbc9 Will Deacon       2021-08-16  53  		/*
ce5cb67c664fbc9 Will Deacon       2021-08-16  54  		 * There might be multiple memory regions, but only one
ce5cb67c664fbc9 Will Deacon       2021-08-16  55  		 * restricted-dma-pool region is allowed.
ce5cb67c664fbc9 Will Deacon       2021-08-16  56  		 */
df56b2443e14e82 Rob Herring (Arm  2025-04-23  57) 		if (of_device_is_compatible(it.node, "restricted-dma-pool") &&
df56b2443e14e82 Rob Herring (Arm  2025-04-23  58) 		    of_device_is_available(it.node)) {
df56b2443e14e82 Rob Herring (Arm  2025-04-23  59) 			if (of_reserved_mem_device_init_by_idx(dev, of_node, i))
df56b2443e14e82 Rob Herring (Arm  2025-04-23  60) 				dev_warn(dev, "failed to initialise \"restricted-dma-pool\" memory node\n");
df56b2443e14e82 Rob Herring (Arm  2025-04-23  61) 			of_node_put(it.node);
f3cfd136aef0184 Will Deacon       2021-08-16  62  			break;
ce5cb67c664fbc9 Will Deacon       2021-08-16  63  		}
df56b2443e14e82 Rob Herring (Arm  2025-04-23  64) 		i++;
d17e37c41b7ed38 Liang He          2022-07-02  65  	}
ce5cb67c664fbc9 Will Deacon       2021-08-16  66  

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

             reply	other threads:[~2025-12-12 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12 22:41 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-12-12 14:53 drivers/of/device.c:40 of_dma_set_restricted_buffer() warn: iterator 'i' not incremented kernel test robot

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=202512130644.4FfBmwDO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.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.