mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars
@ 2015-07-28 20:08 Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 2/5] staging: lustre: fixed comments without */ on a new line Mario Bambagini
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mario Bambagini @ 2015-07-28 20:08 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, devel, linux-kernel, mario.bambagini

this set of patches fixes several code style problems:
-patch 1: lines with more than 80 chars
-patch 2: comments without */ on a separate line
-patch 3: bad alignment of lines split on more than one line
-patch 4: modified comparisons against NULL
-patch 5: added spaces between concatenated strings

This patch fixes 2 lines longer than 80 chars

The first one is a function whose argument has been moved to next line.
The second one is a comment split on two lines

Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_capa.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index a626871..9c9e482 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -70,7 +70,8 @@ static unsigned long long ll_capa_renewal_retries;
 
 static int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa);
 
-static inline void update_capa_timer(struct obd_capa *ocapa, unsigned long expiry)
+static inline void update_capa_timer(struct obd_capa *ocapa,
+				     unsigned long expiry)
 {
 	if (time_before(expiry, ll_capa_timer.expires) ||
 	    !timer_pending(&ll_capa_timer)) {
@@ -165,7 +166,8 @@ static void ll_delete_capa(struct obd_capa *ocapa)
 /* three places where client capa is deleted:
  * 1. capa_thread_main(), main place to delete expired capa.
  * 2. ll_clear_inode_capas() in ll_clear_inode().
- * 3. ll_truncate_free_capa() delete truncate capa explicitly in ll_setattr_ost().
+ * 3. ll_truncate_free_capa() delete truncate capa explicitly in
+ *    ll_setattr_ost().
  */
 static int capa_thread_main(void *unused)
 {
-- 
2.1.4


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

* [PATCH v3 2/5] staging: lustre: fixed comments without */ on a new line
  2015-07-28 20:08 [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars Mario Bambagini
@ 2015-07-28 20:08 ` Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 3/5] staging: lustre: fixed bad alignment Mario Bambagini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mario Bambagini @ 2015-07-28 20:08 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, devel, linux-kernel, mario.bambagini

This patch fixes 4 comments without */ on a new line

Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_capa.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index 9c9e482..4432a64 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -208,7 +208,8 @@ static int capa_thread_main(void *unused)
 			 * lock.
 			 */
 			/* ibits may be changed by ll_have_md_lock() so we have
-			 * to set it each time */
+			 * to set it each time
+			 */
 			ibits = MDS_INODELOCK_LOOKUP;
 			if (capa_for_mds(&ocapa->c_capa) &&
 			    !S_ISDIR(ocapa->u.cli.inode->i_mode) &&
@@ -227,7 +228,8 @@ static int capa_thread_main(void *unused)
 			if (capa_for_oss(&ocapa->c_capa) &&
 			    obd_capa_open_count(ocapa) == 0) {
 				/* oss capa with open count == 0 won't renew,
-				 * move to idle list */
+				 * move to idle list
+				 */
 				sort_add_capa(ocapa, &ll_idle_capas);
 				continue;
 			}
@@ -449,7 +451,8 @@ static inline void inode_add_oss_capa(struct inode *inode,
 	struct list_head *next = NULL;
 
 	/* capa is sorted in lli_oss_capas so lookup can always find the
-	 * latest one */
+	 * latest one
+	 */
 	list_for_each_entry(tmp, &lli->lli_oss_capas, u.cli.lli_list) {
 		if (cfs_time_after(ocapa->c_expiry, tmp->c_expiry)) {
 			next = &tmp->u.cli.lli_list;
@@ -539,7 +542,8 @@ static int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
 			ll_capa_renewal_failed++;
 
 			/* failed capa won't be renewed any longer, but if -EIO,
-			 * client might be doing recovery, retry in 2 min. */
+			 * client might be doing recovery, retry in 2 min.
+			 */
 			if (rc == -EIO && !capa_is_expired(ocapa)) {
 				delay_capa_renew(ocapa, 120);
 				DEBUG_CAPA(D_ERROR, &ocapa->c_capa,
-- 
2.1.4


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

* [PATCH v3 3/5] staging: lustre: fixed bad alignment
  2015-07-28 20:08 [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 2/5] staging: lustre: fixed comments without */ on a new line Mario Bambagini
@ 2015-07-28 20:08 ` Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 4/5] staging: lustre: modified comparisons against NULL Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 5/5] staging: lustre: added a space between concatenated strings Mario Bambagini
  3 siblings, 0 replies; 5+ messages in thread
From: Mario Bambagini @ 2015-07-28 20:08 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, devel, linux-kernel, mario.bambagini

This patch fixes 7 bad alignments. When a line is split on
more than one line, the other lines must be aligned with
paranthesis.

Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_capa.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index 4432a64..a3b3c46 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -103,13 +103,13 @@ static inline int have_expired_capa(void)
 	spin_lock(&capa_lock);
 	if (!list_empty(ll_capa_list)) {
 		ocapa = list_entry(ll_capa_list->next, struct obd_capa,
-				       c_list);
+				   c_list);
 		expired = capa_is_to_expire(ocapa);
 		if (!expired)
 			update_capa_timer(ocapa, capa_renewal_time(ocapa));
 	} else if (!list_empty(&ll_idle_capas)) {
 		ocapa = list_entry(ll_idle_capas.next, struct obd_capa,
-				       c_list);
+				   c_list);
 		expired = capa_is_expired(ocapa);
 		if (!expired)
 			update_capa_timer(ocapa, ocapa->c_expiry);
@@ -259,7 +259,7 @@ static int capa_thread_main(void *unused)
 			update_capa_timer(next, capa_renewal_time(next));
 
 		list_for_each_entry_safe(ocapa, tmp, &ll_idle_capas,
-					     c_list) {
+					 c_list) {
 			if (!capa_is_expired(ocapa)) {
 				if (!next)
 					update_capa_timer(ocapa,
@@ -303,11 +303,11 @@ int ll_capa_thread_start(void)
 	task = kthread_run(capa_thread_main, NULL, "ll_capa");
 	if (IS_ERR(task)) {
 		CERROR("cannot start expired capa thread: rc %ld\n",
-			PTR_ERR(task));
+		       PTR_ERR(task));
 		return PTR_ERR(task);
 	}
 	wait_event(ll_capa_thread.t_ctl_waitq,
-		       thread_is_running(&ll_capa_thread));
+		   thread_is_running(&ll_capa_thread));
 
 	return 0;
 }
@@ -317,7 +317,7 @@ void ll_capa_thread_stop(void)
 	thread_set_flags(&ll_capa_thread, SVC_STOPPING);
 	wake_up(&ll_capa_thread.t_ctl_waitq);
 	wait_event(ll_capa_thread.t_ctl_waitq,
-		       thread_is_stopped(&ll_capa_thread));
+		   thread_is_stopped(&ll_capa_thread));
 }
 
 struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
