From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: zhouwj-fnst@cn.fujitsu.com
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v2 2/5] Add tools for reading and writing from splitblock table
Date: Tue, 28 Oct 2014 15:42:41 +0900 (JST) [thread overview]
Message-ID: <20141028.154241.113095525.d.hatayama@jp.fujitsu.com> (raw)
In-Reply-To: <1413192866-28140-3-git-send-email-zhouwj-fnst@cn.fujitsu.com>
From: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>
Subject: [PATCH v2 2/5] Add tools for reading and writing from splitblock table
Date: Mon, 13 Oct 2014 17:34:23 +0800
> The function added in this patch, is used for writing and reading value
> from the char array in struct SplitBlock.
>
> Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
> Signed-off-by: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>
> ---
> makedumpfile.c | 23 +++++++++++++++++++++++
> 1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 95d553c..a8d86f6 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -5708,6 +5708,29 @@ calculate_entry_size(void){
> return entry_size;
> }
>
> +void
> +write_value_into_splitblock_table(char *splitblock_inner, unsigned long long content)
This line exceeds 80 characters. The cause would be the name of
function arguments are too long.
How about this?
void
write_value_into_splitblock_table(char *entry, unsigned long long value)
> +{
> + char temp;
> + int i=0;
Please add linebreak.
Please add spaces between assignment operator.
int i = 0;
> + while (i++ < splitblock->entry_size) {
> + temp = content & 0xff;
> + content = content >> BITPERBYTE;
> + *splitblock_inner++ = temp;
Please write increment operator in a separate line.
*splitblock_inner = temp;
*splitblock_inner++;
> + }
> +}
> +unsigned long long
> +read_value_from_splitblock_table(char *splitblock_inner)
> +{
> + unsigned long long ret = 0;
How about value instead of ret? In addition to the above comment, this
also leads to contrasting consistency between the two helper
functions.
> + int i;
Please add a linebreak.
> + for (i = splitblock->entry_size; i > 0; i--) {
> + ret = ret << BITPERBYTE;
> + ret += *(splitblock_inner + i - 1) & 0xff;
The & 0xff is necessary? because splitblock_inner is of type char *.
> + }
> + return ret;
> +}
> +
> mdf_pfn_t
> get_num_dumpable(void)
> {
> --
> 1.7.1
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
--
Thanks.
HATAYAMA, Daisuke
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-10-28 6:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-13 9:34 [PATCH v2 0/5] makedumpfile: --split: assign fair I/O workloads in appropriate time Zhou Wenjian
2014-10-13 9:34 ` [PATCH v2 1/5] Add support for splitblock Zhou Wenjian
2014-10-28 6:30 ` HATAYAMA Daisuke
2014-10-13 9:34 ` [PATCH v2 2/5] Add tools for reading and writing from splitblock table Zhou Wenjian
2014-10-28 6:42 ` HATAYAMA Daisuke [this message]
2014-10-13 9:34 ` [PATCH v2 3/5] Add module of generating table Zhou Wenjian
2014-10-28 7:01 ` HATAYAMA Daisuke
2014-10-13 9:34 ` [PATCH v2 4/5] Add module of calculating start_pfn and end_pfn in each dumpfile Zhou Wenjian
2014-10-28 7:43 ` HATAYAMA Daisuke
2014-10-13 9:34 ` [PATCH v2 5/5] Add support for --splitblock-size Zhou Wenjian
2014-10-28 7:15 ` HATAYAMA Daisuke
2014-10-28 7:28 ` Atsushi Kumagai
2014-10-17 3:50 ` [PATCH v2 0/5] makedumpfile: --split: assign fair I/O workloads in appropriate time Atsushi Kumagai
2014-10-22 1:52 ` "Zhou, Wenjian/周文剑"
2014-10-27 1:08 ` "Zhou, Wenjian/周文剑"
2014-10-27 7:51 ` Atsushi Kumagai
2014-10-28 6:24 ` HATAYAMA Daisuke
2014-10-28 6:32 ` qiaonuohan
2014-10-30 0:21 ` HATAYAMA Daisuke
2014-11-05 4:18 ` Atsushi Kumagai
2014-10-27 6:19 ` "Zhou, Wenjian/周文剑"
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=20141028.154241.113095525.d.hatayama@jp.fujitsu.com \
--to=d.hatayama@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=zhouwj-fnst@cn.fujitsu.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