From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: [RFC 6/6] gpio: Example of how easy it is to mark attributes const
Date: Thu, 17 Dec 2009 20:12:16 +0200 [thread overview]
Message-ID: <1261073536-27396-7-git-send-email-ext-phil.2.carmody@nokia.com> (raw)
In-Reply-To: <1261073536-27396-6-git-send-email-ext-phil.2.carmody@nokia.com>
These attributes may now be placed in ro sections.
Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
---
drivers/gpio/gpiolib.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 50de0f5..be99438 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -255,7 +255,7 @@ static ssize_t gpio_direction_store(struct device *dev,
return status ? : size;
}
-static const DEVICE_ATTR(direction, 0644,
+static DEVICE_CATTR(direction, 0644,
gpio_direction_show, gpio_direction_store);
static ssize_t gpio_value_show(struct device *dev,
@@ -303,7 +303,7 @@ static ssize_t gpio_value_store(struct device *dev,
return status;
}
-static /*const*/ DEVICE_ATTR(value, 0644,
+static DEVICE_CATTR(value, 0644,
gpio_value_show, gpio_value_store);
static irqreturn_t gpio_sysfs_irq(int irq, void *priv)
@@ -473,7 +473,7 @@ found:
return status;
}
-static DEVICE_ATTR(edge, 0644, gpio_edge_show, gpio_edge_store);
+static DEVICE_CATTR(edge, 0644, gpio_edge_show, gpio_edge_store);
static const struct attribute *gpio_attrs[] = {
&dev_attr_direction.attr,
@@ -499,7 +499,7 @@ static ssize_t chip_base_show(struct device *dev,
return sprintf(buf, "%d\n", chip->base);
}
-static DEVICE_ATTR(base, 0444, chip_base_show, NULL);
+static DEVICE_CATTR(base, 0444, chip_base_show, NULL);
static ssize_t chip_label_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -508,7 +508,7 @@ static ssize_t chip_label_show(struct device *dev,
return sprintf(buf, "%s\n", chip->label ? : "");
}
-static DEVICE_ATTR(label, 0444, chip_label_show, NULL);
+static DEVICE_CATTR(label, 0444, chip_label_show, NULL);
static ssize_t chip_ngpio_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -517,7 +517,7 @@ static ssize_t chip_ngpio_show(struct device *dev,
return sprintf(buf, "%u\n", chip->ngpio);
}
-static DEVICE_ATTR(ngpio, 0444, chip_ngpio_show, NULL);
+static DEVICE_CATTR(ngpio, 0444, chip_ngpio_show, NULL);
static const struct attribute *gpiochip_attrs[] = {
&dev_attr_base.attr,
--
1.6.0.4
next prev parent reply other threads:[~2009-12-17 18:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 18:12 [RFC 0/6] Driver core: Encourage use of const attributes Phil Carmody
2009-12-17 18:12 ` [RFC 1/6] Driver core: device_attribute parameters can often be const* Phil Carmody
2009-12-17 18:12 ` [RFC 2/6] Driver core: bin_attribute " Phil Carmody
2009-12-17 18:12 ` [RFC 3/6] Driver core: driver_attribute " Phil Carmody
2009-12-17 18:12 ` [RFC 4/6] Driver core: Easy macros to encourage const attributes Phil Carmody
2009-12-17 18:12 ` [RFC 5/6] PM: Example of how easy it is to mark attributes const Phil Carmody
2009-12-17 18:12 ` Phil Carmody [this message]
2009-12-17 23:16 ` [RFC 0/6] Driver core: Encourage use of const attributes Greg KH
2009-12-18 0:42 ` Stephen Rothwell
2009-12-18 4:20 ` Greg KH
2009-12-18 13:34 ` [PATCH 0/3] " Phil Carmody
2009-12-18 13:34 ` [PATCH 1/3] Driver core: device_attribute parameters can often be const* Phil Carmody
2009-12-18 13:34 ` [PATCH 2/3] Driver core: bin_attribute " Phil Carmody
2009-12-18 13:34 ` [PATCH 3/3] Driver core: driver_attribute " Phil Carmody
2009-12-18 8:52 ` [RFC 0/6] Driver core: Encourage use of const attributes Phil Carmody
2009-12-18 16:10 ` Greg KH
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=1261073536-27396-7-git-send-email-ext-phil.2.carmody@nokia.com \
--to=ext-phil.2.carmody@nokia.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
all inboxes | Powered by JetHome®