From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] hugeshmctl01: Fix reset stat_time when looping with -i n
Date: Fri, 6 Mar 2020 11:29:50 +0800 [thread overview]
Message-ID: <5E61C3AE.402@cn.fujitsu.com> (raw)
In-Reply-To: <cd067b8a-224d-993f-8668-e8f7b70f59bc@cn.fujitsu.com>
On 2020/3/6 9:53, Yang Xu wrote:
>> static void test_hugeshmctl(unsigned int i)
>> {
>> + stat_time = FIRST;
>> +
> My description may confuse you. stat_time should not be reseted every
> time, it only needs to be reseted when next loop. This value will be +1
> when call stat_cleanup.
> struct tcase {
> int cmd;
> void (*func_test) (void);
> void (*func_setup) (void);
> } tcases[] = {
> {IPC_STAT, func_stat, stat_setup}, //stat_time = FIRST
> {IPC_STAT, func_stat, stat_setup}, //stat_time = SECOND
>
> As you do, the first and second case are same. it should be added into
> the "if == 0".
>
> ps: I personally think old case is more cleaner. Let's hear from others.
>
Hi Petr, Xu
For xu's comment, we can assign 'i' to stat_time and remove
"stat_time++;" directly:
----------------------------------------
static void test_hugeshmctl(unsigned int i)
{
+ stat_time = i;
+
...
- stat_time++;
----------------------------------------
Thanks,
Xiao Yang
next prev parent reply other threads:[~2020-03-06 3:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 17:18 [LTP] [PATCH 1/1] hugeshmctl01: Fix reset stat_time when looping with -i n Petr Vorel
2020-03-06 1:53 ` Yang Xu
2020-03-06 3:29 ` Xiao Yang [this message]
2020-03-06 5:43 ` Li Wang
2020-03-06 6:12 ` Yang Xu
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=5E61C3AE.402@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.