From: Andrew Morton <akpm@linux-foundation.org>
To: Yogesh Gaur <yogeshgaur.83@gmail.com>
Cc: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
Tejun Heo <tj@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Dead code removal in madvise_willneed
Date: Wed, 16 Apr 2014 13:50:37 -0700 [thread overview]
Message-ID: <20140416135037.c7e458897286271aa133555f@linux-foundation.org> (raw)
In-Reply-To: <CAG6enPx4WLM+q_bNupPewAd3-QoxOPEDNRdeeTEhOEWp3a1NzA@mail.gmail.com>
On Wed, 16 Apr 2014 13:16:18 +0530 Yogesh Gaur <yogeshgaur.83@gmail.com> wrote:
> Dead code removal in func madvise_willneed().
> When file is NULL i.e. !file true
> case CONFIG_SWAP returns 0.
> else returns -EBADF.
> Signed-off-by: Yogesh Gaur <yogeshgaur.83@gmail.com>
> ---
> mm/madvise.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 7055883..be24987 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -231,10 +231,10 @@ static long madvise_willneed(struct vm_area_struct * vma,
> file->f_mapping);
> return 0;
> }
> -#endif
> -
> +#else
> if (!file)
> return -EBADF;
> +#endif
The compiler should have no trouble making this optimisation for us. I
don't see that it is necessary to add more ugly-looking ifdefs for
this.
parent reply other threads:[~2014-04-16 20:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAG6enPx4WLM+q_bNupPewAd3-QoxOPEDNRdeeTEhOEWp3a1NzA@mail.gmail.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=20140416135037.c7e458897286271aa133555f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yogeshgaur.83@gmail.com \
/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
all inboxes | Powered by JetHome®