linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kirill Shutemov <kirill.shutemov@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 4/6] tools/gup_benchmark: Allow user specified file
Date: Wed, 10 Oct 2018 16:42:42 -0600	[thread overview]
Message-ID: <20181010224242.GC11034@localhost.localdomain> (raw)
In-Reply-To: <20181010153101.4f5dcf6dcc01e71934eeb1ba@linux-foundation.org>

On Wed, Oct 10, 2018 at 03:31:01PM -0700, Andrew Morton wrote:
> On Wed, 10 Oct 2018 13:56:03 -0600 Keith Busch <keith.busch@intel.com> wrote:
> > +	filed = open(file, O_RDWR|O_CREAT);
> > +	if (filed < 0)
> > +		perror("open"), exit(filed);
> 
> Ick.  Like this, please:

Yeah, I agree. I just copied the style this file had been using in other
error cases, but I still find it less readable than your recommendation. 
 
> --- a/tools/testing/selftests/vm/gup_benchmark.c~tools-gup_benchmark-allow-user-specified-file-fix
> +++ a/tools/testing/selftests/vm/gup_benchmark.c
> @@ -71,8 +71,10 @@ int main(int argc, char **argv)
>  	}
>  
>  	filed = open(file, O_RDWR|O_CREAT);
> -	if (filed < 0)
> -		perror("open"), exit(filed);
> +	if (filed < 0) {
> +		perror("open");
> +		exit(filed);
> +	}
>  
>  	gup.nr_pages_per_call = nr_pages;
>  	gup.flags = write;
> 

  reply	other threads:[~2018-10-10 22:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 19:56 [PATCH 1/6] mm/gup_benchmark: Time put_page Keith Busch
2018-10-10 19:56 ` [PATCH 2/6] mm/gup_benchmark: Add additional pinning methods Keith Busch
2018-10-10 19:56 ` [PATCH 3/6] tools/gup_benchmark: Fix 'write' flag usage Keith Busch
2018-10-10 19:56 ` [PATCH 4/6] tools/gup_benchmark: Allow user specified file Keith Busch
2018-10-10 22:31   ` Andrew Morton
2018-10-10 22:42     ` Keith Busch [this message]
2018-10-10 19:56 ` [PATCH 5/6] tools/gup_benchmark: Add MAP_SHARED option Keith Busch
2018-10-10 19:56 ` [PATCH 6/6] tools/gup_benchmark: Add MAP_HUGETLB option Keith Busch
2018-10-10 22:26 ` [PATCH 1/6] mm/gup_benchmark: Time put_page Andrew Morton
2018-10-10 22:28   ` Keith Busch
2018-10-10 22:41     ` Andrew Morton
2018-10-10 22:40       ` Keith Busch

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=20181010224242.GC11034@localhost.localdomain \
    --to=keith.busch@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).