From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756260AbcIUJzB (ORCPT ); Wed, 21 Sep 2016 05:55:01 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754998AbcIUJy5 (ORCPT ); Wed, 21 Sep 2016 05:54:57 -0400 From: Daniel Walter To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, boris.brezillon@free-electrons.com, Richard Weinberger Subject: [PATCH v2 32/46] mtd: nandsim: Remove NS_IS_INITIALIZED Date: Wed, 21 Sep 2016 11:54:53 +0200 Message-Id: <7887f7677742e88e61c84db5b6e29f2eb268b68a.1474450296.git.dwalter@sigma-star.at> X-Mailer: git-send-email 2.8.3 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Weinberger init_nandsim() has exactly one caller, the construction function. So, checking for this condition makes no sense. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 915e3bb..971f7b4 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -185,9 +185,6 @@ MODULE_PARM_DESC(defaults, "Register a MTD during module load using default val #define NS_MDELAY(ns, us) \ do { if (ns->do_delays) mdelay(us); } while (0) -/* Is the nandsim structure initialized ? */ -#define NS_IS_INITIALIZED(ns) ((ns)->geom.totsz != 0) - /* Good operation completion status */ #define NS_STATUS_OK(ns) (NAND_STATUS_READY | (NAND_STATUS_WP * ((ns)->lines.wp == 0))) @@ -839,11 +836,6 @@ static int init_nandsim(struct mtd_info *mtd, struct nandsim_params *nsparam) uint64_t remains; uint64_t next_offset; - if (NS_IS_INITIALIZED(ns)) { - pr_err("init_nandsim: nandsim is already initialized\n"); - return -EIO; - } - /* Force mtd to not do delays */ chip->chip_delay = 0; -- 2.8.3