public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 1/2] syscalls/getitimer: cleanup
Date: Wed, 24 Apr 2013 11:36:32 +0200	[thread overview]
Message-ID: <20130424093631.GB5674@rei> (raw)
In-Reply-To: <51778C84.1050500@cn.fujitsu.com>

Hi!
> >  	for (lc = 0; TEST_LOOPING(lc); lc++) {
> > -		/* reset tst_count in case we are looping */
> >  		tst_count = 0;
> > 
> >  		/* allocate space for the itimerval structure */
> > -
> > -		if ((value = (struct itimerval *)malloc((size_t)
> > -							sizeof(struct
> > -							       itimerval))) ==
> > -		    NULL) {
> > +		value = (struct itimerval *)malloc(
> > +					(size_t)sizeof(struct itimerval));
> 
> The type cast here is not necessary, right?

The itimerval structure is about 32 bytes long. I would just declare it 
on the stack and pass &value to the call.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2013-04-24  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24  7:14 [LTP] [PATCH 1/2] syscalls/getitimer: cleanup DAN LI
2013-04-24  7:19 ` [LTP] [PATCH 2/2] syscalls/getitimer01.c: Test for getting ITIMER_VIRTUAL and ITIMER_PROF DAN LI
2013-04-24  7:40 ` [LTP] [PATCH 1/2] syscalls/getitimer: cleanup Wanlong Gao
2013-04-24  9:36   ` chrubis [this message]

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=20130424093631.GB5674@rei \
    --to=chrubis@suse.cz \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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