From patchwork Wed Aug 31 07:28:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Walter X-Patchwork-Id: 664400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sPHHk4R4cz9s9W for ; Wed, 31 Aug 2016 17:36:02 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bf024-0000RL-Mm; Wed, 31 Aug 2016 07:34:00 +0000 Received: from mail.sigma-star.at ([95.130.255.111]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bezyO-0004sj-1m for linux-mtd@lists.infradead.org; Wed, 31 Aug 2016 07:30:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sigma-star.at (Postfix) with ESMTP id D603724E0003; Wed, 31 Aug 2016 09:30:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.sigma-star.at Received: from dw (unknown [82.150.214.13]) by mail.sigma-star.at (Postfix) with ESMTPSA id 4FF3624E001D; Wed, 31 Aug 2016 09:30:01 +0200 (CEST) Received: by dw (sSMTP sendmail emulation); Wed, 31 Aug 2016 09:30:02 +0200 From: Daniel Walter To: linux-mtd@lists.infradead.org Subject: [PATCH 37/46] mtd: nandsim: Turn parts[] into a integer Date: Wed, 31 Aug 2016 09:28:44 +0200 Message-Id: <20160831072853.27822-38-dwalter@sigma-star.at> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160831072853.27822-1-dwalter@sigma-star.at> References: <20160831072853.27822-1-dwalter@sigma-star.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160831_003012_716362_E4E3770A X-CRM114-Status: GOOD ( 13.83 ) X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Richard Weinberger 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 --- 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 0176271..584fc72 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;