From: "Michael S. Tsirkin" <mst@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, somlo@cmu.edu
Subject: Re: [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs
Date: Tue, 26 Feb 2019 11:10:06 -0500 [thread overview]
Message-ID: <20190226110934-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190226073159.13434-1-richardw.yang@linux.intel.com>
On Tue, Feb 26, 2019 at 03:31:59PM +0800, Wei Yang wrote:
> Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code
> to define the attribute.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
> drivers/firmware/qemu_fw_cfg.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index 039e0f91dba8..a1293cbd7adb 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -296,18 +296,13 @@ static int fw_cfg_do_platform_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static ssize_t fw_cfg_showrev(struct kobject *k, struct attribute *a, char *buf)
> +static ssize_t fw_cfg_rev_show(struct kobject *k, struct kobj_attribute *a,
> + char *buf)
> {
> return sprintf(buf, "%u\n", fw_cfg_rev);
> }
> -
> -static const struct {
> - struct attribute attr;
> - ssize_t (*show)(struct kobject *k, struct attribute *a, char *buf);
> -} fw_cfg_rev_attr = {
> - .attr = { .name = "rev", .mode = S_IRUSR },
> - .show = fw_cfg_showrev,
> -};
> +static const struct kobj_attribute fw_cfg_rev_attr =
> + __ATTR_RO_MODE(fw_cfg_rev, 0400);
>
> /* fw_cfg_sysfs_entry type */
> struct fw_cfg_sysfs_entry {
Looks like this will change the name from "rev" to "fw_cfg_rev".
That's a userspace visible change which we should not do lightly.
> --
> 2.19.1
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, somlo@cmu.edu
Subject: Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs
Date: Tue, 26 Feb 2019 11:10:06 -0500 [thread overview]
Message-ID: <20190226110934-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190226073159.13434-1-richardw.yang@linux.intel.com>
On Tue, Feb 26, 2019 at 03:31:59PM +0800, Wei Yang wrote:
> Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code
> to define the attribute.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
> drivers/firmware/qemu_fw_cfg.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index 039e0f91dba8..a1293cbd7adb 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -296,18 +296,13 @@ static int fw_cfg_do_platform_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static ssize_t fw_cfg_showrev(struct kobject *k, struct attribute *a, char *buf)
> +static ssize_t fw_cfg_rev_show(struct kobject *k, struct kobj_attribute *a,
> + char *buf)
> {
> return sprintf(buf, "%u\n", fw_cfg_rev);
> }
> -
> -static const struct {
> - struct attribute attr;
> - ssize_t (*show)(struct kobject *k, struct attribute *a, char *buf);
> -} fw_cfg_rev_attr = {
> - .attr = { .name = "rev", .mode = S_IRUSR },
> - .show = fw_cfg_showrev,
> -};
> +static const struct kobj_attribute fw_cfg_rev_attr =
> + __ATTR_RO_MODE(fw_cfg_rev, 0400);
>
> /* fw_cfg_sysfs_entry type */
> struct fw_cfg_sysfs_entry {
Looks like this will change the name from "rev" to "fw_cfg_rev".
That's a userspace visible change which we should not do lightly.
> --
> 2.19.1
next prev parent reply other threads:[~2019-02-26 16:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 7:31 [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs Wei Yang
2019-02-26 7:31 ` [Qemu-devel] " Wei Yang
2019-02-26 16:10 ` Michael S. Tsirkin [this message]
2019-02-26 16:10 ` Michael S. Tsirkin
2019-02-26 18:47 ` Philippe Mathieu-Daudé
2019-02-26 18:50 ` Michael S. Tsirkin
2019-02-27 5:33 ` Wei Yang
2019-02-27 5:33 ` [Qemu-devel] " Wei Yang
2019-02-27 13:51 ` Michael S. Tsirkin
2019-02-27 13:51 ` [Qemu-devel] " Michael S. Tsirkin
2019-02-27 14:26 ` Wei Yang
2019-02-28 0:49 ` Wei Yang
2019-02-28 0:49 ` [Qemu-devel] " Wei Yang
2019-02-26 18:45 ` Philippe Mathieu-Daudé
2019-02-27 3:07 ` Wei Yang
2019-02-27 13:54 ` Michael S. Tsirkin
2019-02-27 14:29 ` Wei Yang
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=20190226110934-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=richardw.yang@linux.intel.com \
--cc=somlo@cmu.edu \
/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.