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, 7 Jul 2008 14:43:07 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Akinobu Mita <akinobu.mita@...il.com>
Cc:	linux-kernel@...r.kernel.org, Pavel Machek <pavel@...e.cz>,
	linux-pm@...ts.linux-foundation.org
Subject: Re: [PATCH 1/2] swsusp: simplify memory_bm_find_bit()

On Saturday, 5 of July 2008, Akinobu Mita wrote:
> The bit obtained by the function memory_bm_find_bit() is represented
> by addr and bit_nr. The callers of memory_bm_find_bit() just use addr
> and bit_nr as the arguments of set_bit/clear_bit/test_bit.
> 
> This patch simplifies the representation of the obtained bit without
> using BM_BITS_PER_CHUNK.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
> Cc: Pavel Machek <pavel@...e.cz>
> Cc: Rafael J. Wysocki <rjw@...k.pl>
> Cc: linux-pm@...ts.linux-foundation.org
> ---
>  kernel/power/snapshot.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: 2.6-git/kernel/power/snapshot.c
> ===================================================================
> --- 2.6-git.orig/kernel/power/snapshot.c
> +++ 2.6-git/kernel/power/snapshot.c
> @@ -478,8 +478,8 @@ static int memory_bm_find_bit(struct mem
>  	}
>  	zone_bm->cur_block = bb;
>  	pfn -= bb->start_pfn;
> -	*bit_nr = pfn % BM_BITS_PER_CHUNK;
> -	*addr = bb->data + pfn / BM_BITS_PER_CHUNK;
> +	*bit_nr = pfn;
> +	*addr = bb->data;
>  	return 0;
>  }

Hm, I think it's better to fold that into patch 2/2.

Thanks,
Rafael
--
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