Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UUw6z-0004hP-Su for ltp-list@lists.sourceforge.net; Wed, 24 Apr 2013 09:35:37 +0000 Date: Wed, 24 Apr 2013 11:36:32 +0200 From: chrubis@suse.cz Message-ID: <20130424093631.GB5674@rei> References: <5177866B.8040606@cn.fujitsu.com> <51778C84.1050500@cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <51778C84.1050500@cn.fujitsu.com> Subject: Re: [LTP] [PATCH 1/2] syscalls/getitimer: cleanup List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Wanlong Gao Cc: LTP list 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