From: Cyril Hrubis <chrubis@suse.cz>
To: "Wei,Jiangang" <weijg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] testcases/kernel/syscalls: make use of ARRAY_SIZE
Date: Wed, 20 May 2015 15:36:31 +0200 [thread overview]
Message-ID: <20150520133631.GA9052@rei.suse.de> (raw)
In-Reply-To: <1432024368-23287-1-git-send-email-weijg.fnst@cn.fujitsu.com>
Hi!
> --- a/testcases/kernel/syscalls/sysctl/sysctl01.c
> +++ b/testcases/kernel/syscalls/sysctl/sysctl01.c
> @@ -66,8 +66,6 @@ static int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
> return syscall(__NR__sysctl, &args);
> }
>
> -#define SIZE(x) sizeof(x)/sizeof(x[0])
> -
> struct utsname buf;
> char osname[BUFSIZ];
> size_t osnamelth;
> @@ -115,7 +113,7 @@ int main(int ac, char **av)
>
> for (i = 0; i < TST_TOTAL; ++i) {
>
> - osnamelth = SIZE(osname);
> + osnamelth = ARRAY_SIZE(osname);
These could be turned into simple sizeof(osname) as sizeof(char) == 1 by
definition.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-05-20 13:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 8:32 [LTP] [PATCH 1/2] testcases/kernel/syscalls: make use of ARRAY_SIZE Wei,Jiangang
2015-05-19 8:32 ` [LTP] [PATCH 2/2] kernel/controllers/cpuctl: cleanup Wei,Jiangang
2015-05-20 13:38 ` Cyril Hrubis
2015-05-20 13:36 ` Cyril Hrubis [this message]
2015-05-21 2:14 ` [LTP] [PATCH v2 1/2] testcases/kernel/syscalls: make use of ARRAY_SIZE Wei,Jiangang
2015-05-21 2:14 ` [LTP] [PATCH v2 2/2] kernel/controllers/cpuctl: cleanup Wei,Jiangang
2015-05-27 12:26 ` Cyril Hrubis
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=20150520133631.GA9052@rei.suse.de \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=weijg.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