From: Simon Horman <horms@verge.net.au>
To: Zhang Yanfei <zhangyanfei.yes@gmail.com>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: Re: [PATCH 10/13] kexec: ppc64: use _ALIGN* to make the logic clear
Date: Thu, 14 Mar 2013 10:23:46 +0100 [thread overview]
Message-ID: <20130314092345.GM11196@verge.net.au> (raw)
In-Reply-To: <5140B853.2050906@gmail.com>
On Thu, Mar 14, 2013 at 01:33:07AM +0800, Zhang Yanfei wrote:
> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>
> By replacing all the explicit align opertion with marco _ALIGN*,
> the code logic could be more clear.
This appears to break the ppc64 build.
powerpc64-unknown-linux-gnu-gcc -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I/home/horms/local/opt/crosstool/powerpc-970/gcc-4.1.1-glibc-2.3.6/powerpc64-unknown-linux-gnu/include -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/ppc64/include -c -MD -o kexec/arch/ppc64/fs2dt.o kexec/arch/ppc64/fs2dt.c
kexec/arch/ppc64/fs2dt.c: In function 'putnode':
kexec/arch/ppc64/fs2dt.c:492: warning: passing argument 4 of 'scandir' from
incompatible pointer type
kexec/arch/ppc64/fs2dt.c:738:1: error: unterminated argument list invoking
macro "_ALIGN"
kexec/arch/ppc64/fs2dt.c: In function 'create_flatten_tree':
kexec/arch/ppc64/fs2dt.c:701: error: '_ALIGN' undeclared (first use in this
function)
kexec/arch/ppc64/fs2dt.c:701: error: (Each undeclared identifier is
reported only once
kexec/arch/ppc64/fs2dt.c:701: error: for each function it appears in.)
kexec/arch/ppc64/fs2dt.c:701: error: expected ';' at end of input
kexec/arch/ppc64/fs2dt.c:676: warning: unused variable 'buf'
kexec/arch/ppc64/fs2dt.c:675: warning: unused variable 'tlen'
kexec/arch/ppc64/fs2dt.c:672: warning: unused parameter 'bufp'
kexec/arch/ppc64/fs2dt.c:672: warning: unused parameter 'sizep'
kexec/arch/ppc64/fs2dt.c:701: warning: control reaches end of non-void function
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> ---
> kexec/arch/ppc64/crashdump-ppc64.c | 4 ++--
> kexec/arch/ppc64/fs2dt.c | 6 ++----
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
> index b8a63bd..49cab12 100644
> --- a/kexec/arch/ppc64/crashdump-ppc64.c
> +++ b/kexec/arch/ppc64/crashdump-ppc64.c
> @@ -298,7 +298,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
> * to the next page size boundary though, so makedumpfile can
> * read it safely without going south on us.
> */
> - cend = (cend + page_size - 1) & (~(page_size - 1));
> + cend = _ALIGN(cend, page_size);
>
> crash_memory_range[memory_ranges].start = cstart;
> crash_memory_range[memory_ranges++].end = cend;
> @@ -400,7 +400,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
> info->backup_src_start = BACKUP_SRC_START;
> info->backup_src_size = BACKUP_SRC_SIZE;
> /* Create a backup region segment to store backup data*/
> - sz = (BACKUP_SRC_SIZE + align - 1) & ~(align - 1);
> + sz = _ALIGN(BACKUP_SRC_SIZE, align);
> tmp = xmalloc(sz);
> memset(tmp, 0, sz);
> info->backup_start = add_buffer(info, tmp, sz, sz, align,
> diff --git a/kexec/arch/ppc64/fs2dt.c b/kexec/arch/ppc64/fs2dt.c
> index 9750c34..62edc93 100644
> --- a/kexec/arch/ppc64/fs2dt.c
> +++ b/kexec/arch/ppc64/fs2dt.c
> @@ -698,8 +698,7 @@ int create_flatten_tree(char **bufp, off_t *sizep, char *cmdline)
> dt_reserve(&dt, 1);
> *dt++ = 9;
>
> - len = sizeof(bb[0]);
> - len += 7; len &= ~7;
> + len = _ALIGN(sizeof(bb[0], 8);
>
> bb->off_mem_rsvmap = len;
>
> @@ -714,8 +713,7 @@ int create_flatten_tree(char **bufp, off_t *sizep, char *cmdline)
> len *= sizeof(unsigned);
> bb->off_dt_strings = bb->off_dt_struct + len;
>
> - len = propnum("");
> - len += 3; len &= ~3;
> + len = _ALIGN(propnum(""), 4);
> bb->totalsize = bb->off_dt_strings + len;
>
> bb->magic = 0xd00dfeed;
> --
> 1.7.1
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-03-14 9:23 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 17:19 [PATCH 01/13] kexec: add _ALIGN* marcos for align operation Zhang Yanfei
2013-03-13 17:21 ` [PATCH 02/13] kexec: use _ALIGN() instead of align() Zhang Yanfei
2013-03-14 9:48 ` Simon Horman
2013-03-13 17:23 ` [PATCH 03/13] kexec: ppc: remove duplicated _ALIGN_* macros Zhang Yanfei
2013-03-14 9:48 ` Simon Horman
2013-03-13 17:26 ` [PATCH 04/13] kexec: use _ALIGN* to make the logic clear Zhang Yanfei
2013-03-14 9:08 ` Simon Horman
2013-03-14 9:48 ` Zhang Yanfei
2013-03-14 10:06 ` Simon Horman
2013-03-14 9:49 ` Simon Horman
2013-03-14 9:58 ` Simon Horman
2013-03-14 11:24 ` [PATCH v2 " Zhang Yanfei
2013-03-14 11:26 ` [PATCH " Zhang Yanfei
2013-03-15 8:35 ` Simon Horman
2013-03-15 9:46 ` [PATCH v3 " Zhang Yanfei
2013-03-15 15:52 ` Simon Horman
2013-03-13 17:28 ` [PATCH 05/13] kexec: i386: " Zhang Yanfei
2013-03-14 9:50 ` Simon Horman
2013-03-13 17:29 ` [PATCH 06/13] kexec: arm: " Zhang Yanfei
2013-03-14 9:50 ` Simon Horman
2013-03-13 17:30 ` [PATCH 07/13] kexec: ia64: " Zhang Yanfei
2013-03-14 9:50 ` Simon Horman
2013-03-13 17:31 ` [PATCH 08/13] kexec: mips: " Zhang Yanfei
2013-03-14 9:51 ` Simon Horman
2013-03-13 17:32 ` [PATCH 09/13] kexec: ppc: " Zhang Yanfei
2013-03-14 9:09 ` Simon Horman
2013-03-14 9:32 ` Zhang Yanfei
2013-03-14 9:33 ` [PATCH v2 " Zhang Yanfei
2013-03-14 9:54 ` Simon Horman
2013-03-14 9:57 ` Simon Horman
2013-03-14 10:01 ` Simon Horman
2013-03-13 17:33 ` [PATCH 10/13] kexec: ppc64: " Zhang Yanfei
2013-03-14 9:23 ` Simon Horman [this message]
2013-03-14 9:38 ` [PATCH v2 " Zhang Yanfei
2013-03-14 10:04 ` Simon Horman
2013-03-13 17:33 ` [PATCH 11/13] kexec: s390: remove ALIGN_UP and use _ALIGN_UP Zhang Yanfei
2013-03-14 10:02 ` Simon Horman
2013-03-13 17:34 ` [PATCH 12/13] kexec: sh: use _ALIGN* to make the logic clear Zhang Yanfei
2013-03-14 10:03 ` Simon Horman
2013-03-13 17:35 ` [PATCH 13/13] kexec: x86_64: " Zhang Yanfei
2013-03-14 10:03 ` Simon Horman
2013-03-14 9:47 ` [PATCH 01/13] kexec: add _ALIGN* marcos for align operation Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130314092345.GM11196@verge.net.au \
--to=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
--cc=zhangyanfei.yes@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox