Patchwork [meta-fsl-ppc,1/2] hypervisor: fix sizeof-pointer-memaccess error

login
register
mail settings
Submitter Ting Liu
Date July 10, 2013, 3:45 a.m.
Message ID <1373427901-17397-1-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/53419/
State Accepted
Delegated to: Zhenhua Luo
Headers show

Comments

Ting Liu - July 10, 2013, 3:45 a.m.
From: Ting Liu <b28495@freescale.com>

Fix the below build error:
| build: src/livetree.c
| .../hypervisor/git-r3/git/src/devtree.c: In function 'read_intmap':
| .../hypervisor/git-r3/git/src/devtree.c:1513:25: error: argument to
| 'sizeof' in 'memset' call is the same expression as the destination;
| did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
|        memset(ent, 0, sizeof(ent));
|                             ^
|  cc1: all warnings being treated as errors
|  build: src/ipi_doorbell.c
|  make[1]: *** [bin/devtree.o] Error 1
|  make[1]: *** Waiting for unfinished jobs....
|  make[1]: Leaving directory `.../hypervisor/git-r3/git/output'
|  make: *** [all] Error 2
|  ERROR: oe_runmake failed

Signed-off-by: Ting Liu <b28495@freescale.com>
---
 .../0001-fix-sizeof-pointer-memaccess-error.patch  |   39 ++++++++++++++++++++
 .../hypervisor/hypervisor_git.bb                   |    1 +
 2 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-memaccess-error.patch
Zhenhua Luo - July 11, 2013, 8:49 a.m.
Applied, thanks. 


Best Regards,

Zhenhua


> -----Original Message-----
> From: Liu Ting-B28495
> Sent: Wednesday, July 10, 2013 11:45 AM
> To: meta-freescale@yoctoproject.org
> Cc: Luo Zhenhua-B19537; Liu Ting-B28495
> Subject: [meta-fsl-ppc][PATCH 1/2] hypervisor: fix sizeof-pointer-
> memaccess error
> 
> From: Ting Liu <b28495@freescale.com>
> 
> Fix the below build error:
> | build: src/livetree.c
> | .../hypervisor/git-r3/git/src/devtree.c: In function 'read_intmap':
> | .../hypervisor/git-r3/git/src/devtree.c:1513:25: error: argument to
> | 'sizeof' in 'memset' call is the same expression as the destination;
> | did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
> |        memset(ent, 0, sizeof(ent));
> |                             ^
> |  cc1: all warnings being treated as errors
> |  build: src/ipi_doorbell.c
> |  make[1]: *** [bin/devtree.o] Error 1
> |  make[1]: *** Waiting for unfinished jobs....
> |  make[1]: Leaving directory `.../hypervisor/git-r3/git/output'
> |  make: *** [all] Error 2
> |  ERROR: oe_runmake failed
> 
> Signed-off-by: Ting Liu <b28495@freescale.com>
> ---
>  .../0001-fix-sizeof-pointer-memaccess-error.patch  |   39
> ++++++++++++++++++++
>  .../hypervisor/hypervisor_git.bb                   |    1 +
>  2 files changed, 40 insertions(+), 0 deletions(-)  create mode 100644
> recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-
> memaccess-error.patch
> 
> diff --git a/recipes-virtualization/hypervisor/files/0001-fix-sizeof-
> pointer-memaccess-error.patch b/recipes-
> virtualization/hypervisor/files/0001-fix-sizeof-pointer-memaccess-
> error.patch
> new file mode 100644
> index 0000000..a562273
> --- /dev/null
> +++ b/recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-me
> +++ maccess-error.patch
> @@ -0,0 +1,39 @@
> +From 59e68351114a65a1f315ded1ee92f4370b8547e2 Mon Sep 17 00:00:00 2001
> +From: Ting Liu <b28495@freescale.com>
> +Date: Mon, 8 Jul 2013 17:03:43 +0800
> +Subject: [PATCH] fix sizeof-pointer-memaccess error
> +
> +build: src/livetree.c
> +.../hypervisor/git-r3/git/src/devtree.c: In function 'read_intmap':
> +.../hypervisor/git-r3/git/src/devtree.c:1513:25: error: argument to
> 'sizeof' in 'memset' call is the same expression as the destination; did
> you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
> +    memset(ent, 0, sizeof(ent));
> +                         ^
> +cc1: all warnings being treated as errors
> +build: src/ipi_doorbell.c
> +make[1]: *** [bin/devtree.o] Error 1
> +make[1]: *** Waiting for unfinished jobs....
> +make[1]: Leaving directory `.../hypervisor/git-r3/git/output'
> +make: *** [all] Error 2
> +ERROR: oe_runmake failed
> +
> +Signed-off-by: Ting Liu <b28495@freescale.com>
> +---
> + src/devtree.c |    2 +-
> + 1 files changed, 1 insertions(+), 1 deletions(-)
> +
> +diff --git a/src/devtree.c b/src/devtree.c index f3710e4..3295e20
> +100644
> +--- a/src/devtree.c
> ++++ b/src/devtree.c
> +@@ -1510,7 +1510,7 @@ static void read_intmap(dt_node_t *node)
> + 		}
> +
> + 		if (imap + ent->parent_naddr + ent->parent_nint > imap_end) {
> +-			memset(ent, 0, sizeof(ent));
> ++			memset(ent, 0, sizeof(intmap_entry_t));
> + 			break;
> + 		}
> +
> +--
> +1.7.5.4
> +
> diff --git a/recipes-virtualization/hypervisor/hypervisor_git.bb
> b/recipes-virtualization/hypervisor/hypervisor_git.bb
> index dc86406..ff89bfa 100644
> --- a/recipes-virtualization/hypervisor/hypervisor_git.bb
> +++ b/recipes-virtualization/hypervisor/hypervisor_git.bb
> @@ -18,6 +18,7 @@ SRC_URI = " \
> 
> 	git://git.freescale.com/ppc/sdk/hypervisor/libos.git;name=libos;des
> tsuffix=git/libos \
>  	git://www.jdl.com/software/dtc.git;name=dtc;destsuffix=dtc \
> 
> 	git://git.freescale.com/ppc/sdk/hypertrk.git;name=hypertrk;destsuff
> ix=git/hypertrk \
> +	file://0001-fix-sizeof-pointer-memaccess-error.patch \
>  	file://81-fsl-embedded-hv.rules \
>  	  "
> 
> --
> 1.7.3.4

Patch

diff --git a/recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-memaccess-error.patch b/recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-memaccess-error.patch
new file mode 100644
index 0000000..a562273
--- /dev/null
+++ b/recipes-virtualization/hypervisor/files/0001-fix-sizeof-pointer-memaccess-error.patch
@@ -0,0 +1,39 @@ 
+From 59e68351114a65a1f315ded1ee92f4370b8547e2 Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Mon, 8 Jul 2013 17:03:43 +0800
+Subject: [PATCH] fix sizeof-pointer-memaccess error
+
+build: src/livetree.c
+.../hypervisor/git-r3/git/src/devtree.c: In function 'read_intmap':
+.../hypervisor/git-r3/git/src/devtree.c:1513:25: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
+    memset(ent, 0, sizeof(ent));
+                         ^
+cc1: all warnings being treated as errors
+build: src/ipi_doorbell.c
+make[1]: *** [bin/devtree.o] Error 1
+make[1]: *** Waiting for unfinished jobs....
+make[1]: Leaving directory `.../hypervisor/git-r3/git/output'
+make: *** [all] Error 2
+ERROR: oe_runmake failed
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ src/devtree.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/devtree.c b/src/devtree.c
+index f3710e4..3295e20 100644
+--- a/src/devtree.c
++++ b/src/devtree.c
+@@ -1510,7 +1510,7 @@ static void read_intmap(dt_node_t *node)
+ 		}
+ 
+ 		if (imap + ent->parent_naddr + ent->parent_nint > imap_end) {
+-			memset(ent, 0, sizeof(ent));
++			memset(ent, 0, sizeof(intmap_entry_t));
+ 			break;
+ 		}
+ 
+-- 
+1.7.5.4
+
diff --git a/recipes-virtualization/hypervisor/hypervisor_git.bb b/recipes-virtualization/hypervisor/hypervisor_git.bb
index dc86406..ff89bfa 100644
--- a/recipes-virtualization/hypervisor/hypervisor_git.bb
+++ b/recipes-virtualization/hypervisor/hypervisor_git.bb
@@ -18,6 +18,7 @@  SRC_URI = " \
 	git://git.freescale.com/ppc/sdk/hypervisor/libos.git;name=libos;destsuffix=git/libos \
 	git://www.jdl.com/software/dtc.git;name=dtc;destsuffix=dtc \
 	git://git.freescale.com/ppc/sdk/hypertrk.git;name=hypertrk;destsuffix=git/hypertrk \
+	file://0001-fix-sizeof-pointer-memaccess-error.patch \
 	file://81-fsl-embedded-hv.rules \
 	  "