[1/9] lustre: obdclass: fix formating of connection flags
diff mbox series

Message ID 154295732787.2850.4431010272997855706.stgit@noble
State New
Headers show
Series
  • Assorted lustre patches - mostly from OpenSFS
Related show

Commit Message

NeilBrown Nov. 23, 2018, 7:15 a.m. UTC
The current code puts the separator *only*
at the start rather than *never* at the start.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../lustre/lustre/obdclass/lprocfs_status.c        |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Simmons Nov. 26, 2018, 1:30 a.m. UTC | #1
> The current code puts the separator *only*
> at the start rather than *never* at the start.

Reviewed-by: James Simmons <jsimmons@infradead.org>y
 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  .../lustre/lustre/obdclass/lprocfs_status.c        |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> index feba2ef5a3bc..acfea7a44350 100644
> --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> @@ -709,14 +709,14 @@ static void obd_connect_seq_flags2str(struct seq_file *m, u64 flags,
>  	for (i = 0, mask = 1; i < 64; i++, mask <<= 1) {
>  		if (flags & mask) {
>  			seq_printf(m, "%s%s",
> -				   first ? sep : "", obd_connect_names[i]);
> +				   first ? "" : sep, obd_connect_names[i]);
>  			first = false;
>  		}
>  	}
>  
>  	if (flags & ~(mask - 1)) {
>  		seq_printf(m, "%sunknown flags %#llx",
> -			   first ? sep : "", flags & ~(mask - 1));
> +			   first ? "" : sep, flags & ~(mask - 1));
>  		first = false;
>  	}
>  
> 
> 
>

Patch
diff mbox series

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index feba2ef5a3bc..acfea7a44350 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -709,14 +709,14 @@  static void obd_connect_seq_flags2str(struct seq_file *m, u64 flags,
 	for (i = 0, mask = 1; i < 64; i++, mask <<= 1) {
 		if (flags & mask) {
 			seq_printf(m, "%s%s",
-				   first ? sep : "", obd_connect_names[i]);
+				   first ? "" : sep, obd_connect_names[i]);
 			first = false;
 		}
 	}
 
 	if (flags & ~(mask - 1)) {
 		seq_printf(m, "%sunknown flags %#llx",
-			   first ? sep : "", flags & ~(mask - 1));
+			   first ? "" : sep, flags & ~(mask - 1));
 		first = false;
 	}