From: Greg KH <gregkh@linuxfoundation.org>
To: Hongbo Yao <yaohongbo@huawei.com>
Cc: christian.brauner@ubuntu.com, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, chenzhou10@huawei.com,
rjw@rjwysocki.net, pavel@ucw.cz
Subject: Re: [PATCH -next] drivers/base/power: fix build error without SYSFS
Date: Mon, 2 Mar 2020 10:23:08 +0100 [thread overview]
Message-ID: <20200302092308.GA1997164@kroah.com> (raw)
In-Reply-To: <20200302092918.40163-1-yaohongbo@huawei.com>
On Mon, Mar 02, 2020 at 05:29:18PM +0800, Hongbo Yao wrote:
> If CONFIG_SYSFS=n, the following error is seen while building
> drivers/base/power/sysfs.c:
>
> drivers/base/power/sysfs.c: In function dpm_sysfs_change_owner:
> drivers/base/power/sysfs.c:708:44: error: passing argument 2 of
> sysfs_group_change_owner from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> rc = sysfs_group_change_owner(&dev->kobj, &pm_attr_group, kuid, kgid);
> ^
> In file included from ./include/linux/kobject.h:20:0,
> from ./include/linux/device.h:17,
> from drivers/base/power/sysfs.c:3:
> ./include/linux/sysfs.h:564:19: note: expected const struct
> attribute_group ** but argument is of type const struct attribute_group *
>
> dpm_sysfs_change_owner() should only used when CONFIG_SYSFS is
> defined.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 3b52fc5d7876 ("drivers/base/power: add dpm_sysfs_change_owner()")
> Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
> ---
> drivers/base/power/power.h | 10 +++++++++-
> drivers/base/power/sysfs.c | 2 ++
You shouldn't have to add #ifdefs to a .c file here, it should all be
able to be fixed in the .h file by putting proper "empty" functions.
thanks,
greg k-h
next prev parent reply other threads:[~2020-03-02 9:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 9:29 [PATCH -next] drivers/base/power: fix build error without SYSFS Hongbo Yao
2020-03-02 9:23 ` Greg KH [this message]
2020-03-03 2:26 ` Hongbo Yao
2020-03-02 9:31 ` Christian Brauner
2020-03-03 3:17 ` Hongbo Yao
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=20200302092308.GA1997164@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=chenzhou10@huawei.com \
--cc=christian.brauner@ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=yaohongbo@huawei.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;
as well as URLs for NNTP newsgroup(s).