public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] staging: lustre: fixed comments without */ on a separate line
@ 2015-07-27 19:20 Mario Bambagini
  2015-07-27 19:20 ` [PATCH v2 2/5] staging: lustre: fixed 80-char rule Mario Bambagini
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Mario Bambagini @ 2015-07-27 19:20 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, mario.bambagini, devel, linux-kernel

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

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 a626871..119f017 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -206,7 +206,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) &&
@@ -225,7 +226,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;
 			}
@@ -447,7 +449,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;
@@ -537,7 +540,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 related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/5] staging: lustre: fixed 80-char rule
  2015-07-27 19:20 [PATCH v2 1/5] staging: lustre: fixed comments without */ on a separate line Mario Bambagini
@ 2015-07-27 19:20 ` Mario Bambagini
  2015-07-28 11:32   ` Sudip Mukherjee
  2015-07-27 19:20 ` [PATCH v2 3/5] staging: lustre: fix bad alignment Mario Bambagini
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Mario Bambagini @ 2015-07-27 19:20 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, mario.bambagini, devel, linux-kernel

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 119f017..1f72066 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 related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/5] staging: lustre: fix bad alignment
  2015-07-27 19:20 [PATCH v2 1/5] staging: lustre: fixed comments without */ on a separate line Mario Bambagini
  2015-07-27 19:20 ` [PATCH v2 2/5] staging: lustre: fixed 80-char rule Mario Bambagini
@ 2015-07-27 19:20 ` Mario Bambagini
  2015-07-27 20:03   ` Dan Carpenter
  2015-07-28 11:35   ` Sudip Mukherjee
  2015-07-27 19:20 ` [PATCH v2 4/5] staging: lustre: added a space between concatenated strings Mario Bambagini
  2015-07-27 19:20 ` [PATCH v2 5/5] staging: lustre: modified comparisons against NULL Mario Bambagini
  3 siblings, 2 replies; 9+ messages in thread
From: Mario Bambagini @ 2015-07-27 19:20 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, mario.bambagini, devel, linux-kernel

This patch fixes 8 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 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
index 1f72066..a3b3c46 100644
--- a/drivers/staging/lustre/lustre/llite/llite_capa.c
+++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
@@ -71,7 +71,7 @@ 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)
+				     unsigned long expiry)
 {
 	if (time_before(expiry, ll_capa_timer.expires) ||
 	    !timer_pending(&ll_capa_timer)) {
@@ -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 related	[flat|nested] 9+ messages in thread

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

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

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..5162202 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 related	[flat|nested] 9+ messages in thread

* [PATCH v2 5/5] staging: lustre: modified comparisons against NULL
  2015-07-27 19:20 [PATCH v2 1/5] staging: lustre: fixed comments without */ on a separate line Mario Bambagini
                   ` (2 preceding siblings ...)
  2015-07-27 19:20 ` [PATCH v2 4/5] staging: lustre: added a space between concatenated strings Mario Bambagini
@ 2015-07-27 19:20 ` Mario Bambagini
  2015-07-27 20:04   ` Dan Carpenter
  3 siblings, 1 reply; 9+ messages in thread
From: Mario Bambagini @ 2015-07-27 19:20 UTC (permalink / raw)
  To: oleg.drokin; +Cc: andreas.dilger, gregkh, mario.bambagini, devel, linux-kernel

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

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

MB

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 5162202..24590ae 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 related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/5] staging: lustre: fix bad alignment
  2015-07-27 19:20 ` [PATCH v2 3/5] staging: lustre: fix bad alignment Mario Bambagini
@ 2015-07-27 20:03   ` Dan Carpenter
  2015-07-28 11:35   ` Sudip Mukherjee
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2015-07-27 20:03 UTC (permalink / raw)
  To: Mario Bambagini; +Cc: oleg.drokin, devel, gregkh, andreas.dilger, linux-kernel

On Mon, Jul 27, 2015 at 09:20:23PM +0200, Mario Bambagini wrote:
> This patch fixes 8 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>

I think you wrote this one against your old patch instead of against
Greg's tree.

regards,
dan carpenter



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

* Re: [PATCH v2 5/5] staging: lustre: modified comparisons against NULL
  2015-07-27 19:20 ` [PATCH v2 5/5] staging: lustre: modified comparisons against NULL Mario Bambagini
@ 2015-07-27 20:04   ` Dan Carpenter
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2015-07-27 20:04 UTC (permalink / raw)
  To: Mario Bambagini; +Cc: oleg.drokin, devel, gregkh, andreas.dilger, linux-kernel

On Mon, Jul 27, 2015 at 09:20:25PM +0200, Mario Bambagini wrote:
> The explicit comparisons against NULL has been modified to be shorter.
> 
> The script checkpatch.pl does not return any other warning/error.
> 
> MB

Don't put MB in here.

> 
> Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>

regards,
dan carpenter


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

* Re: [PATCH v2 2/5] staging: lustre: fixed 80-char rule
  2015-07-27 19:20 ` [PATCH v2 2/5] staging: lustre: fixed 80-char rule Mario Bambagini
@ 2015-07-28 11:32   ` Sudip Mukherjee
  0 siblings, 0 replies; 9+ messages in thread
From: Sudip Mukherjee @ 2015-07-28 11:32 UTC (permalink / raw)
  To: Mario Bambagini; +Cc: oleg.drokin, devel, gregkh, andreas.dilger, linux-kernel

On Mon, Jul 27, 2015 at 09:20:22PM +0200, Mario Bambagini wrote:
> 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>
> ---
<snip>
>  
> -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)
You are adding a new checkpatch warning here:
"Alignment should match open parenthesis"

regards
sudip

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

* Re: [PATCH v2 3/5] staging: lustre: fix bad alignment
  2015-07-27 19:20 ` [PATCH v2 3/5] staging: lustre: fix bad alignment Mario Bambagini
  2015-07-27 20:03   ` Dan Carpenter
@ 2015-07-28 11:35   ` Sudip Mukherjee
  1 sibling, 0 replies; 9+ messages in thread
From: Sudip Mukherjee @ 2015-07-28 11:35 UTC (permalink / raw)
  To: Mario Bambagini; +Cc: oleg.drokin, devel, gregkh, andreas.dilger, linux-kernel

On Mon, Jul 27, 2015 at 09:20:23PM +0200, Mario Bambagini wrote:
> This patch fixes 8 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 | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/llite_capa.c b/drivers/staging/lustre/lustre/llite/llite_capa.c
> index 1f72066..a3b3c46 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_capa.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_capa.c
> @@ -71,7 +71,7 @@ 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)
> +				     unsigned long expiry)
This bad alignment was created in your previous patch of the series. You
should have aligned it when you splitted the line for 80 char limit.

regards
sudip

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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 19:20 [PATCH v2 1/5] staging: lustre: fixed comments without */ on a separate line Mario Bambagini
2015-07-27 19:20 ` [PATCH v2 2/5] staging: lustre: fixed 80-char rule Mario Bambagini
2015-07-28 11:32   ` Sudip Mukherjee
2015-07-27 19:20 ` [PATCH v2 3/5] staging: lustre: fix bad alignment Mario Bambagini
2015-07-27 20:03   ` Dan Carpenter
2015-07-28 11:35   ` Sudip Mukherjee
2015-07-27 19:20 ` [PATCH v2 4/5] staging: lustre: added a space between concatenated strings Mario Bambagini
2015-07-27 19:20 ` [PATCH v2 5/5] staging: lustre: modified comparisons against NULL Mario Bambagini
2015-07-27 20:04   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox