All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gromm <christian.gromm@microchip.com>
To: gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org,
	Andrey Shvetsov <andrey.shvetsov@k2l.de>,
	Christian Gromm <christian.gromm@microchip.com>
Subject: [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute
Date: Fri, 31 Mar 2017 15:22:27 +0200	[thread overview]
Message-ID: <20170331132234.21722-6-christian.gromm@microchip.com> (raw)
In-Reply-To: <20170331132234.21722-1-christian.gromm@microchip.com>

From: Andrey Shvetsov <andrey.shvetsov@k2l.de>

This patch replaces the use of a macro MOST_CHNL_ATTR in the macro
create_show_channel_attribute with a macro __ATTR_RO.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/mostcore/core.c | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 826984c2424d..9cbd893989b3 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -252,7 +252,7 @@ static void most_channel_release(struct kobject *kobj)
 	kfree(c);
 }
 
-static ssize_t show_available_directions(struct most_c_obj *c,
+static ssize_t available_directions_show(struct most_c_obj *c,
 					 struct most_c_attr *attr,
 					 char *buf)
 {
@@ -267,7 +267,7 @@ static ssize_t show_available_directions(struct most_c_obj *c,
 	return strlen(buf);
 }
 
-static ssize_t show_available_datatypes(struct most_c_obj *c,
+static ssize_t available_datatypes_show(struct most_c_obj *c,
 					struct most_c_attr *attr,
 					char *buf)
 {
@@ -286,10 +286,9 @@ static ssize_t show_available_datatypes(struct most_c_obj *c,
 	return strlen(buf);
 }
 
-static
-ssize_t show_number_of_packet_buffers(struct most_c_obj *c,
-				      struct most_c_attr *attr,
-				      char *buf)
+static ssize_t number_of_packet_buffers_show(struct most_c_obj *c,
+					     struct most_c_attr *attr,
+					     char *buf)
 {
 	unsigned int i = c->channel_id;
 
@@ -297,10 +296,9 @@ ssize_t show_number_of_packet_buffers(struct most_c_obj *c,
 			c->iface->channel_vector[i].num_buffers_packet);
 }
 
-static
-ssize_t show_number_of_stream_buffers(struct most_c_obj *c,
-				      struct most_c_attr *attr,
-				      char *buf)
+static ssize_t number_of_stream_buffers_show(struct most_c_obj *c,
+					     struct most_c_attr *attr,
+					     char *buf)
 {
 	unsigned int i = c->channel_id;
 
@@ -308,10 +306,9 @@ ssize_t show_number_of_stream_buffers(struct most_c_obj *c,
 			c->iface->channel_vector[i].num_buffers_streaming);
 }
 
-static
-ssize_t show_size_of_packet_buffer(struct most_c_obj *c,
-				   struct most_c_attr *attr,
-				   char *buf)
+static ssize_t size_of_packet_buffer_show(struct most_c_obj *c,
+					  struct most_c_attr *attr,
+					  char *buf)
 {
 	unsigned int i = c->channel_id;
 
@@ -319,10 +316,9 @@ ssize_t show_size_of_packet_buffer(struct most_c_obj *c,
 			c->iface->channel_vector[i].buffer_size_packet);
 }
 
-static
-ssize_t show_size_of_stream_buffer(struct most_c_obj *c,
-				   struct most_c_attr *attr,
-				   char *buf)
+static ssize_t size_of_stream_buffer_show(struct most_c_obj *c,
+					  struct most_c_attr *attr,
+					  char *buf)
 {
 	unsigned int i = c->channel_id;
 
@@ -330,7 +326,7 @@ ssize_t show_size_of_stream_buffer(struct most_c_obj *c,
 			c->iface->channel_vector[i].buffer_size_streaming);
 }
 
-static ssize_t show_channel_starving(struct most_c_obj *c,
+static ssize_t channel_starving_show(struct most_c_obj *c,
 				     struct most_c_attr *attr,
 				     char *buf)
 {
@@ -338,7 +334,7 @@ static ssize_t show_channel_starving(struct most_c_obj *c,
 }
 
 #define create_show_channel_attribute(val) \
-	static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
+	static struct most_c_attr most_chnl_attr_##val = __ATTR_RO(val)
 
 create_show_channel_attribute(available_directions);
 create_show_channel_attribute(available_datatypes);
-- 
2.11.0

  parent reply	other threads:[~2017-03-31 13:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
2017-03-31 13:22 ` [PATCH 02/13] staging: most: fix comment of the function remove_link_store Christian Gromm
2017-03-31 13:22 ` [PATCH 03/13] staging: most: use __ATTR_RO for the attribute interface Christian Gromm
2017-03-31 13:22 ` [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value Christian Gromm
2017-03-31 13:22 ` [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute Christian Gromm
2017-04-01 21:18   ` kbuild test robot
2017-04-08 10:39   ` Greg KH
2017-03-31 13:22 ` Christian Gromm [this message]
2017-03-31 13:22 ` [PATCH 07/13] staging: most: consolidate channel attributes Christian Gromm
2017-03-31 13:22 ` [PATCH 08/13] staging: most: separate property showing links Christian Gromm
2017-03-31 13:22 ` [PATCH 09/13] staging: most: consolidate attributes for list of links Christian Gromm
2017-03-31 13:22 ` [PATCH 10/13] staging: most: destroy cdev by channel disconnect Christian Gromm
2017-03-31 13:22 ` [PATCH 11/13] staging: most: usb: fix calculation of the extra_len Christian Gromm
2017-03-31 13:22 ` [PATCH 12/13] staging: most: usb: fix size overflow Christian Gromm
2017-03-31 13:22 ` [PATCH 13/13] staging: most: usb: Fix setting of writable DCI registers Christian Gromm

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=20170331132234.21722-6-christian.gromm@microchip.com \
    --to=christian.gromm@microchip.com \
    --cc=andrey.shvetsov@k2l.de \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.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 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.