From patchwork Thu Sep 10 10:23:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 7153241 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C63F2BEEC1 for ; Thu, 10 Sep 2015 10:20:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E527220867 for ; Thu, 10 Sep 2015 10:20:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CC1452085D for ; Thu, 10 Sep 2015 10:20:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8A676E0B2; Thu, 10 Sep 2015 03:20:36 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id F24346E0B2 for ; Thu, 10 Sep 2015 03:20:35 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 10 Sep 2015 03:20:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,504,1437462000"; d="scan'208";a="802175805" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 10 Sep 2015 03:20:33 -0700 From: Jani Nikula To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org In-Reply-To: <1441828594-21958-2-git-send-email-ville.syrjala@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <1441828594-21958-1-git-send-email-ville.syrjala@linux.intel.com> <1441828594-21958-2-git-send-email-ville.syrjala@linux.intel.com> User-Agent: Notmuch/0.20.2+58~g39779b9 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 10 Sep 2015 13:23:45 +0300 Message-ID: <87pp1qlgi6.fsf@intel.com> MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH i-g-t 2/2] tools/intel_reg: Print the potential port names in the help text X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 09 Sep 2015, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä > > Signed-off-by: Ville Syrjälä Both LGTM, though I'd apply this paint on the 2nd patch: 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 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); }