From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 26 Oct 2015 06:06:32 +0100 Subject: [U-Boot] [PATCH] env_ubi.c: Correct pointer error in env load In-Reply-To: <1445622690-18924-1-git-send-email-kevin.smith@elecsyscorp.com> References: <1445622690-18924-1-git-send-email-kevin.smith@elecsyscorp.com> Message-ID: <562DB4D8.3070805@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 Kevin, Am 23.10.2015 um 19:51 schrieb Kevin Smith: > The variable "buf" in this function is a char array, and the > function ubi_volume_read is expecting a char *. In the call, the > address of the pointer is being taken, incorrectly passing a > char **. The compiler warning was being silenced by the cast. > Remove the address operator and the cast. > > Signed-off-by: Kevin Smith > Cc: Joe Hershberger > Cc: Tom Rini > --- > common/env_ubi.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/common/env_ubi.c b/common/env_ubi.c > index e0dc5af..e611199 100644 > --- a/common/env_ubi.c > +++ b/common/env_ubi.c > @@ -181,8 +181,7 @@ void env_relocate_spec(void) > return; > } > > - if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)&buf, > - CONFIG_ENV_SIZE)) { > + if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, buf, CONFIG_ENV_SIZE)) { > printf("\n** Unable to read env from %s:%s **\n", > CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME); > set_default_env(NULL); Good catch! Reviewed-by: Heiko Schocher bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany