From patchwork Tue Jun 4 01:46:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 248447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E35502C00A7 for ; Tue, 4 Jun 2013 11:48:05 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjgLU-0005wu-DK; Tue, 04 Jun 2013 01:47:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjgLQ-0007VM-RZ; Tue, 04 Jun 2013 01:47:28 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjgLK-0007Ua-Vc for linux-mtd@lists.infradead.org; Tue, 04 Jun 2013 01:47:23 +0000 Received: by mail-pa0-f47.google.com with SMTP id kl13so55174pab.6 for ; Mon, 03 Jun 2013 18:47:01 -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=E+zd3CRdWgoWnKPjOokFR5wO+SJaw9gKETuLsk2r3vo=; b=tnTb2X294ys1KW8Zp+j0b1WiD5FS+wfkuI3Uv4SJw+Q31n0fN+o9MPlv6xi9Qf8nuD KpIPyUNxJ6CXEkGlL1IyMgyYw7mnA6T2CIW9S3ubFZ4OxqYW5o76/I4x07ANJA7nsool ZTbOeXBJ0Av8OvwxgF5geTX20Er0X1ulwXDInvXYsW9/L8PMj/jtjuqH/oEsxKQja8tJ a3RaOFDGLHIIhSTzZGbCHVR4oMEwkxcTo3LHhvDOK3iN6PdvVQTPNMmqIOQogwB1pkO3 nqoUFxCXn7rOvKR+jA5SS0SKdxS5eYvhxSMSlYqN+p/MH0KTDfE8F502tlLDIjUu6aji IjPQ== X-Received: by 10.66.222.228 with SMTP id qp4mr26546552pac.113.1370310420954; Mon, 03 Jun 2013 18:47:00 -0700 (PDT) Received: from ld-irv-0074.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id cq1sm61054021pbc.13.2013.06.03.18.46.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Jun 2013 18:47:00 -0700 (PDT) From: Brian Norris To: Artem Bityutskiy Subject: [PATCH 1/3] mtd: cfi_cmdset_0002: remove unnecessary initialization Date: Mon, 3 Jun 2013 18:46:44 -0700 Message-Id: <1370310406-413-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.8.2.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130603_214723_104277_5915DDD8 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[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: Huang Shijie , Brian Norris , linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 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" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org These timeout initializations are arbitrary and pointless. We simply overwrite them with new values anyway. (In one case, the variable is not ever even used, so we kill it.) Signed-off-by: Brian Norris --- drivers/mtd/chips/cfi_cmdset_0002.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 89b9d68..6c85f61 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -1146,7 +1146,6 @@ static int cfi_amdstd_read (struct mtd_info *mtd, loff_t from, size_t len, size_ static inline int do_read_secsi_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf) { DECLARE_WAITQUEUE(wait, current); - unsigned long timeo = jiffies + HZ; struct cfi_private *cfi = map->fldrv_priv; retry: @@ -1160,7 +1159,6 @@ static inline int do_read_secsi_onechip(struct map_info *map, struct flchip *chi schedule(); remove_wait_queue(&chip->wq, &wait); - timeo = jiffies + HZ; goto retry; } @@ -1228,7 +1226,7 @@ static int cfi_amdstd_secsi_read (struct mtd_info *mtd, loff_t from, size_t len, static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, map_word datum) { struct cfi_private *cfi = map->fldrv_priv; - unsigned long timeo = jiffies + HZ; + unsigned long timeo; /* * We use a 1ms + 1 jiffies generic timeout for writes (most devices * have a max write time of a few hundreds usec). However, we should @@ -1466,7 +1464,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, int len) { struct cfi_private *cfi = map->fldrv_priv; - unsigned long timeo = jiffies + HZ; + unsigned long timeo; /* see comments in do_write_oneword() regarding uWriteTimeo. */ unsigned long uWriteTimeout = ( HZ / 1000 ) + 1; int ret = -EIO; @@ -1900,7 +1898,7 @@ static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) { struct cfi_private *cfi = map->fldrv_priv; - unsigned long timeo = jiffies + HZ; + unsigned long timeo; unsigned long int adr; DECLARE_WAITQUEUE(wait, current); int ret = 0; @@ -1990,7 +1988,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, int len, void *thunk) { struct cfi_private *cfi = map->fldrv_priv; - unsigned long timeo = jiffies + HZ; + unsigned long timeo; DECLARE_WAITQUEUE(wait, current); int ret = 0;