From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 15/15] aoe: fix sysfs_create_file warnings
Date: Wed, 18 Oct 2006 13:09:06 -0700 [thread overview]
Message-ID: <11612021961246-git-send-email-greg@kroah.com> (raw)
In-Reply-To: <11612021913873-git-send-email-greg@kroah.com>
From: Greg Kroah-Hartman <gregkh@suse.de>
Moved the attributes into a group, making the compiler be quiet about
ignoring the return value of the file create calls. This also also
fixed a bug when removing the files, which were not symlinks.
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Cc: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/block/aoe/aoeblk.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 4259b52..d433f27 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -63,21 +63,26 @@ static struct disk_attribute disk_attr_f
.show = aoedisk_show_fwver
};
-static void
+static struct attribute *aoe_attrs[] = {
+ &disk_attr_state.attr,
+ &disk_attr_mac.attr,
+ &disk_attr_netif.attr,
+ &disk_attr_fwver.attr,
+};
+
+static const struct attribute_group attr_group = {
+ .attrs = aoe_attrs,
+};
+
+static int
aoedisk_add_sysfs(struct aoedev *d)
{
- sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);
- sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr);
- sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr);
- sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr);
+ return sysfs_create_group(&d->gd->kobj, &attr_group);
}
void
aoedisk_rm_sysfs(struct aoedev *d)
{
- sysfs_remove_link(&d->gd->kobj, "state");
- sysfs_remove_link(&d->gd->kobj, "mac");
- sysfs_remove_link(&d->gd->kobj, "netif");
- sysfs_remove_link(&d->gd->kobj, "firmware-version");
+ sysfs_remove_group(&d->gd->kobj, &attr_group);
}
static int
--
1.4.2.4
prev parent reply other threads:[~2006-10-18 20:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-18 20:04 [GIT PATCH] AOE fixes and update for 2.6.19-rc2 Greg KH
2006-10-18 20:08 ` [PATCH 1/15] aoe: eliminate isbusy message Greg KH
2006-10-18 20:08 ` [PATCH 2/15] aoe: update copyright date Greg KH
2006-10-18 20:08 ` [PATCH 3/15] aoe: remove unused NARGS enum Greg KH
2006-10-18 20:08 ` [PATCH 4/15] aoe: zero copy write 1 of 2 Greg KH
2006-10-18 20:08 ` [PATCH 5/15] aoe: jumbo frame support " Greg KH
2006-10-18 20:08 ` [PATCH 6/15] aoe: clean up printks via macros Greg KH
2006-10-18 20:08 ` [PATCH 7/15] aoe: jumbo frame support 2 of 2 Greg KH
2006-10-18 20:08 ` [PATCH 8/15] aoe: improve retransmission heuristics Greg KH
2006-10-18 20:09 ` [PATCH 9/15] aoe: zero copy write 2 of 2 Greg KH
2006-10-18 20:09 ` [PATCH 10/15] aoe: module parameter for device timeout Greg KH
2006-10-18 20:09 ` [PATCH 11/15] aoe: use bio->bi_idx Greg KH
2006-10-18 20:09 ` [PATCH 12/15] aoe: remove sysfs comment Greg KH
2006-10-18 20:09 ` [PATCH 13/15] aoe: update driver version Greg KH
2006-10-18 20:09 ` [PATCH 14/15] aoe: revert printk macros Greg KH
2006-10-18 20:09 ` Greg KH [this message]
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=11612021961246-git-send-email-greg@kroah.com \
--to=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox