qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] util: add required space to fix checkpatch


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH 2/3] util: add required space to fix checkpatch errors
Date: Fri, 29 Mar 2019 16:46:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

On 29/03/2019 16.08, Jules Irenge wrote:
> Add required space to fix errors issued by checkpatch.pl tool
> "ERROR: space required after that ..."
>  within "util/readline.c" file.
> 
> Signed-off-by: Jules Irenge <address@hidden>
> ---
>  util/readline.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/util/readline.c b/util/readline.c
> index a97b600428..e4c41aeac1 100644
> --- a/util/readline.c
> +++ b/util/readline.c
> @@ -67,12 +67,12 @@ static void readline_update(ReadLineState *rs)
>      if (rs->cmd_buf_index != rs->last_cmd_buf_index) {
>          delta = rs->cmd_buf_index - rs->last_cmd_buf_index;
>          if (delta > 0) {
> -            for (i = 0;i < delta; i++) {
> +            for (i = 0; i < delta; i++) {
>                  rs->printf_func(rs->opaque, "\033[C");
>              }
>          } else {
>              delta = -delta;
> -            for (i = 0;i < delta; i++) {
> +            for (i = 0; i < delta; i++) {
>                  rs->printf_func(rs->opaque, "\033[D");
>              }
>          }
> @@ -315,12 +315,12 @@ static void readline_completion(ReadLineState *rs)
>          max_prefix = 0;      
>          for (i = 0; i < rs->nb_completions; i++) {
>              len = strlen(rs->completions[i]);
> -            if (i==0) {
> +            if (i == 0) {
>                  max_prefix = len;
>              } else {
>                  if (len < max_prefix)
>                      max_prefix = len;
> -                for (j=0; j<max_prefix; j++) {
> +                for (j = 0; j < max_prefix; j++) {
>                      if (rs->completions[i][j] != rs->completions[0][j])
>                          max_prefix = j;
>                  }
> @@ -463,7 +463,7 @@ void readline_handle_byte(ReadLineState *rs, int ch)
>      the_end:
>          break;
>      case IS_SS3:
> -        switch(ch) {
> +        switch (ch) {

At least this last hunk looks like it should rather be part of the first
patch instead. Just a matter of taste, but I think I'd also rather
squash the two first patches together (with git rebase -i ...), and then
simply mention in the patch description that you've addressed both
checkpatch warnings. That way you don't have to touch the same lines in
multiple patches.

 Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]