From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 07 Dec 2011 08:16:34 +0100 Subject: [U-Boot] [PATCH 09/10] Use CMD_RET_usage in i2c In-Reply-To: <1323236876-9100-10-git-send-email-sjg@chromium.org> References: <1323236876-9100-1-git-send-email-sjg@chromium.org> <1323236876-9100-10-git-send-email-sjg@chromium.org> Message-ID: <4EDF12D2.2090205@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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