public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: wenhungyang <fyonyung@gmail.com>
To: gregkh@linuxfoundation.org
Cc: sfr@canb.auug.org.au, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: fixed drivers/staging/most/mostcore/core.c coding style
Date: Sat, 26 Nov 2016 11:39:47 +0800	[thread overview]
Message-ID: <20161126033947.GA8969@fyon-U2442> (raw)

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

fix drivers/staging/most/mostcore/core.c coding style

1. move static from MACRO to function name
2. change symbolic permission such as 'S_IRUGO' to number


[-- Attachment #2: 0001-fix-core.c-coding-style.patch --]
[-- Type: text/x-diff, Size: 3900 bytes --]

>From 3e1dba83090c58251aae1dc7aca431bb11632a98 Mon Sep 17 00:00:00 2001
From: wenhungyang <fyonyung@gmail.com>
Date: Wed, 23 Nov 2016 21:55:36 +0800
Subject: [c157e58488d1] fix core.c coding-style
To: fyonyung@gmail.com

Signed-off-by: wenhungyang <fyonyung@gmail.com>
---
 drivers/staging/most/mostcore/core.c | 40 ++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 4c580d1..9286c36 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -342,15 +342,15 @@ static ssize_t show_channel_starving(struct most_c_obj *c,
 }
 
 #define create_show_channel_attribute(val) \
-	static MOST_CHNL_ATTR(val, S_IRUGO, show_##val, NULL)
+	MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
 
-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 create_show_channel_attribute(available_directions);
+static create_show_channel_attribute(available_datatypes);
+static create_show_channel_attribute(number_of_packet_buffers);
+static create_show_channel_attribute(number_of_stream_buffers);
+static create_show_channel_attribute(size_of_stream_buffer);
+static create_show_channel_attribute(size_of_packet_buffer);
+static create_show_channel_attribute(channel_starving);
 
 static ssize_t show_set_number_of_buffers(struct most_c_obj *c,
 					  struct most_c_attr *attr,
@@ -494,16 +494,16 @@ static ssize_t store_set_packets_per_xact(struct most_c_obj *c,
 }
 
 #define create_channel_attribute(value) \
-	static MOST_CHNL_ATTR(value, S_IRUGO | S_IWUSR, \
+	MOST_CHNL_ATTR(value, 0644, \
 			      show_##value, \
 			      store_##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 create_channel_attribute(set_buffer_size);
+static create_channel_attribute(set_number_of_buffers);
+static create_channel_attribute(set_direction);
+static create_channel_attribute(set_datatype);
+static create_channel_attribute(set_subbuffer_size);
+static create_channel_attribute(set_packets_per_xact);
 
 /**
  * most_channel_def_attrs - array of default attributes of channel object
@@ -690,10 +690,10 @@ static ssize_t show_interface(struct most_inst_obj *instance_obj,
 }
 
 #define create_inst_attribute(value) \
-	static MOST_INST_ATTR(value, S_IRUGO, show_##value, NULL)
+	MOST_INST_ATTR(value, 0444, show_##value, NULL)
 
-create_inst_attribute(description);
-create_inst_attribute(interface);
+static create_inst_attribute(description);
+static create_inst_attribute(interface);
 
 static struct attribute *most_inst_def_attrs[] = {
 	&most_inst_attr_description.attr,
@@ -1016,7 +1016,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
 }
 
 static struct most_aim_attribute most_aim_attr_add_link =
-	__ATTR(add_link, S_IRUGO | S_IWUSR, show_add_link, store_add_link);
+	__ATTR(add_link, 0644, show_add_link, store_add_link);
 
 /**
  * store_remove_link - store function for remove_link attribute
@@ -1059,7 +1059,7 @@ static ssize_t store_remove_link(struct most_aim_obj *aim_obj,
 }
 
 static struct most_aim_attribute most_aim_attr_remove_link =
-	__ATTR(remove_link, S_IWUSR, NULL, store_remove_link);
+	__ATTR(remove_link, 0200, NULL, store_remove_link);
 
 static struct attribute *most_aim_def_attrs[] = {
 	&most_aim_attr_add_link.attr,
-- 
2.7.4


                 reply	other threads:[~2016-11-26  3:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161126033947.GA8969@fyon-U2442 \
    --to=fyonyung@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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