public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/10] Use CMD_RET_usage in i2c
Date: Wed, 07 Dec 2011 08:16:34 +0100	[thread overview]
Message-ID: <4EDF12D2.2090205@denx.de> (raw)
In-Reply-To: <1323236876-9100-10-git-send-email-sjg@chromium.org>

Hello Simon,

Simon Glass wrote:
> This small patch converts the I2C command over to using the
> CMD_RET_USAGE return value instead of calling cmd_usage()
> directly.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  common/cmd_i2c.c |   36 +++++++++++++++++++-----------------
>  1 files changed, 19 insertions(+), 17 deletions(-)

First, why did you seperate the changes in cmd_i2c.c from
the other same changes in your "Convert cmd_usage() calls in
common to use a	return value" patch? Is there a special reason
for this?

> diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
> index e795139..165f1f2 100644
> --- a/common/cmd_i2c.c
> +++ b/common/cmd_i2c.c
[...]
> @@ -1208,7 +1208,9 @@ static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
>  			device = device->next;
>  		}
>  	} else {
> -		(void)i2c_mux_ident_muxstring ((uchar *)argv[1]);
> +		I2C_MUX_DEVICE *dev;
> +
> +		dev = i2c_mux_ident_muxstring((uchar *)argv[1]);

No, this will result in this warning:

    cmd_i2c.c: In function 'do_i2c_add_bus':
    cmd_i2c.c:1212:19: warning: variable 'dev' set but not used
    [-Wunused-but-set-variable]

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2011-12-07  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07  5:47 [U-Boot] [PATCH 0/10] Unified command execution in one place Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 01/10] Remove CMD_PXE's static on run_command() Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 02/10] Rename run_command() to builtin_run_command() Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 03/10] Rename run_command2() to run_command() Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 04/10] Stop using builtin_run_command() Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 05/10] Don't include standard parser if hush is used Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 06/10] Create a single cmd_call() function to handle command execution Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 07/10] Remove interleave of non-U-Boot code in hush Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 08/10] Add cmd_process() to process commands in one place Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 09/10] Use CMD_RET_usage in i2c Simon Glass
2011-12-07  7:16   ` Heiko Schocher [this message]
2011-12-07 16:17     ` Simon Glass
2011-12-07  5:47 ` [U-Boot] [PATCH 10/10] Convert cmd_usage() calls in common to use a return value Simon Glass
2011-12-07 12:47   ` Igor Grinberg
2011-12-07 16:29     ` Simon Glass

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=4EDF12D2.2090205@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox