public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH v4 3/4] hugemmap03: code cleanups
       [not found] ` <1328493428-7929-4-git-send-email-gaowanlong@cn.fujitsu.com>
@ 2012-02-06  3:08   ` Caspar Zhang
  0 siblings, 0 replies; only message in thread
From: Caspar Zhang @ 2012-02-06  3:08 UTC (permalink / raw)
  To: Wanlong Gao; +Cc: ltp-list

On 02/06/2012 09:57 AM, Wanlong Gao wrote:
> cleanup the code
> 
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---

[snip]

> +
> +		/*
> +		 * Attempt to mmap using normal pages and
> +		 * a high memory address
> +		 */
>  		addr = mmap(HIGH_ADDR, page_sz, PROT_READ,
>  			    MAP_SHARED | MAP_FIXED, fildes, 0);
>  		if (addr != MAP_FAILED) {
> -			tst_resm(TFAIL, "Normal mmap() into high region unexpectedly succeeded on %s, errno=%d : %s",
> -				 TEMPFILE, errno, strerror(errno));
> +			tst_resm(TFAIL|TERRNO, "Normal mmap() into high region"
> +				 " unexpectedly succeeded on %s, TEMPFILE");
>  			continue;
> -		} else {
> -			tst_resm(TPASS, "Normal mmap() into high region failed correctly");
> +		} else { tst_resm(TPASS, "Normal mmap() into high region" " failed correctly");

Hmmm... several returns are missing here.

>  			break;
>  		}
>  
> @@ -138,24 +120,13 @@ main(int ac, char **av)
>  	tst_exit();
>  }
>  

[snip]

>  
> -/*
> - * cleanup() - performs all ONE TIME cleanup for this test at
> - *             completion or premature exit.
> - * 	       Remove the temporary directory created.
> - */
> -void
> -cleanup()
> +static void cleanup(void)
>  {
>  	/*
>  	 * print timing stats if that option was specified.

And better remove this comment too.

Others look good.

Thanks,
Caspar

> @@ -179,3 +144,8 @@ cleanup()
>  	unlink(TEMPFILE);
>  
>  }
> +
> +static void help(void)
> +{
> +	printf("  -H /..  Location of hugetlbfs, i.e. -H /var/hugetlbfs\n");
> +}


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-06  3:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1328493428-7929-1-git-send-email-gaowanlong@cn.fujitsu.com>
     [not found] ` <1328493428-7929-4-git-send-email-gaowanlong@cn.fujitsu.com>
2012-02-06  3:08   ` [LTP] [PATCH v4 3/4] hugemmap03: code cleanups Caspar Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox