lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20140416135037.c7e458897286271aa133555f@linux-foundation.org>
Date:	Wed, 16 Apr 2014 13:50:37 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Yogesh Gaur <yogeshgaur.83@...il.com>
Cc:	"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
	Tejun Heo <tj@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Dead code removal in madvise_willneed

On Wed, 16 Apr 2014 13:16:18 +0530 Yogesh Gaur <yogeshgaur.83@...il.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@...il.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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