@@ -644,7 +644,7 @@ void ll_clear_inode_capas(struct inode *inode)
 		ll_delete_capa(ocapa);
 
 	list_for_each_entry_safe(ocapa, tmp, &lli->lli_oss_capas,
-				     u.cli.lli_list)
+				 u.cli.lli_list)
 		ll_delete_capa(ocapa);
 	spin_unlock(&capa_lock);
 }
-- 
2.1.4


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

* [PATCH v3 4/5] staging: lustre: modified comparisons against NULL
  2015-07-28 20:08 [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 2/5] staging: lustre: fixed comments without */ on a new line Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 3/5] staging: lustre: fixed bad alignment Mario Bambagini
@ 2015-07-28 20:08 ` Mario Bambagini
  2015-07-28 20:08 ` [PATCH v3 5/5] staging: lustre: added a space between concatenated strings Mario Bambagini
  3 siblings, 0 replies; 5+ messages in thread
From: Mario Bambagini @ 2015-07-28 20:08 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, devel, linux-kernel, mario.bambagini

The explicit comparisons against NULL has been modified to be shorter.

Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_capa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index a3b3c46..7768c6d8 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -236,7 +236,7 @@ static int capa_thread_main(void *unused)
 
 			/* NB iput() is in ll_update_capa() */
 			inode = igrab(ocapa->u.cli.inode);
-			if (inode == NULL) {
+			if (!inode) {
 				DEBUG_CAPA(D_ERROR, &ocapa->c_capa,
 					   "igrab failed for");
 				continue;
@@ -380,7 +380,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
 	struct ll_inode_info *lli = ll_i2info(inode);
 	struct obd_capa *ocapa;
 
-	LASSERT(inode != NULL);
+	LASSERT(inode);
 
 	if ((ll_i2sbi(inode)->ll_flags & LL_SBI_MDS_CAPA) == 0)
 		return NULL;
-- 
2.1.4


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

* [PATCH v3 5/5] staging: lustre: added a space between concatenated strings
  2015-07-28 20:08 [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars Mario Bambagini
                   ` (2 preceding siblings ...)
  2015-07-28 20:08 ` [PATCH v3 4/5] staging: lustre: modified comparisons against NULL Mario Bambagini
@ 2015-07-28 20:08 ` Mario Bambagini
  3 siblings, 0 replies; 5+ messages in thread
From: Mario Bambagini @ 2015-07-28 20:08 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, devel, linux-kernel, mario.bambagini

A space has been inserted between two concatenated strings as required from
checkpatch.pl

These two updates do not lead to any problem as DFID is defined as a 
string in ./drivers/staging/lustre/lustre/include/lustre/lustre_user.h

The script checkpatch.pl does not return any other warning/error.

Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_capa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index 7768c6d8..24590ae 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -364,7 +364,7 @@ struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)
 		ocapa = NULL;
 
 		if (atomic_read(&ll_capa_debug)) {
-			CERROR("no capability for "DFID" opc %#llx\n",
+			CERROR("no capability for " DFID " opc %#llx\n",
 			       PFID(&lli->lli_fid), opc);
 			atomic_set(&ll_capa_debug, 0);
 		}
@@ -389,7 +389,7 @@ struct obd_capa *ll_mdscapa_get(struct inode *inode)
 	ocapa = capa_get(lli->lli_mds_capa);
 	spin_unlock(&capa_lock);
 	if (!ocapa && atomic_read(&ll_capa_debug)) {
-		CERROR("no mds capability for "DFID"\n", PFID(&lli->lli_fid));
+		CERROR("no mds capability for " DFID "\n", PFID(&lli->lli_fid));
 		atomic_set(&ll_capa_debug, 0);
 	}
 
-- 
2.1.4


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

end of thread, other threads:[~2015-07-28 20:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 20:08 [PATCH v3 1/5] staging: lustre: fixed lines longer than 80 chars Mario Bambagini
2015-07-28 20:08 ` [PATCH v3 2/5] staging: lustre: fixed comments without */ on a new line Mario Bambagini
2015-07-28 20:08 ` [PATCH v3 3/5] staging: lustre: fixed bad alignment Mario Bambagini
2015-07-28 20:08 ` [PATCH v3 4/5] staging: lustre: modified comparisons against NULL Mario Bambagini
2015-07-28 20:08 ` [PATCH v3 5/5] staging: lustre: added a space between concatenated strings Mario Bambagini

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®