From patchwork Sat Aug 7 21:45:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 1514720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=N818teRX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mess.org header.i=@mess.org header.a=rsa-sha256 header.s=2020 header.b=DB4O54Ui; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Ghwsx3NT4z9sWX for ; Sun, 8 Aug 2021 07:47:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Dlcr1VgDz84rviok3grFkAmWXkhZZ0lSgcDg1DzlL1Y=; b=N818teRXBQAUcj LM1zJFi/0Tc1Vc/eG/pBm5LNRQFsX79CD4v9XirQjhGTkv+JSVuz341zSvF4UdRi3S+psC0HGbGma hh9jULYlVSgIR0s4FkxlC8kFcthNSfPW9za9iqGZyFufHGdahbay81NB2NsuFr6t64rRHL2PTEqM1 G4SHGkKmKQLimzhHETMRpnbpJpQpkqdZjOCHlANSJL02VqHdri242J8OOlqh33h/6DYWzjQs+ONTN vQaHd+OWGiHFsfTuFNv1cNwEjr5aRkg/nhoU+vwgfW/POAl6sRmPpEG9JF3jbAg0M3lubbEBRouCw bntPWRH4222eSl09tkAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCU9D-00FBVL-2Z; Sat, 07 Aug 2021 21:46:27 +0000 Received: from gofer.mess.org ([2a02:8011:d000:212::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCU8U-00FBL5-M2 for linux-mtd@lists.infradead.org; Sat, 07 Aug 2021 21:45:45 +0000 Received: by gofer.mess.org (Postfix, from userid 1000) id 1E3E0C63FF; Sat, 7 Aug 2021 22:45:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mess.org; s=2020; t=1628372739; bh=Q8THvPbEc24FArMnsWwOWU9i3rfZl3y5bXxUnpIBVCQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DB4O54UibpsAUqbMsDeLJONXrwv5m6L+5jmfWyCTc0RNHiQYaxj4v+PZAOB4KwA+8 OQuyBBajCmXdoyuI6yHR809emfsDt49baGzOyyYumVHg4IzZxQB5EP5hMNUDRmk7QB sm0NRjiPSQJPKUJ7+/B3ni+61f+6sBl1AGi+G/2h8i20vrFK3dzMUIfTc54pH9qOUw ml1MrRbQ3qpj3Ccb9Oty1gPfXYeZrjIl73ojnFBsVEfAGFyYhljaAnaZ8egH60AbvN ZJUW3az/V89j/rQa+ZbR8nnjqWzs/Z1rayfIWFhtWWKYQIWyt0o7GFoIaqIMnnzkRL 1Dk+QRl7c3nuQ== From: Sean Young To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org Subject: [PATCH v2 1/5] mtd: rfd_ftl: allow use of MTD_RAM for testing purposes Date: Sat, 7 Aug 2021 22:45:34 +0100 Message-Id: <20210807214538.14484-2-sean@mess.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210807214538.14484-1-sean@mess.org> References: <20210807214538.14484-1-sean@mess.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210807_144542_945572_3F5DDE2B X-CRM114-Status: GOOD ( 10.75 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This allows the rfd_ftl to be used with the mtdram module, so we can test different mtd sizes and test the rfd_ftl on machines without a physical nor flash device. Signed-off-by: Sean Young --- drivers/mtd/rfd_ftl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This allows the rfd_ftl to be used with the mtdram module, so we can test different mtd sizes and test the rfd_ftl on machines without a physical nor flash device. Signed-off-by: Sean Young --- drivers/mtd/rfd_ftl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 6e0d5ce9b010..7b243f2b2fa3 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -720,7 +720,8 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) { struct partition *part; - if (mtd->type != MTD_NORFLASH || mtd->size > UINT_MAX) + if ((mtd->type != MTD_NORFLASH && mtd->type != MTD_RAM) || + mtd->size > UINT_MAX) return; part = kzalloc(sizeof(struct partition), GFP_KERNEL);