summaryrefslogtreecommitdiffstats
path: root/arch/x86/power
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-01-27 08:06:21 -0500
committerIngo Molnar <mingo@kernel.org>2017-01-28 03:33:16 -0500
commitbf495573fae84451a8a26215fafb5b62e387ddaf (patch)
tree9f2d93573aa1cd09de4d15e3aa6d8b308117608d /arch/x86/power
parent61a50101638254d38e3f4281265b44de0f2cba4e (diff)
x86/boot/e820: Harmonize the 'struct e820_table' fields
So the e820_table->map and e820_table->nr_map names are a bit confusing, because it's not clear what a 'map' really means (it could be a bitmap, or some other data structure), nor is it clear what nr_map means (is it a current index, or some other count). Rename the fields from: e820_table->map => e820_table->entries e820_table->nr_map => e820_table->nr_entries which makes it abundantly clear that these are entries of the table, and that the size of the table is ->nr_entries. Propagate the changes to all affected files. Where necessary, adjust local variable names to better reflect the new field names. No change in functionality. Cc: Alex Thorlton <athorlton@sgi.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Huang, Ying <ying.huang@intel.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Jackson <pj@sgi.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@sisk.pl> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wei Yang <richard.weiyang@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/power')
-rw-r--r--arch/x86/power/hibernate_64.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index 8fe5be0e90b2..1bfda425879c 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -196,12 +196,12 @@ struct restore_data_record {
196 196
197#if IS_BUILTIN(CONFIG_CRYPTO_MD5) 197#if IS_BUILTIN(CONFIG_CRYPTO_MD5)
198/** 198/**
199 * get_e820_md5 - calculate md5 according to given e820 map 199 * get_e820_md5 - calculate md5 according to given e820 table
200 * 200 *
201 * @map: the e820 map to be calculated 201 * @table: the e820 table to be calculated
202 * @buf: the md5 result to be stored to 202 * @buf: the md5 result to be stored to
203 */ 203 */
204static int get_e820_md5(struct e820_table *map, void *buf) 204static int get_e820_md5(struct e820_table *table, void *buf)
205{ 205{
206 struct scatterlist sg; 206 struct scatterlist sg;
207 struct crypto_ahash *tfm; 207 struct crypto_ahash *tfm;
@@ -214,10 +214,9 @@ static int get_e820_md5(struct e820_table *map, void *buf)
214 214
215 { 215 {
216 AHASH_REQUEST_ON_STACK(req, tfm); 216 AHASH_REQUEST_ON_STACK(req, tfm);
217 size = offsetof(struct e820_table, map) 217 size = offsetof(struct e820_table, entries) + sizeof(struct e820_entry) * table->nr_entries;
218 + sizeof(struct e820_entry) * map->nr_map;
219 ahash_request_set_tfm(req, tfm); 218 ahash_request_set_tfm(req, tfm);
220 sg_init_one(&sg, (u8 *)map, size); 219 sg_init_one(&sg, (u8 *)table, size);
221 ahash_request_set_callback(req, 0, NULL, NULL); 220 ahash_request_set_callback(req, 0, NULL, NULL);
222 ahash_request_set_crypt(req, &sg, buf, size); 221 ahash_request_set_crypt(req, &sg, buf, size);
223 222