All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] staging: most: fix comment of the function add_link_store
@ 2017-03-31 13:22 Christian Gromm
  2017-03-31 13:22 ` [PATCH 02/13] staging: most: fix comment of the function remove_link_store Christian Gromm
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces the name store_add_link by the add_link_store in the
comment for the corresponding function.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 191404bc5906..a4beb32a8bbf 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -943,7 +943,7 @@ most_c_obj *get_channel_by_name(char *mdev, char *mdev_ch)
 }
 
 /**
- * store_add_link - store() function for add_link attribute
+ * add_link_store - store() function for add_link attribute
  * @aim_obj: pointer to AIM object
  * @attr: its attributes
  * @buf: buffer
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/13] staging: most: fix comment of the function remove_link_store
  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 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 03/13] staging: most: use __ATTR_RO for the attribute interface Christian Gromm
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces the name store_remove_link by the remove_link_store
in the comment for the corresponding function.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index a4beb32a8bbf..fb5e8f2ecb74 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -1017,7 +1017,7 @@ static struct most_aim_attribute most_aim_attr_add_link =
 	__ATTR_RW(add_link);
 
 /**
- * store_remove_link - store function for remove_link attribute
+ * remove_link_store - store function for remove_link attribute
  * @aim_obj: pointer to AIM object
  * @attr: its attributes
  * @buf: buffer
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/13] staging: most: use __ATTR_RO for the attribute interface
  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 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value Christian Gromm
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces the use of a macro create_inst_attribute for the
attribute interface 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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index fb5e8f2ecb74..a9fd896c9a9e 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -660,7 +660,7 @@ static ssize_t show_description(struct most_inst_obj *instance_obj,
 			instance_obj->iface->description);
 }
 
-static ssize_t show_interface(struct most_inst_obj *instance_obj,
+static ssize_t interface_show(struct most_inst_obj *instance_obj,
 			      struct most_inst_attribute *attr,
 			      char *buf)
 {
@@ -691,7 +691,9 @@ static ssize_t show_interface(struct most_inst_obj *instance_obj,
 	static MOST_INST_ATTR(value, 0444, show_##value, NULL)
 
 create_inst_attribute(description);
-create_inst_attribute(interface);
+
+static struct most_inst_attribute most_inst_attr_interface =
+	__ATTR_RO(interface);
 
 static struct attribute *most_inst_def_attrs[] = {
 	&most_inst_attr_description.attr,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value
  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 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute Christian Gromm
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces the use of a macro create_inst_attribute for the
attribute value with a macro __ATTR_RO.

Additionally, this patch removes not anymore used macros MOST_INST_ATTR
and create_inst_attribute.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index a9fd896c9a9e..f3a2dc4f4b47 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -562,9 +562,6 @@ create_most_c_obj(const char *name, struct kobject *parent)
 /*		     ___	       ___
  *		     ___I N S T A N C E___
  */
-#define MOST_INST_ATTR(_name, _mode, _show, _store) \
-		struct most_inst_attribute most_inst_attr_##_name = \
-		__ATTR(_name, _mode, _show, _store)
 
 static struct list_head instance_list;
 
@@ -652,7 +649,7 @@ static void most_inst_release(struct kobject *kobj)
 	kfree(inst);
 }
 
-static ssize_t show_description(struct most_inst_obj *instance_obj,
+static ssize_t description_show(struct most_inst_obj *instance_obj,
 				struct most_inst_attribute *attr,
 				char *buf)
 {
@@ -687,10 +684,8 @@ static ssize_t interface_show(struct most_inst_obj *instance_obj,
 	return snprintf(buf, PAGE_SIZE, "unknown\n");
 }
 
-#define create_inst_attribute(value) \
-	static MOST_INST_ATTR(value, 0444, show_##value, NULL)
-
-create_inst_attribute(description);
+static struct most_inst_attribute most_inst_attr_description =
+	__ATTR_RO(description);
 
 static struct most_inst_attribute most_inst_attr_interface =
 	__ATTR_RO(interface);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (2 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-04-01 21:18   ` kbuild test robot
  2017-04-08 10:39   ` Greg KH
  2017-03-31 13:22 ` [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute Christian Gromm
                   ` (7 subsequent siblings)
  11 siblings, 2 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces the use of a macro MOST_CHNL_ATTR in the macro
create_channel_attribute with a macro __ATTR_RW.

Additionally, this patch removes not anymore used macro MOST_CHNL_ATTR.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index f3a2dc4f4b47..826984c2424d 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -127,10 +127,6 @@ struct most_c_attr {
 
 #define to_channel_attr(a) container_of(a, struct most_c_attr, attr)
 
-#define MOST_CHNL_ATTR(_name, _mode, _show, _store) \
-		struct most_c_attr most_chnl_attr_##_name = \
-		__ATTR(_name, _mode, _show, _store)
-
 /**
  * channel_attr_show - show function of channel object
  * @kobj: pointer to its kobject
@@ -352,14 +348,14 @@ create_show_channel_attribute(size_of_stream_buffer);
 create_show_channel_attribute(size_of_packet_buffer);
 create_show_channel_attribute(channel_starving);
 
-static ssize_t show_set_number_of_buffers(struct most_c_obj *c,
+static ssize_t set_number_of_buffers_show(struct most_c_obj *c,
 					  struct most_c_attr *attr,
 					  char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.num_buffers);
 }
 
-static ssize_t store_set_number_of_buffers(struct most_c_obj *c,
+static ssize_t set_number_of_buffers_store(struct most_c_obj *c,
 					   struct most_c_attr *attr,
 					   const char *buf,
 					   size_t count)
@@ -371,14 +367,14 @@ static ssize_t store_set_number_of_buffers(struct most_c_obj *c,
 	return count;
 }
 
-static ssize_t show_set_buffer_size(struct most_c_obj *c,
+static ssize_t set_buffer_size_show(struct most_c_obj *c,
 				    struct most_c_attr *attr,
 				    char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.buffer_size);
 }
 
-static ssize_t store_set_buffer_size(struct most_c_obj *c,
+static ssize_t set_buffer_size_store(struct most_c_obj *c,
 				     struct most_c_attr *attr,
 				     const char *buf,
 				     size_t count)
@@ -390,7 +386,7 @@ static ssize_t store_set_buffer_size(struct most_c_obj *c,
 	return count;
 }
 
-static ssize_t show_set_direction(struct most_c_obj *c,
+static ssize_t set_direction_show(struct most_c_obj *c,
 				  struct most_c_attr *attr,
 				  char *buf)
 {
@@ -401,7 +397,7 @@ static ssize_t show_set_direction(struct most_c_obj *c,
 	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
-static ssize_t store_set_direction(struct most_c_obj *c,
+static ssize_t set_direction_store(struct most_c_obj *c,
 				   struct most_c_attr *attr,
 				   const char *buf,
 				   size_t count)
@@ -421,7 +417,7 @@ static ssize_t store_set_direction(struct most_c_obj *c,
 	return count;
 }
 
-static ssize_t show_set_datatype(struct most_c_obj *c,
+static ssize_t set_datatype_show(struct most_c_obj *c,
 				 struct most_c_attr *attr,
 				 char *buf)
 {
@@ -434,7 +430,7 @@ static ssize_t show_set_datatype(struct most_c_obj *c,
 	return snprintf(buf, PAGE_SIZE, "unconfigured\n");
 }
 
-static ssize_t store_set_datatype(struct most_c_obj *c,
+static ssize_t set_datatype_store(struct most_c_obj *c,
 				  struct most_c_attr *attr,
 				  const char *buf,
 				  size_t count)
@@ -455,14 +451,14 @@ static ssize_t store_set_datatype(struct most_c_obj *c,
 	return count;
 }
 
-static ssize_t show_set_subbuffer_size(struct most_c_obj *c,
+static ssize_t set_subbuffer_size_show(struct most_c_obj *c,
 				       struct most_c_attr *attr,
 				       char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.subbuffer_size);
 }
 
-static ssize_t store_set_subbuffer_size(struct most_c_obj *c,
+static ssize_t set_subbuffer_size_store(struct most_c_obj *c,
 					struct most_c_attr *attr,
 					const char *buf,
 					size_t count)
@@ -474,14 +470,14 @@ static ssize_t store_set_subbuffer_size(struct most_c_obj *c,
 	return count;
 }
 
-static ssize_t show_set_packets_per_xact(struct most_c_obj *c,
+static ssize_t set_packets_per_xact_show(struct most_c_obj *c,
 					 struct most_c_attr *attr,
 					 char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.packets_per_xact);
 }
 
-static ssize_t store_set_packets_per_xact(struct most_c_obj *c,
+static ssize_t set_packets_per_xact_store(struct most_c_obj *c,
 					  struct most_c_attr *attr,
 					  const char *buf,
 					  size_t count)
@@ -494,7 +490,7 @@ static ssize_t store_set_packets_per_xact(struct most_c_obj *c,
 }
 
 #define create_channel_attribute(value) \
-	static MOST_CHNL_ATTR(value, 0644, show_##value, store_##value)
+	static struct most_c_attr most_chnl_attr_##value = __ATTR_RW(value)
 
 create_channel_attribute(set_buffer_size);
 create_channel_attribute(set_number_of_buffers);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (3 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 07/13] staging: most: consolidate channel attributes Christian Gromm
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/13] staging: most: consolidate channel attributes
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (4 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 08/13] staging: most: separate property showing links Christian Gromm
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces 13 temporary variables representing the attributes
to control the channel with an array of 13 elements to keep the
corresponding code compact.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 9cbd893989b3..720b9ced1a9d 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -333,17 +333,6 @@ static ssize_t channel_starving_show(struct most_c_obj *c,
 	return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
 }
 
-#define create_show_channel_attribute(val) \
-	static struct most_c_attr most_chnl_attr_##val = __ATTR_RO(val)
-
-create_show_channel_attribute(available_directions);
-create_show_channel_attribute(available_datatypes);
-create_show_channel_attribute(number_of_packet_buffers);
-create_show_channel_attribute(number_of_stream_buffers);
-create_show_channel_attribute(size_of_stream_buffer);
-create_show_channel_attribute(size_of_packet_buffer);
-create_show_channel_attribute(channel_starving);
-
 static ssize_t set_number_of_buffers_show(struct most_c_obj *c,
 					  struct most_c_attr *attr,
 					  char *buf)
@@ -485,33 +474,39 @@ static ssize_t set_packets_per_xact_store(struct most_c_obj *c,
 	return count;
 }
 
-#define create_channel_attribute(value) \
-	static struct most_c_attr most_chnl_attr_##value = __ATTR_RW(value)
-
-create_channel_attribute(set_buffer_size);
-create_channel_attribute(set_number_of_buffers);
-create_channel_attribute(set_direction);
-create_channel_attribute(set_datatype);
-create_channel_attribute(set_subbuffer_size);
-create_channel_attribute(set_packets_per_xact);
+static struct most_c_attr most_c_attrs[] = {
+	__ATTR_RO(available_directions),
+	__ATTR_RO(available_datatypes),
+	__ATTR_RO(number_of_packet_buffers),
+	__ATTR_RO(number_of_stream_buffers),
+	__ATTR_RO(size_of_stream_buffer),
+	__ATTR_RO(size_of_packet_buffer),
+	__ATTR_RO(channel_starving),
+	__ATTR_RW(set_buffer_size),
+	__ATTR_RW(set_number_of_buffers),
+	__ATTR_RW(set_direction),
+	__ATTR_RW(set_datatype),
+	__ATTR_RW(set_subbuffer_size),
+	__ATTR_RW(set_packets_per_xact),
+};
 
 /**
  * most_channel_def_attrs - array of default attributes of channel object
  */
 static struct attribute *most_channel_def_attrs[] = {
-	&most_chnl_attr_available_directions.attr,
-	&most_chnl_attr_available_datatypes.attr,
-	&most_chnl_attr_number_of_packet_buffers.attr,
-	&most_chnl_attr_number_of_stream_buffers.attr,
-	&most_chnl_attr_size_of_packet_buffer.attr,
-	&most_chnl_attr_size_of_stream_buffer.attr,
-	&most_chnl_attr_set_number_of_buffers.attr,
-	&most_chnl_attr_set_buffer_size.attr,
-	&most_chnl_attr_set_direction.attr,
-	&most_chnl_attr_set_datatype.attr,
-	&most_chnl_attr_set_subbuffer_size.attr,
-	&most_chnl_attr_set_packets_per_xact.attr,
-	&most_chnl_attr_channel_starving.attr,
+	&most_c_attrs[0].attr,
+	&most_c_attrs[1].attr,
+	&most_c_attrs[2].attr,
+	&most_c_attrs[3].attr,
+	&most_c_attrs[4].attr,
+	&most_c_attrs[5].attr,
+	&most_c_attrs[6].attr,
+	&most_c_attrs[7].attr,
+	&most_c_attrs[8].attr,
+	&most_c_attrs[9].attr,
+	&most_c_attrs[10].attr,
+	&most_c_attrs[11].attr,
+	&most_c_attrs[12].attr,
 	NULL,
 };
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/13] staging: most: separate property showing links
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (5 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 07/13] staging: most: consolidate channel attributes Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 09/13] staging: most: consolidate attributes for list of links Christian Gromm
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

Currently there are following properties of the AIM to control the links
to the HDMs:
  - write-only "remove_link" used to remove one link from a list,
  - read/write "add_link" used to add one link into a list and list all
    links.

This patch moves the read functionality of the "add_link" into the new
read-only property "links" to build consistent set of properties to
control the list of links.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 720b9ced1a9d..7fc7cb39ea2b 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -831,9 +831,9 @@ static void most_aim_release(struct kobject *kobj)
 	kfree(aim_obj);
 }
 
-static ssize_t add_link_show(struct most_aim_obj *aim_obj,
-			     struct most_aim_attribute *attr,
-			     char *buf)
+static ssize_t links_show(struct most_aim_obj *aim_obj,
+			  struct most_aim_attribute *attr,
+			  char *buf)
 {
 	struct most_c_obj *c;
 	struct most_inst_obj *i;
@@ -854,6 +854,9 @@ static ssize_t add_link_show(struct most_aim_obj *aim_obj,
 	return offs;
 }
 
+static struct most_aim_attribute most_aim_attr_links =
+	__ATTR_RO(links);
+
 /**
  * split_string - parses and changes string in the buffer buf and
  * splits it into two mandatory and one optional substrings.
@@ -998,7 +1001,7 @@ static ssize_t add_link_store(struct most_aim_obj *aim_obj,
 }
 
 static struct most_aim_attribute most_aim_attr_add_link =
-	__ATTR_RW(add_link);
+	__ATTR_WO(add_link);
 
 /**
  * remove_link_store - store function for remove_link attribute
@@ -1044,6 +1047,7 @@ static struct most_aim_attribute most_aim_attr_remove_link =
 	__ATTR_WO(remove_link);
 
 static struct attribute *most_aim_def_attrs[] = {
+	&most_aim_attr_links.attr,
 	&most_aim_attr_add_link.attr,
 	&most_aim_attr_remove_link.attr,
 	NULL,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/13] staging: most: consolidate attributes for list of links
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (6 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 08/13] staging: most: separate property showing links Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 10/13] staging: most: destroy cdev by channel disconnect Christian Gromm
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

This patch replaces three temporary variables representing the
attributes to control the links between the AIMs and HDMs with an array
of three elements to keep the corresponding code compact.

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

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 7fc7cb39ea2b..675b2a9e66c1 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -854,9 +854,6 @@ static ssize_t links_show(struct most_aim_obj *aim_obj,
 	return offs;
 }
 
-static struct most_aim_attribute most_aim_attr_links =
-	__ATTR_RO(links);
-
 /**
  * split_string - parses and changes string in the buffer buf and
  * splits it into two mandatory and one optional substrings.
@@ -1000,9 +997,6 @@ static ssize_t add_link_store(struct most_aim_obj *aim_obj,
 	return len;
 }
 
-static struct most_aim_attribute most_aim_attr_add_link =
-	__ATTR_WO(add_link);
-
 /**
  * remove_link_store - store function for remove_link attribute
  * @aim_obj: pointer to AIM object
@@ -1043,13 +1037,16 @@ static ssize_t remove_link_store(struct most_aim_obj *aim_obj,
 	return len;
 }
 
-static struct most_aim_attribute most_aim_attr_remove_link =
-	__ATTR_WO(remove_link);
+static struct most_aim_attribute most_aim_attrs[] = {
+	__ATTR_RO(links),
+	__ATTR_WO(add_link),
+	__ATTR_WO(remove_link),
+};
 
 static struct attribute *most_aim_def_attrs[] = {
-	&most_aim_attr_links.attr,
-	&most_aim_attr_add_link.attr,
-	&most_aim_attr_remove_link.attr,
+	&most_aim_attrs[0].attr,
+	&most_aim_attrs[1].attr,
+	&most_aim_attrs[2].attr,
 	NULL,
 };
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/13] staging: most: destroy cdev by channel disconnect
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (7 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 09/13] staging: most: consolidate attributes for list of links Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 11/13] staging: most: usb: fix calculation of the extra_len Christian Gromm
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

Currently, when the channel disappears whereas the character device is
open by an application, the character device will be destroyed only
after the application closes the character device.

When the channel appears again before the application closes the
channel, the channel cannot be linked to the character device with the
same name.

This patch changes the described behavior and destroys the character
device by the disconnecting the channel from the AIM.

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

diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 7f51024dc5eb..1e5cbc893496 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -99,11 +99,16 @@ static void destroy_cdev(struct aim_channel *c)
 
 	device_destroy(aim_class, c->devno);
 	cdev_del(&c->cdev);
-	kfifo_free(&c->fifo);
 	spin_lock_irqsave(&ch_list_lock, flags);
 	list_del(&c->list);
 	spin_unlock_irqrestore(&ch_list_lock, flags);
+}
+
+static void destroy_channel(struct aim_channel *c)
+{
 	ida_simple_remove(&minor_id, MINOR(c->devno));
+	kfifo_free(&c->fifo);
+	kfree(c);
 }
 
 /**
@@ -170,9 +175,8 @@ static int aim_close(struct inode *inode, struct file *filp)
 		stop_channel(c);
 		mutex_unlock(&c->io_mutex);
 	} else {
-		destroy_cdev(c);
 		mutex_unlock(&c->io_mutex);
-		kfree(c);
+		destroy_channel(c);
 	}
 	return 0;
 }
@@ -337,14 +341,14 @@ static int aim_disconnect_channel(struct most_interface *iface, int channel_id)
 	spin_lock(&c->unlink);
 	c->dev = NULL;
 	spin_unlock(&c->unlink);
+	destroy_cdev(c);
 	if (c->access_ref) {
 		stop_channel(c);
 		wake_up_interruptible(&c->wq);
 		mutex_unlock(&c->io_mutex);
 	} else {
-		destroy_cdev(c);
 		mutex_unlock(&c->io_mutex);
-		kfree(c);
+		destroy_channel(c);
 	}
 	return 0;
 }
@@ -546,7 +550,7 @@ static void __exit mod_exit(void)
 
 	list_for_each_entry_safe(c, tmp, &channel_list, list) {
 		destroy_cdev(c);
-		kfree(c);
+		destroy_channel(c);
 	}
 	class_destroy(aim_class);
 	unregister_chrdev_region(aim_devno, 1);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/13] staging: most: usb: fix calculation of the extra_len
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (8 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 10/13] staging: most: destroy cdev by channel disconnect Christian Gromm
@ 2017-03-31 13:22 ` 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
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

The final size of the buffer used for the streaming transfer consists of
the size for the user payload (buffer_size) and the size for the gaps
needed by the controller (extra_len).

The current implementation of the hdm_configure_channel() corrects the
buffer size down to the next appropriate for the hardware value, that is
the whole number of frames, but uses the old unaligned value to
calculate the extra_len.

Current patch fixes the described problem.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
index 65211d1824b7..6e94ee2b4fb3 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -649,8 +649,6 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
 {
 	unsigned int num_frames;
 	unsigned int frame_size;
-	unsigned int temp_size;
-	unsigned int tail_space;
 	struct most_dev *mdev = to_mdev(iface);
 	struct device *dev = &mdev->usb_device->dev;
 
@@ -685,7 +683,6 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
 	}
 
 	mdev->padding_active[channel] = true;
-	temp_size = conf->buffer_size;
 
 	frame_size = get_stream_frame_size(conf);
 	if (frame_size == 0 || frame_size > USB_MTU) {
@@ -693,25 +690,19 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
 		return -EINVAL;
 	}
 
+	num_frames = conf->buffer_size / frame_size;
+
 	if (conf->buffer_size % frame_size) {
-		u16 tmp_val;
-
-		tmp_val = conf->buffer_size / frame_size;
-		conf->buffer_size = tmp_val * frame_size;
-		dev_notice(dev,
-			   "Channel %d - rounding buffer size to %d bytes, channel config says %d bytes\n",
-			   channel,
-			   conf->buffer_size,
-			   temp_size);
-	}
+		u16 old_size = conf->buffer_size;
 
-	num_frames = conf->buffer_size / frame_size;
-	tail_space = num_frames * (USB_MTU - frame_size);
-	temp_size += tail_space;
+		conf->buffer_size = num_frames * frame_size;
+		dev_warn(dev, "%s: fixed buffer size (%d -> %d)\n",
+			 mdev->suffix[channel], old_size, conf->buffer_size);
+	}
 
 	/* calculate extra length to comply w/ HW padding */
