From patchwork Wed Sep 1 06:26:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 177662 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Wed, 01 Sep 2010 07:27:14 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1Oqgmv-0006M1-SI for chris@printf.net; Wed, 01 Sep 2010 07:27:14 +0100 Received: by mail.laptop.org (Postfix) id C4A5324511; Wed, 1 Sep 2010 02:26:54 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id B399524510 for ; Wed, 1 Sep 2010 02:26:54 -0400 (EDT) X-ASG-Debug-ID: 1283322431-0b7497240001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id HE9x5UnonKH8pL5A for ; Wed, 01 Sep 2010 02:27:11 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752933Ab0IAG03 (ORCPT ); Wed, 1 Sep 2010 02:26:29 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59492 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051Ab0IAG00 (ORCPT ); Wed, 1 Sep 2010 02:26:26 -0400 Received: by eyb6 with SMTP id 6so348901eyb.19 for ; Tue, 31 Aug 2010 23:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:in-reply-to:references; bh=QnAd5x5gkSzGvT5zFFXccCXg6codC0v1jJ9ugWRxo1U=; b=C4WNAO/gwvQPG+JZ9QthLPHPdu2nO/8Y6hOgoV4L6UGDKFvgkLek9cjako66hyfefY 3ao5eZT9B/SIh7Zh7Xn3wYBisg9Dhv2YjaDuueCX8x545Oo31VBC8pYxks9Px6g9qcyF 0roixgBkJxfQDhHiyVCX+BlzLXwFIHsdK5IEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Dn4P1JMlSnJEeLtbfM86BwFdmRsJfEw5Y6tIosCH+azgbGo5EO9DMFwF4lkBGWkmTn h38YuDd+iBFfFqF+pH5s+GzfPJlrpr0nzQ+FMP658GKeBEkSNYyzFuT2mgqzJv657YwS p+lDex6lNH3NqWeaJsSKQjNHipvBCsz+11fv0= Received: by 10.213.20.77 with SMTP id e13mr6641358ebb.41.1283322384669; Tue, 31 Aug 2010 23:26:24 -0700 (PDT) Received: from localhost.localdomain (starua.cc.colocall.com [62.149.23.157]) by mx.google.com with ESMTPS id v8sm15477371eeh.14.2010.08.31.23.26.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 31 Aug 2010 23:26:23 -0700 (PDT) From: Andy Shevchenko To: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Adrian Hunter , Andy Shevchenko X-ASG-Orig-Subj: [PATCH 2/3] mmc_test: change simple_strtol() to strict_strtol() Subject: [PATCH 2/3] mmc_test: change simple_strtol() to strict_strtol() Date: Wed, 1 Sep 2010 09:26:46 +0300 Message-Id: X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <756943b35144532a3c8de22c6dcfb179e5a7f69f.1283276161.git.ext-andriy.shevchenko@nokia.com> References: <756943b35144532a3c8de22c6dcfb179e5a7f69f.1283276161.git.ext-andriy.shevchenko@nokia.com> In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1283322431 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.39584 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 359fae9..5423ac9 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -1836,9 +1836,10 @@ static const struct mmc_test_case mmc_test_cases[] = { static DEFINE_MUTEX(mmc_test_lock); -static void mmc_test_run(struct mmc_test_card *test, int testcase) +static void mmc_test_run(struct mmc_test_card *test, long testcase) { - int i, ret; + long i; + int ret; printk(KERN_INFO "%s: Starting tests of card %s...\n", mmc_hostname(test->card->host), mmc_card_id(test->card)); @@ -1849,7 +1850,7 @@ static void mmc_test_run(struct mmc_test_card *test, int testcase) if (testcase && ((i + 1) != testcase)) continue; - printk(KERN_INFO "%s: Test case %d. %s...\n", + printk(KERN_INFO "%s: Test case %ld. %s...\n", mmc_hostname(test->card->host), i + 1, mmc_test_cases[i].name); @@ -1920,9 +1921,10 @@ static ssize_t mmc_test_store(struct device *dev, { struct mmc_card *card = mmc_dev_to_card(dev); struct mmc_test_card *test; - int testcase; + long testcase; - testcase = simple_strtol(buf, NULL, 10); + if (strict_strtol(buf, 10, &testcase)) + return -EINVAL; test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL); if (!test)