All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/2] tools/intel_reg: Print the potential	port names in the help text
Date: Thu, 10 Sep 2015 13:23:45 +0300	[thread overview]
Message-ID: <87pp1qlgi6.fsf@intel.com> (raw)
In-Reply-To: <1441828594-21958-2-git-send-email-ville.syrjala@linux.intel.com>

On Wed, 09 Sep 2015, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Both LGTM, though I'd apply this paint on the 2nd patch:


diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 26f908fa5c01..e4c0fcdc109f 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -629,8 +629,11 @@ static int intel_reg_help(struct config *config, int argc, char *argv[])
 	printf("\n");
 	printf("REGISTER is defined as:\n");
         printf("  [(PORTNAME|PORTNUM|MMIO-OFFSET):](REGNAME|REGADDR)\n");
-	printf("PORTNAME is one of: ");
+
+	printf("\n");
+	printf("PORTNAME is one of:\n  ");
 	intel_reg_spec_print_ports();
+	printf("\n");
 
 	printf("\n");
 	printf("OPTIONS common to most COMMANDS:\n");
diff --git a/tools/intel_reg_spec.c b/tools/intel_reg_spec.c
index b1eddbd1fd90..e46f4bea19b5 100644
--- a/tools/intel_reg_spec.c
+++ b/tools/intel_reg_spec.c
@@ -349,6 +349,5 @@ void intel_reg_spec_print_ports(void)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(port_descs); i++)
-		printf(" %s%c", port_descs[i].name,
-		       i == ARRAY_SIZE(port_descs) - 1 ? '\n' : ',');
+		printf("%s%s", i == 0 ? "" : ", ", port_descs[i].name);
 }


BR,
Jani.


> ---
>  tools/intel_reg.c      | 2 ++
>  tools/intel_reg_spec.c | 9 +++++++++
>  tools/intel_reg_spec.h | 1 +
>  3 files changed, 12 insertions(+)
>
> diff --git a/tools/intel_reg.c b/tools/intel_reg.c
> index fb3461f..26f908f 100644
> --- a/tools/intel_reg.c
> +++ b/tools/intel_reg.c
> @@ -629,6 +629,8 @@ static int intel_reg_help(struct config *config, int argc, char *argv[])
>  	printf("\n");
>  	printf("REGISTER is defined as:\n");
>          printf("  [(PORTNAME|PORTNUM|MMIO-OFFSET):](REGNAME|REGADDR)\n");
> +	printf("PORTNAME is one of: ");
> +	intel_reg_spec_print_ports();
>  
>  	printf("\n");
>  	printf("OPTIONS common to most COMMANDS:\n");
> diff --git a/tools/intel_reg_spec.c b/tools/intel_reg_spec.c
> index b49e0dc..babc13c 100644
> --- a/tools/intel_reg_spec.c
> +++ b/tools/intel_reg_spec.c
> @@ -343,3 +343,12 @@ void intel_reg_spec_free(struct reg *regs, size_t n)
>  	}
>  	free(regs);
>  }
> +
> +void intel_reg_spec_print_ports(void)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(port_descs); i++)
> +		printf(" %s%c", port_descs[i].name,
> +		       i == ARRAY_SIZE(port_descs) - 1 ? '\n' : ',');
> +}
> diff --git a/tools/intel_reg_spec.h b/tools/intel_reg_spec.h
> index 26e8252..dcb3143 100644
> --- a/tools/intel_reg_spec.h
> +++ b/tools/intel_reg_spec.h
> @@ -73,5 +73,6 @@ ssize_t intel_reg_spec_file(struct reg **regs, const char *filename);
>  void intel_reg_spec_free(struct reg *regs, size_t n);
>  int intel_reg_spec_decode(char *buf, size_t bufsize, const struct reg *reg,
>  			  uint32_t val, uint32_t devid);
> +void intel_reg_spec_print_ports(void);
>  
>  #endif /* __INTEL_REG_SPEC_H__ */
> -- 
> 2.4.6
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2015-09-10 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 19:56 [PATCH i-g-t 1/2] tools/intel_reg: Set register stride to 1 for VGA registers ville.syrjala
2015-09-09 19:56 ` [PATCH i-g-t 2/2] tools/intel_reg: Print the potential port names in the help text ville.syrjala
2015-09-10 10:23   ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp1qlgi6.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.