-	conf->extra_len = (DIV_ROUND_UP(temp_size, USB_MTU) * USB_MTU)
-			  - conf->buffer_size;
+	conf->extra_len = num_frames * (USB_MTU - frame_size);
+
 exit:
 	mdev->conf[channel] = *conf;
 	if (conf->data_type == MOST_CH_ASYNC) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 12/13] staging: most: usb: fix size overflow
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (9 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 11/13] staging: most: usb: fix calculation of the extra_len Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  2017-03-31 13:22 ` [PATCH 13/13] staging: most: usb: Fix setting of writable DCI registers Christian Gromm
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Andrey Shvetsov, Christian Gromm

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

Despite the user payload may not be bigger than (2**16 - 1) bytes, the
final packet size may be bigger because of the gap space needed for the
controller.

This patch removes the temporary variables of the type u16 that are used
to hold the offsets that may be bigger than 2**16 bytes.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
index 6e94ee2b4fb3..ad907e9c59bb 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -281,7 +281,6 @@ static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
 	struct most_channel_config *conf = &mdev->conf[channel];
 	unsigned int frame_size = get_stream_frame_size(conf);
 	unsigned int j, num_frames;
-	u16 rd_addr, wr_addr;
 
 	if (!frame_size)
 		return -EIO;
@@ -293,13 +292,10 @@ static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
 		return -EIO;
 	}
 
-	for (j = 1; j < num_frames; j++) {
-		wr_addr = (num_frames - j) * USB_MTU;
-		rd_addr = (num_frames - j) * frame_size;
-		memmove(mbo->virt_address + wr_addr,
-			mbo->virt_address + rd_addr,
+	for (j = num_frames - 1; j > 0; j--)
+		memmove(mbo->virt_address + j * USB_MTU,
+			mbo->virt_address + j * frame_size,
 			frame_size);
-	}
 	mbo->buffer_length = num_frames * USB_MTU;
 	return 0;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 13/13] staging: most: usb: Fix setting of writable DCI registers
  2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
                   ` (10 preceding siblings ...)
  2017-03-31 13:22 ` [PATCH 12/13] staging: most: usb: fix size overflow Christian Gromm
@ 2017-03-31 13:22 ` Christian Gromm
  11 siblings, 0 replies; 15+ messages in thread
