From patchwork Fri Aug 17 14:35:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 1338941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B4ACC3FC33 for ; Fri, 17 Aug 2012 14:44:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T2NgL-0001xP-0d; Fri, 17 Aug 2012 14:37:49 +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 1T2Neb-0001AR-TA; Fri, 17 Aug 2012 14:36:08 +0000 Received: by weyr3 with SMTP id r3so2709792wey.36 for ; Fri, 17 Aug 2012 07:35:54 -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:in-reply-to:references; bh=/i/Y3efuHXQSThapVUUdvZj3oWbsAJ9Ko+7rNiBqZqU=; b=LO9CT01HVdFBoh/pTFWiK4Irw6Pn5L9RmxpRSDL/VDmQKGAm52B/uXmQyLZCTDNP7R iwoWGaXCxeVKYJslO/o8VAZNWxF5PaJUFfCuYHoGHikxesmbkX6cmmpxBt/FPgURULsb 3rUWbVCcwAeSio94QvkxVouPs6ADIrFw444WNq8k8pEezdRSeISmw0oBDGHh8VlRmaLm ZJS4ig9i59fIMSm2jD3UWuIqWPu3ExEesjw+qZ/LGRV23+/t1P5llreXu16Yg11lK2Jz rixDFgyPiRU3GRBEcPkZbtwZvnOSUzMhg/FoWJtb8NKU23d0zULZoQDYWv9t7S9yiEI3 RGww== Received: by 10.216.147.4 with SMTP id s4mr2829871wej.9.1345214154676; Fri, 17 Aug 2012 07:35:54 -0700 (PDT) Received: from localhost.localdomain (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPS id dc3sm10053154wib.7.2012.08.17.07.35.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Aug 2012 07:35:53 -0700 (PDT) From: Richard Genoud To: Artem Bityutskiy Subject: [PATCH 3/8] UBI: introduce MTD_PARAM_MAX_COUNT Date: Fri, 17 Aug 2012 16:35:19 +0200 Message-Id: <1345214124-5478-4-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1345214124-5478-1-git-send-email-richard.genoud@gmail.com> References: <1345214124-5478-1-git-send-email-richard.genoud@gmail.com> 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.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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richard.genoud[at]gmail.com) -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 , linux-mtd@lists.infradead.org, Shmulik Ladkani , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Richard Genoud --- 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 82d11e1..1f45f51 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 ht 'mtd=' parameter */ +#define MTD_PARAM_MAX_COUNT 2 + #ifdef CONFIG_MTD_UBI_MODULE #define ubi_is_module() 1 #else @@ -1327,7 +1330,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; @@ -1357,7 +1360,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) {