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]
Message-Id: <9b1907c9bfcf080da8412ab6b0aa46c31f17a0e1.1474450296.git.dwalter@sigma-star.at>
Date:   Wed, 21 Sep 2016 11:55:51 +0200
From:   Daniel Walter <dwalter@...ma-star.at>
To:     linux-mtd@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org, computersforpeace@...il.com,
        dwmw2@...radead.org, boris.brezillon@...e-electrons.com,
        Richard Weinberger <richard@....at>
Subject: [PATCH v2 37/46] mtd: nandsim: Turn parts[] into a integer

From: Richard Weinberger <richard@....at>

The parts array denotes how many erase blocks each partition
has. Therefore a plain integer can also do it.
If someone shows me a NAND with more than 2^32 erase blocks we can
turn it back into a long. ;)

Signed-off-by: Richard Weinberger <richard@....at>
---
 drivers/mtd/nand/nandsim.c  | 4 ++--
 include/linux/mtd/nandsim.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index d46eb18..615dde3 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -73,7 +73,7 @@ static uint output_cycle   = NANDSIM_OUTPUT_CYCLE;
 static uint input_cycle    = NANDSIM_INPUT_CYCLE;
 static uint bus_width      = NANDSIM_BUS_WIDTH;
 static uint do_delays      = NANDSIM_DO_DELAYS;
-static unsigned long parts[NANDSIM_MAX_PARTS];
+static unsigned int parts[NANDSIM_MAX_PARTS];
 static unsigned int parts_num;
 static char *badblocks = NULL;
 static char *weakblocks = NULL;
@@ -105,7 +105,7 @@ module_param(output_cycle,   uint, 0400);
 module_param(input_cycle,    uint, 0400);
 module_param(bus_width,      uint, 0400);
 module_param(do_delays,      uint, 0400);
-module_param_array(parts, ulong, &parts_num, 0400);
+module_param_array(parts,    uint, &parts_num, 0400);
 module_param(badblocks,      charp, 0400);
 module_param(weakblocks,     charp, 0400);
 module_param(weakpages,      charp, 0400);
diff --git a/include/linux/mtd/nandsim.h b/include/linux/mtd/nandsim.h
index 85d4d7e..61ff5dd 100644
--- a/include/linux/mtd/nandsim.h
+++ b/include/linux/mtd/nandsim.h
@@ -12,7 +12,7 @@ struct nandsim_params {
 	unsigned int input_cycle;
 	unsigned int bus_width;
 	unsigned int do_delays;
-	unsigned long *parts;
+	unsigned int *parts;
 	unsigned int parts_num;
 	char *badblocks;
 	char *weakblocks;
-- 
2.8.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