From: Christian Gromm @ 2017-03-31 13:22 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, Christian Gromm, Alex Riesen

The function store_value is about writing a value, but the code has been
passing ro_regs array to get_static_reg_addr, which prevented setting
the writable registers.

Noticed when trying to setup the EUI48.

Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
index ad907e9c59bb..477c0ed305d3 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -1005,7 +1005,7 @@ static ssize_t store_value(struct most_dci_obj *dci_obj,
 		err = drci_wr_reg(usb_dev, dci_obj->reg_addr, val);
 	else if (!strcmp(name, "sync_ep"))
 		err = start_sync_ep(usb_dev, val);
-	else if (!get_static_reg_addr(ro_regs, name, &reg_addr))
+	else if (!get_static_reg_addr(rw_regs, name, &reg_addr))
 		err = drci_wr_reg(usb_dev, reg_addr, val);
 	else
 		return -EFAULT;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute
  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
  1 sibling, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2017-04-01 21:18 UTC (permalink / raw)
  To: Christian Gromm; +Cc: kbuild-all, gregkh, driverdev-devel

[-- Attachment #1: Type: text/plain, Size: 8227 bytes --]

Hi Andrey,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc4 next-20170331]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Christian-Gromm/staging-most-fix-comment-of-the-function-add_link_store/20170402-004537
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=alpha 

Note: the linux-review/Christian-Gromm/staging-most-fix-comment-of-the-function-add_link_store/20170402-004537 HEAD 28ff2490d393d5a8fe98d9268401e15c7400daff builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
>> drivers/staging//most/mostcore/core.c:343:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(available_directions);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:344:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(available_datatypes);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:345:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(number_of_packet_buffers);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:346:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(number_of_stream_buffers);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:347:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(size_of_stream_buffer);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:348:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(size_of_packet_buffer);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging//most/mostcore/core.c:341:29: error: expected ')' before numeric constant
     static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
                                ^
   drivers/staging//most/mostcore/core.c:349:1: note: in expansion of macro 'create_show_channel_attribute'
    create_show_channel_attribute(channel_starving);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:506:3: error: 'most_chnl_attr_available_directions' undeclared here (not in a function)
     &most_chnl_attr_available_directions.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:507:3: error: 'most_chnl_attr_available_datatypes' undeclared here (not in a function)
     &most_chnl_attr_available_datatypes.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:508:3: error: 'most_chnl_attr_number_of_packet_buffers' undeclared here (not in a function)
     &most_chnl_attr_number_of_packet_buffers.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:509:3: error: 'most_chnl_attr_number_of_stream_buffers' undeclared here (not in a function)
     &most_chnl_attr_number_of_stream_buffers.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:510:3: error: 'most_chnl_attr_size_of_packet_buffer' undeclared here (not in a function)
     &most_chnl_attr_size_of_packet_buffer.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:511:3: error: 'most_chnl_attr_size_of_stream_buffer' undeclared here (not in a function)
     &most_chnl_attr_size_of_stream_buffer.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:518:3: error: 'most_chnl_attr_channel_starving' undeclared here (not in a function)
     &most_chnl_attr_channel_starving.attr,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:333:16: warning: 'show_channel_starving' defined but not used [-Wunused-function]
    static ssize_t show_channel_starving(struct most_c_obj *c,
                   ^~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:323:9: warning: 'show_size_of_stream_buffer' defined but not used [-Wunused-function]
    ssize_t show_size_of_stream_buffer(struct most_c_obj *c,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:312:9: warning: 'show_size_of_packet_buffer' defined but not used [-Wunused-function]
    ssize_t show_size_of_packet_buffer(struct most_c_obj *c,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:301:9: warning: 'show_number_of_stream_buffers' defined but not used [-Wunused-function]
    ssize_t show_number_of_stream_buffers(struct most_c_obj *c,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:290:9: warning: 'show_number_of_packet_buffers' defined but not used [-Wunused-function]
    ssize_t show_number_of_packet_buffers(struct most_c_obj *c,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:270:16: warning: 'show_available_datatypes' defined but not used [-Wunused-function]
    static ssize_t show_available_datatypes(struct most_c_obj *c,
                   ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging//most/mostcore/core.c:255:16: warning: 'show_available_directions' defined but not used [-Wunused-function]
    static ssize_t show_available_directions(struct most_c_obj *c,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +/create_show_channel_attribute +343 drivers/staging//most/mostcore/core.c

57562a72 Christian Gromm 2015-07-24  335  				     char *buf)
57562a72 Christian Gromm 2015-07-24  336  {
57562a72 Christian Gromm 2015-07-24  337  	return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
57562a72 Christian Gromm 2015-07-24  338  }
57562a72 Christian Gromm 2015-07-24  339  
57562a72 Christian Gromm 2015-07-24  340  #define create_show_channel_attribute(val) \
7e47629e Jason Litzinger 2016-11-25 @341  	static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
57562a72 Christian Gromm 2015-07-24  342  
57562a72 Christian Gromm 2015-07-24 @343  create_show_channel_attribute(available_directions);
57562a72 Christian Gromm 2015-07-24  344  create_show_channel_attribute(available_datatypes);
57562a72 Christian Gromm 2015-07-24  345  create_show_channel_attribute(number_of_packet_buffers);
57562a72 Christian Gromm 2015-07-24  346  create_show_channel_attribute(number_of_stream_buffers);

:::::: The code at line 343 was first introduced by commit
:::::: 57562a72414ca35b2e614cfe0a1b1a7b7e7813dd Staging: most: add MOST driver's core module

:::::: TO: Christian Gromm <christian.gromm@microchip.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49612 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute
  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
  1 sibling, 0 replies; 15+ messages in thread
From: Greg KH @ 2017-04-08 10:39 UTC (permalink / raw)
  To: Christian Gromm; +Cc: driverdev-devel, Andrey Shvetsov

On Fri, Mar 31, 2017 at 03:22:26PM +0200, Christian Gromm wrote:
> From: Andrey Shvetsov <andrey.shvetsov@k2l.de>
> 
> This patch replaces the use of a macro MOST_CHNL_ATTR in the macro
> create_channel_attribute with a macro __ATTR_RW.
> 
> Additionally, this patch removes not anymore used macro MOST_CHNL_ATTR.
> 
> Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
> Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
> ---
>  drivers/staging/most/mostcore/core.c | 30 +++++++++++++-----------------
>  1 file changed, 13 insertions(+), 17 deletions(-)

This patch seems to break the build, according to the 0-day bot.  Can
you fix up and resend this series?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-04-08 10:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute Christian Gromm
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

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.