From patchwork Tue Aug 21 12:33:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 179054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC4AB2C00C3 for ; Tue, 21 Aug 2012 22:34:54 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3neQ-00049l-Rd; Tue, 21 Aug 2012 12:33:43 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3neM-00048l-Pa for linux-mtd@lists.infradead.org; Tue, 21 Aug 2012 12:33:39 +0000 Received: by weyr3 with SMTP id r3so4952589wey.36 for ; Tue, 21 Aug 2012 05:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=tKmdoEXjZGn8pEYbZWUIMzcNXa3GzeQ0c98A6opgKpg=; b=zdbYRKwZh/EUWPsQ8Hxp1dDfKL+Q+ulgPw4nLctc1gn1xwZEXI7mpgkQBWG73eWwHr iu7COkH4ApKF3d3fCAjhKk8mcLaya8ga6bbmI2h71vFBGxrdRmFDAWTXP0pLNkKEwuZu 0Zz7DiaO5TOmcsQrnycd1E5O7NZAO0m9TrrdKm/hFCdKoHm6MLmetZH9+xz6EmbffoW5 M6WJVFtSlH6uromwkGDxxP6T6TE6bOWn9SM/Orabw4CML9Xgc61CTog4RgFBRnqgTESk fpyzHZu9y+7DDGzk0kyicq4lO6gKf2O0nT/9TsZVtaHJjFiNHkEGrZI0CnjFtg/tdPq1 Sl7w== Received: by 10.216.255.146 with SMTP id j18mr8882873wes.163.1345552416966; Tue, 21 Aug 2012 05:33:36 -0700 (PDT) Received: from localhost.localdomain (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPS id ep14sm34186503wid.0.2012.08.21.05.33.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 05:33:36 -0700 (PDT) From: Richard Genoud To: Artem Bityutskiy Subject: [PATCH resend] UBI: introduce MTD_PARAM_MAX_COUNT Date: Tue, 21 Aug 2012 14:33:22 +0200 Message-Id: <1345552402-25190-1-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.2.5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richard.genoud[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Richard Genoud , Artem Bityutskiy , linux-mtd@lists.infradead.org, Shmulik Ladkani X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Here is the patch accidentally dropped. I rebased it on linux-ubi/master (9baf0a2) and made sure the other ones: * UBI: replace MTD_UBI_BEB_LIMIT with module parameter * UBI: add ioctl for max_beb_per1024 * UBI: drop CONFIG_MTD_UBI_BEB_LIMIT still apply correctly (and they still do, so I don't resend them). Best regards, Richard. Signed-off-by: Richard Genoud Signed-off-by: Artem Bityutskiy --- drivers/mtd/ubi/build.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 8bbab23..0fe6356 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -46,6 +46,9 @@ /* Maximum length of the 'mtd=' parameter */ #define MTD_PARAM_LEN_MAX 64 +/* Maximum number of comma-separated items in the 'mtd=' parameter */ +#define MTD_PARAM_MAX_COUNT 2 + /* Maximum value for the number of bad PEBs per 1024 PEBs */ #define MAX_MTD_UBI_BEB_LIMIT 768 @@ -1338,7 +1341,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) struct mtd_dev_param *p; char buf[MTD_PARAM_LEN_MAX]; char *pbuf = &buf[0]; - char *tokens[2] = {NULL, NULL}; + char *tokens[MTD_PARAM_MAX_COUNT]; if (!val) return -EINVAL; @@ -1368,7 +1371,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) if (buf[len - 1] == '\n') buf[len - 1] = '\0'; - for (i = 0; i < 2; i++) + for (i = 0; i < MTD_PARAM_MAX_COUNT; i++) tokens[i] = strsep(&pbuf, ","); if (pbuf) {