All of lore.kernel.org
 help / color / mirror / Atom feed
From: Caspar Zhang <caspar@casparzhang.com>
To: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v4 3/4] hugemmap03: code cleanups
Date: Mon, 06 Feb 2012 11:08:52 +0800	[thread overview]
Message-ID: <4F2F4444.6040105@casparzhang.com> (raw)
In-Reply-To: <1328493428-7929-4-git-send-email-gaowanlong@cn.fujitsu.com>

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

           reply	other threads:[~2012-02-06  3:09 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1328493428-7929-4-git-send-email-gaowanlong@cn.fujitsu.com>]

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=4F2F4444.6040105@casparzhang.com \
    --to=caspar@casparzhang.com \
    --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 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.