public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vimal Kumar <vimal.kumar32@gmail.com>, gregkh@linuxfoundation.org
Cc: kbuild-all@lists.01.org, chinmoyghosh2001@gmail.com,
	Vimal Kumar <vimal.kumar32@gmail.com>,
	Mintu Patel <mintupatel89@gmail.com>,
	Vishal Badole <badolevishal1116@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] PM: runtime: Add support to disable wakeup sources
Date: Mon, 22 Aug 2022 04:06:55 +0800	[thread overview]
Message-ID: <202208220446.3Qzss7sC-lkp@intel.com> (raw)
In-Reply-To: <20220821134533.22901-1-vimal.kumar32@gmail.com>

Hi Vimal,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on linus/master v6.0-rc1 next-20220819]
[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/Vimal-Kumar/PM-runtime-Add-support-to-disable-wakeup-sources/20220821-214614
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-s003 (https://download.01.org/0day-ci/archive/20220822/202208220446.3Qzss7sC-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/dee2f4d4c4b79cbfc7b2c792294b5137872d7c0c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Vimal-Kumar/PM-runtime-Add-support-to-disable-wakeup-sources/20220821-214614
        git checkout dee2f4d4c4b79cbfc7b2c792294b5137872d7c0c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/base/power/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
>> drivers/base/power/wakeup_stats.c:225:37: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/base/power/wakeup_stats.c:225:37: sparse:     expected void const [noderef] __user *from
   drivers/base/power/wakeup_stats.c:225:37: sparse:     got char const *buf

vim +225 drivers/base/power/wakeup_stats.c

   211	
   212	static ssize_t disable_ws_store(struct class *class,
   213					struct class_attribute *attr,
   214					const char *buf, size_t len)
   215	{
   216		struct device		*dev;
   217		struct wakeup_source	*ws;
   218		char                    *ws_name;
   219		int                     status;
   220	
   221		ws_name = kzalloc(sizeof(*(buf)), GFP_KERNEL);
   222		if (!ws_name)
   223			return -ENOMEM;
   224	
 > 225		if (copy_from_user(ws_name, buf, sizeof(*(buf))))
   226			return -EFAULT;
   227	
   228		dev = class_find_device_by_name(wakeup_class, ws_name);
   229		if (!dev)
   230			pr_err("%s : %s dev not found\n", __func__, ws_name);
   231	
   232		ws = dev_get_drvdata(dev);
   233		if (ws->dev->parent != NULL) {
   234	
   235			status = device_wakeup_disable(ws->dev->parent);
   236			if (status < 0) {
   237				/* In case of virtual device, return code will be -EINVAL
   238				 * then unregister the wakeup source associated with it
   239				 */
   240				wakeup_source_unregister(ws);
   241			}
   242		} else
   243			/* If the parent device is NULL, just unregister the wakeup source */
   244			wakeup_source_unregister(ws);
   245	
   246		return len;
   247	}
   248	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  parent reply	other threads:[~2022-08-21 20:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21 13:45 [PATCH v1] PM: runtime: Add support to disable wakeup sources Vimal Kumar
2022-08-21 14:01 ` Greg KH
2022-08-21 14:03 ` Greg KH
2022-08-27 11:40   ` Vimal Kumar
2022-09-01 15:56     ` Greg KH
2022-08-21 20:06 ` kernel test robot [this message]
2022-08-21 20:17 ` 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=202208220446.3Qzss7sC-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=badolevishal1116@gmail.com \
    --cc=chinmoyghosh2001@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mintupatel89@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=vimal.kumar32@gmail.com \
    /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