diff mbox series

[U-Boot] imx: mx53ppd: fix build error

Message ID 20181209115343.16713-1-peng.fan@nxp.com
State Accepted
Commit f026c1d9ef1cd20e966f57f53de25cb124ac2413
Delegated to: Stefano Babic
Headers show
Series [U-Boot] imx: mx53ppd: fix build error | expand

Commit Message

Peng Fan Dec. 9, 2018, 11:45 a.m. UTC
board/ge/mx53ppd/mx53ppd.c: In function 'board_late_init':
board/ge/mx53ppd/mx53ppd.c:359:23: error: passing argument 2 of 'read_vpd' from incompatible pointer type [-Werror=incompatible-pointer-types]
  res = read_vpd(&vpd, vpd_callback);
                       ^~~~~~~~~~~~
In file included from board/ge/mx53ppd/mx53ppd.c:37:0:
board/ge/mx53ppd/../../ge/common/vpd_reader.h:19:5: note: expected 'int (*)(struct vpd_cache *, u8,  u8,  u8,  size_t,  const u8 *) {aka int (*)(struct vpd_cache *, unsigned char,  unsigned char,  unsigned char,  unsigned int,  const unsigned char *)}' but argument is of type 'int (*)(void *, u8,  u8,  u8,  size_t,  const u8 *) {aka int (*)(void *, unsigned char,  unsigned char,  unsigned char,  unsigned int,  const unsigned char *)}'
int read_vpd(struct vpd_cache *cache,
     ^~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/ge/mx53ppd/mx53ppd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefano Babic Dec. 9, 2018, 1:11 p.m. UTC | #1
Hi Peng,

On 09/12/18 12:45, Peng Fan wrote:
> board/ge/mx53ppd/mx53ppd.c: In function 'board_late_init':
> board/ge/mx53ppd/mx53ppd.c:359:23: error: passing argument 2 of 'read_vpd' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   res = read_vpd(&vpd, vpd_callback);
>                        ^~~~~~~~~~~~
> In file included from board/ge/mx53ppd/mx53ppd.c:37:0:
> board/ge/mx53ppd/../../ge/common/vpd_reader.h:19:5: note: expected 'int (*)(struct vpd_cache *, u8,  u8,  u8,  size_t,  const u8 *) {aka int (*)(struct vpd_cache *, unsigned char,  unsigned char,  unsigned char,  unsigned int,  const unsigned char *)}' but argument is of type 'int (*)(void *, u8,  u8,  u8,  size_t,  const u8 *) {aka int (*)(void *, unsigned char,  unsigned char,  unsigned char,  unsigned int,  const unsigned char *)}'
> int read_vpd(struct vpd_cache *cache,
>      ^~~~~~~~
> cc1: all warnings being treated as errors
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  board/ge/mx53ppd/mx53ppd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
> index f0c8abf0bb..23bfe55541 100644
> --- a/board/ge/mx53ppd/mx53ppd.c
> +++ b/board/ge/mx53ppd/mx53ppd.c
> @@ -290,10 +290,10 @@ struct vpd_cache {
>  /*
>   * Extracts MAC and product information from the VPD.
>   */
> -static int vpd_callback(void *userdata, u8 id, u8 version, u8 type, size_t size,
> -			u8 const *data)
> +static int vpd_callback(struct vpd_cache *userdata, u8 id, u8 version,
> +			u8 type, size_t size, u8 const *data)
>  {
> -	struct vpd_cache *vpd = (struct vpd_cache *)userdata;
> +	struct vpd_cache *vpd = userdata;
>  
>  	if (id == VPD_BLOCK_HWID && version == 1 && type != VPD_TYPE_INVALID &&
>  	    size >= 1) {
> 

Thanks for this !

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index f0c8abf0bb..23bfe55541 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -290,10 +290,10 @@  struct vpd_cache {
 /*
  * Extracts MAC and product information from the VPD.
  */
-static int vpd_callback(void *userdata, u8 id, u8 version, u8 type, size_t size,
-			u8 const *data)
+static int vpd_callback(struct vpd_cache *userdata, u8 id, u8 version,
+			u8 type, size_t size, u8 const *data)
 {
-	struct vpd_cache *vpd = (struct vpd_cache *)userdata;
+	struct vpd_cache *vpd = userdata;
 
 	if (id == VPD_BLOCK_HWID && version == 1 && type != VPD_TYPE_INVALID &&
 	    size >= 1) {