diff mbox

[5/5] rxe_cfg: Use printf() instead of using a loop

Message ID 278745ec-1e31-4379-27d9-40f371d30c29@sandisk.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche Oct. 7, 2016, 6:39 p.m. UTC
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
---
 providers/rxe/rxe_cfg | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

yonatan cohen Oct. 13, 2016, 11:07 a.m. UTC | #1
On 10/7/2016 9:39 PM, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> ---
>  providers/rxe/rxe_cfg | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/providers/rxe/rxe_cfg b/providers/rxe/rxe_cfg
> index 0a3dcf16957c..6c414fbda6fd 100755
> --- a/providers/rxe/rxe_cfg
> +++ b/providers/rxe/rxe_cfg
> @@ -241,7 +241,6 @@ sub status_print {
>      my @flen = ();
>      my $num_fields = 0;
>      my $i;
> -    my $j;
>      my $pad;
>      my $line;
>
> @@ -281,9 +280,7 @@ sub status_print {
>  	    else {
>  		print "   ";
>  	    }
> -	    for ($j = 0; $j < $pad; $j++) {
> -		print " ";
> -	    }
> +	    printf("%*s", $pad, "");
>  	}
>  	print "\n";
>      }
>
ack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/providers/rxe/rxe_cfg b/providers/rxe/rxe_cfg
index 0a3dcf16957c..6c414fbda6fd 100755
--- a/providers/rxe/rxe_cfg
+++ b/providers/rxe/rxe_cfg
@@ -241,7 +241,6 @@  sub status_print {
     my @flen = ();
     my $num_fields = 0;
     my $i;
-    my $j;
     my $pad;
     my $line;
 
@@ -281,9 +280,7 @@  sub status_print {
 	    else {
 		print "   ";
 	    }
-	    for ($j = 0; $j < $pad; $j++) {
-		print " ";
-	    }
+	    printf("%*s", $pad, "");
 	}
 	print "\n";
     }