diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2015-10-15 23:24:14 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-25 08:01:29 +0000 |
commit | 60f71fa4da86ca4c7c37115c343db194a3b7b47b (patch) | |
tree | 6765d93a9c8be76ac50c55dd920083f019d78a91 /meta/recipes-extended/mdadm/files | |
parent | e6dc4b2ac0cc6417c0e0ddcdcbe3f334581af8fc (diff) | |
download | openembedded-core-contrib-60f71fa4da86ca4c7c37115c343db194a3b7b47b.tar.gz |
mdadm: fix CFLAGS and ptest issues
* Pass global CFLAGS to build:
The CFLAGS does not pass to build at all since it was redefined by
mdadm Makefile:
CFLAGS = $(CWFLAGS) $(CXFLAGS) ...
This could be done by setting 'CXFLAGS="${CFLAGS}"'.
* Also fix ptest build errors caused by global CFLAGS:
raid6check.c:352:2: error: ignoring return value of posix_memalign, \
declared with attribute warn_unused_result [-Werror=unused-result]
raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \
in this function [-Werror=maybe-uninitialized]
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-extended/mdadm/files')
-rw-r--r-- | meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch new file mode 100644 index 0000000000..f7c55142f6 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch @@ -0,0 +1,50 @@ +From f3acf8499a4cc400206c5c56f0a6c69192ed55de Mon Sep 17 00:00:00 2001 +From: Wenzong Fan <wenzong.fan@windriver.com> +Date: Sat, 7 Nov 2015 04:21:17 -0500 +Subject: [PATCH] mdadm: fix ptest build errors + +Check return value for posix_memalign() to fix ptest build error: + + raid6check.c:352:2: error: ignoring return value of posix_memalign, \ + declared with attribute warn_unused_result [-Werror=unused-result] + +Initialize *stripe_buf as NULL to fix ptest build error: + + raid6check.c: In function 'check_stripes': + raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \ + in this function [-Werror=maybe-uninitialized] + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +--- + raid6check.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/raid6check.c b/raid6check.c +index cb8522e..9462bcf 100644 +--- a/raid6check.c ++++ b/raid6check.c +@@ -312,7 +312,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, + /* read the data and p and q blocks, and check we got them right */ + int data_disks = raid_disks - 2; + int syndrome_disks = data_disks + is_ddf(layout) * 2; +- char *stripe_buf; ++ char *stripe_buf = NULL; + + /* stripes[] is indexed by raid_disk and holds chunks from each device */ + char **stripes = xmalloc(raid_disks * sizeof(char*)); +@@ -349,7 +349,9 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, + if (!tables_ready) + make_tables(); + +- posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size); ++ if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0) ++ goto exitCheck; ++ + block_index_for_slot += 2; + blocks += 2; + blocks_page += 2; +-- +1.9.1 + |