All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: davidgow <davidgow@google.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [linux-next:master 8437/9113] lib/kunit/device.c:68: warning: Function parameter or struct member 'test' not described in 'kunit_driver_create'
Date: Mon, 18 Dec 2023 19:47:45 +0800	[thread overview]
Message-ID: <202312181920.H4EPAH20-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ceb2fe0d438644e1de06b9a6468a1fb8e2199c70
commit: dcb420cba3162bce885a2127865888850a6d6b99 [8437/9113] kunit: Add APIs for managing devices
config: x86_64-buildonly-randconfig-003-20231218 (https://download.01.org/0day-ci/archive/20231218/202312181920.H4EPAH20-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231218/202312181920.H4EPAH20-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/202312181920.H4EPAH20-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/kunit/device.c:68: warning: Function parameter or struct member 'test' not described in 'kunit_driver_create'
>> lib/kunit/device.c:68: warning: Function parameter or struct member 'name' not described in 'kunit_driver_create'
   lib/kunit/device.c:68: warning: expecting prototype for Create and register a KUnit(). Prototype was for kunit_driver_create() instead
>> lib/kunit/device.c:134: warning: Function parameter or struct member 'test' not described in 'kunit_device_register_with_driver'
>> lib/kunit/device.c:134: warning: Function parameter or struct member 'name' not described in 'kunit_device_register_with_driver'
>> lib/kunit/device.c:134: warning: Function parameter or struct member 'drv' not described in 'kunit_device_register_with_driver'
   lib/kunit/device.c:134: warning: expecting prototype for Create and register a new KUnit-managed device, using the user(). Prototype was for kunit_device_register_with_driver() instead
>> lib/kunit/device.c:149: warning: Function parameter or struct member 'test' not described in 'kunit_device_register'
>> lib/kunit/device.c:149: warning: Function parameter or struct member 'name' not described in 'kunit_device_register'
   lib/kunit/device.c:149: warning: expecting prototype for Create and register a new KUnit(). Prototype was for kunit_device_register() instead


vim +68 lib/kunit/device.c

    62	
    63	/**
    64	 * Create and register a KUnit-managed struct device_driver on the kunit_bus.
    65	 * Returns an error pointer on failure.
    66	 */
    67	struct device_driver *kunit_driver_create(struct kunit *test, const char *name)
  > 68	{
    69		struct device_driver *driver;
    70		int err = -ENOMEM;
    71	
    72		driver = kunit_kzalloc(test, sizeof(*driver), GFP_KERNEL);
    73	
    74		if (!driver)
    75			return ERR_PTR(err);
    76	
    77		driver->name = name;
    78		driver->bus = &kunit_bus_type;
    79		driver->owner = THIS_MODULE;
    80	
    81		err = driver_register(driver);
    82		if (err) {
    83			kunit_kfree(test, driver);
    84			return ERR_PTR(err);
    85		}
    86	
    87		kunit_add_action(test, driver_unregister_wrapper, driver);
    88		return driver;
    89	}
    90	EXPORT_SYMBOL_GPL(kunit_driver_create);
    91	
    92	/* Helper which creates a kunit_device, attaches it to the kunit_bus*/
    93	static struct kunit_device *kunit_device_register_internal(struct kunit *test,
    94								   const char *name,
    95								   const struct device_driver *drv)
    96	{
    97		struct kunit_device *kunit_dev;
    98		int err = -ENOMEM;
    99	
   100		kunit_dev = kzalloc(sizeof(*kunit_dev), GFP_KERNEL);
   101		if (!kunit_dev)
   102			return ERR_PTR(err);
   103	
   104		kunit_dev->owner = test;
   105	
   106		err = dev_set_name(&kunit_dev->dev, "%s.%s", test->name, name);
   107		if (err) {
   108			kfree(kunit_dev);
   109			return ERR_PTR(err);
   110		}
   111	
   112		kunit_dev->dev.release = kunit_device_release;
   113		kunit_dev->dev.bus = &kunit_bus_type;
   114		kunit_dev->dev.parent = kunit_bus_device;
   115	
   116		err = device_register(&kunit_dev->dev);
   117		if (err) {
   118			put_device(&kunit_dev->dev);
   119			return ERR_PTR(err);
   120		}
   121	
   122		kunit_add_action(test, device_unregister_wrapper, &kunit_dev->dev);
   123	
   124		return kunit_dev;
   125	}
   126	
   127	/**
   128	 * Create and register a new KUnit-managed device, using the user-supplied device_driver.
   129	 * On failure, returns an error pointer.
   130	 */
   131	struct device *kunit_device_register_with_driver(struct kunit *test,
   132							 const char *name,
   133							 const struct device_driver *drv)
 > 134	{
   135		struct kunit_device *kunit_dev = kunit_device_register_internal(test, name, drv);
   136	
   137		if (IS_ERR_OR_NULL(kunit_dev))
   138			return ERR_CAST(kunit_dev);
   139	
   140		return &kunit_dev->dev;
   141	}
   142	EXPORT_SYMBOL_GPL(kunit_device_register_with_driver);
   143	
   144	/**
   145	 * Create and register a new KUnit-managed device, including a matching device_driver.
   146	 * On failure, returns an error pointer.
   147	 */
   148	struct device *kunit_device_register(struct kunit *test, const char *name)
 > 149	{
   150		struct device_driver *drv;
   151		struct kunit_device *dev;
   152	
   153		drv = kunit_driver_create(test, name);
   154		if (IS_ERR(drv))
   155			return ERR_CAST(drv);
   156	
   157		dev = kunit_device_register_internal(test, name, drv);
   158		if (IS_ERR(dev)) {
   159			kunit_release_action(test, driver_unregister_wrapper, (void *)drv);
   160			return ERR_CAST(dev);
   161		}
   162	
   163		/* Request the driver be freed. */
   164		dev->driver = drv;
   165	
   166	
   167		return &dev->dev;
   168	}
   169	EXPORT_SYMBOL_GPL(kunit_device_register);
   170	

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

             reply	other threads:[~2023-12-18 11:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 11:47 kernel test robot [this message]
2023-12-21 17:06 ` [linux-next:master 8437/9113] lib/kunit/device.c:68: warning: Function parameter or struct member 'test' not described in 'kunit_driver_create' Shuah Khan

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=202312181920.H4EPAH20-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davidgow@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-mm@kvack.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mripard@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=skhan@linuxfoundation.org \
    /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.