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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 2 Dec 2013 14:52:58 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Joonsoo Kim <iamjoonsoo.kim@....com>
Cc:	Mel Gorman <mgorman@...e.de>, Hugh Dickins <hughd@...gle.com>,
	Rik van Riel <riel@...hat.com>,
	Ingo Molnar <mingo@...nel.org>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Hillf Danton <dhillf@...il.com>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Joonsoo Kim <js1304@...il.com>
Subject: Re: [PATCH 4/9] mm/rmap: make rmap_walk to get the
 rmap_walk_control argument

On Thu, 28 Nov 2013 16:48:41 +0900 Joonsoo Kim <iamjoonsoo.kim@....com> wrote:

> In each rmap traverse case, there is some difference so that we need
> function pointers and arguments to them in order to handle these
> difference properly.
> 
> For this purpose, struct rmap_walk_control is introduced in this patch,
> and will be extended in following patch. Introducing and extending are
> separate, because it clarify changes.
> 
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -198,7 +198,12 @@ out:
>   */
>  static void remove_migration_ptes(struct page *old, struct page *new)
>  {
> -	rmap_walk(new, remove_migration_pte, old);
> +	struct rmap_walk_control rwc;
> +
> +	memset(&rwc, 0, sizeof(rwc));
> +	rwc.main = remove_migration_pte;
> +	rwc.arg = old;
> +	rmap_walk(new, &rwc);
>  }

It is much neater to do

	struct rmap_walk_control rwc = {
		.main = remove_migration_pte,
		.arg = old,
	};

which will zero out all remaining fields as well.
--
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