linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH] resource: add WARN_ON_ONCE for resource_size() and document misusage
Date: Tue, 9 Dec 2025 17:54:32 +0800	[thread overview]
Message-ID: <202512091733.6IVBDnru-lkp@intel.com> (raw)
In-Reply-To: <20251208202921.16819-1-ansuelsmth@gmail.com>

Hi Christian,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.18 next-20251209]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/resource-add-WARN_ON_ONCE-for-resource_size-and-document-misusage/20251209-043037
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251208202921.16819-1-ansuelsmth%40gmail.com
patch subject: [PATCH] resource: add WARN_ON_ONCE for resource_size() and document misusage
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20251209/202512091733.6IVBDnru-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251209/202512091733.6IVBDnru-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/202512091733.6IVBDnru-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/resource.c:15:
   include/linux/ioport.h: In function 'resource_size':
>> include/linux/ioport.h:302:9: error: implicit declaration of function 'WARN_ON_ONCE' [-Wimplicit-function-declaration]
     302 |         WARN_ON_ONCE(!res->flags);
         |         ^~~~~~~~~~~~


vim +/WARN_ON_ONCE +302 include/linux/ioport.h

   288	
   289	/**
   290	 * resource_size - Get the size of the resource
   291	 * @res: Resource descriptor
   292	 *
   293	 * This MUST be used ONLY with correctly inizialized resource descriptor.
   294	 * Passing a resource descriptor with zeroed flags will produce a WARN
   295	 * signaling a misusage of this helper and probably a BUG in the user
   296	 * of this helper.
   297	 *
   298	 * Return: Size of the resource calculated from resource end - start + 1.
   299	 */
   300	static inline resource_size_t resource_size(const struct resource *res)
   301	{
 > 302		WARN_ON_ONCE(!res->flags);
   303		return res->end - res->start + 1;
   304	}
   305	static inline unsigned long resource_type(const struct resource *res)
   306	{
   307		return res->flags & IORESOURCE_TYPE_BITS;
   308	}
   309	static inline unsigned long resource_ext_type(const struct resource *res)
   310	{
   311		return res->flags & IORESOURCE_EXT_TYPE_BITS;
   312	}
   313	/* True iff r1 completely contains r2 */
   314	static inline bool resource_contains(const struct resource *r1, const struct resource *r2)
   315	{
   316		if (resource_type(r1) != resource_type(r2))
   317			return false;
   318		if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET)
   319			return false;
   320		return r1->start <= r2->start && r1->end >= r2->end;
   321	}
   322	

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


           reply	other threads:[~2025-12-09  9:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20251208202921.16819-1-ansuelsmth@gmail.com>]

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=202512091733.6IVBDnru-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ansuelsmth@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).