* Re: [PATCH] Dead code removal in madvise_willneed
[not found] <CAG6enPx4WLM+q_bNupPewAd3-QoxOPEDNRdeeTEhOEWp3a1NzA@mail.gmail.com>
@ 2014-04-16 20:50 ` Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2014-04-16 20:50 UTC (permalink / raw)
To: Yogesh Gaur; +Cc: torvalds, Tejun Heo, linux-kernel
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-16 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAG6enPx4WLM+q_bNupPewAd3-QoxOPEDNRdeeTEhOEWp3a1NzA@mail.gmail.com>
2014-04-16 20:50 ` [PATCH] Dead code removal in madvise_willneed Andrew Morton
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®