Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp383284lqb; Tue, 4 Jun 2024 14:30:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwqcXB3Q1QAnrzq0/z3mDPgKKf+HvOkAF76KT1NUuNvNVqIVmlGR6hT9BrqMf/kOOuJr2rh4y08SiGkuf36LgU8XMg6yHuKBQwACOrJA== X-Google-Smtp-Source: AGHT+IFle7VwfllG/xMOf1w74eCnT8YFVFkxaAyVXLlpApJkLH2y/rrREQycuTBaSTdrcjhJc9+7 X-Received: by 2002:a17:903:a0c:b0:1f6:87c:6f with SMTP id d9443c01a7336-1f6a5a84956mr7255495ad.62.1717536629954; Tue, 04 Jun 2024 14:30:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717536629; cv=pass; d=google.com; s=arc-20160816; b=BLKV/ON7Li/BvgY/YvxnyWGVoVRKHtLdQFKMLlBqhbE7iRKNrPq5tmBbACmBW8ivx1 017/W0wPMzc0bgSrC+OAnA0a4wpFME7dYa79JgkJZFlBDqlxWV0esE39CLZHy+mmwii9 25E2mgz0fMIcYbULED45+uFyMXVz7k4hXd/089gDBMcX+lsXLe8VyJ9VeZAPuvNpsPDq TTrtFj9G3f8FTTD3IvNXbZabb8jAWTH22SETfaMvZcZsyy8wTrL5K1c23i67O58HmvD8 ZTgfY16dJUgmEAlL57spevmX2mqZ/2wqNof3oVHU0aYZMDpzDEciZujKDKbo3czxW1Q2 Pn7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jNaCNho3HkpDyJKsOVs+JnrFnTAQRUo8cA0Au9KuneI=; fh=KJSIzbG03lyYxleUjjvaoUOAi/P2pnzoC8PuEkM3fHY=; b=zZr5+4wyevbpv8/VcsHQb115jpntm33X1H60amko0pUId5Wnu5C4iFVu/StEYq/ynb qk57fr+up5XcOUcjPZykHrEp+AabKgus+B+XJH8oCM3xBIdTjhQ3UYA5G2x4np/GUE4Z bn00gD/eXpdFv/eN3pztPU9+pNwm7JdsBs21UKKEbjqZS/8wLH23A366eTWrere6Q3KR 2cNZNPrxOoLqvBl3rt+iAgawctfSpNBbmTcqjl8RAeBH9EOCnQYlwaTQsUU4XMXZ9Bvk Wr5Hppc1zTGVEk66Vpkb3BhCWr5454LGReuTxnJ6+csFWv1Yngx9/BuCyvLhoFatZx3r H3vw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=goYC5QZY; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-201405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201405-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323eb223si23826995ad.388.2024.06.04.14.30.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=goYC5QZY; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-201405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201405-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2483028674E for ; Tue, 4 Jun 2024 21:30:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E4CD14D2A3; Tue, 4 Jun 2024 21:29:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="goYC5QZY" Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 921F214BF99 for ; Tue, 4 Jun 2024 21:29:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536571; cv=none; b=udifJYm+U83tUdghVWUGcbNDGxWPBZQS+XHGksL3vkqwqqALi3pEnk8hHji/ouF7w0GpPWLA9BqViFTISoIZTGSep2OG3OBkQ4JC3SZGZC/rrGAQvO6M2bN6UIuKmldgsFEiOZjDbBapm+hVdNlc2fftG4KYNjCB9vb28wAaqNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536571; c=relaxed/simple; bh=2DD/kGQouJsnqGRFVITaf9uQ2MSslRqtd0UUnPUDx70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GmjS8OpZTxPIRtEu5Lolw2xvKuAjMKwlpXCGk+S7mMCXTWptoMxFnGJ0dGJQI18rB6SbsK2Jcoh4TGcD1gpeSnqWUhLxl7lqJrRsJtAMQkLZv/qIQY5vy0va5D3NAr86yfG4Ex4O8zqpN585S3oEfQGazlBRGOfZbqtSwkEvdMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=goYC5QZY; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=jNaCNho3HkpDyJKsOVs+JnrFnTAQRUo8cA0Au9KuneI=; b=goYC5Q ZYCkI43IZ1cDYG9/MiRnx4/qitPVvR9trSSdIkyUU9HOKNbtOHE06oYckn/gBdwL 4AaIoV2WUrWwltIDSzIR6kfyepo4XckxtcR0N5nA2CGe8C8OHH3OrkPqhXHYfxSD ceOIC5tTEInewC7QCNN650EZMgoIdAfBDPF9MByFZZzNxiLSJwq3L/ZNuBbjC0Oh BYKJEVngtBHWUmm+MGcuBdxKTmZ5j43gg/N8NOpZGlGYeOSe/eDSK45V2nBZ7c4J uVdSA5jxQPkj5GkOAmRi9I+qO9loA/7FSoeAqtX5+juIUH43s1Mh1+c8O7VgOgUk PZhCC5QWGnLY+TfA== Received: (qmail 2450944 invoked from network); 4 Jun 2024 23:29:27 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 4 Jun 2024 23:29:27 +0200 X-UD-Smtp-Session: l3s3148p1@Lcj4JBcaAtpehhtB From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org Subject: [PATCH 2/2] mtd: rawnand: intel: use 'time_left' variable with wait_for_completion_timeout() Date: Tue, 4 Jun 2024 23:29:21 +0200 Message-ID: <20240604212919.5038-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240604212919.5038-4-wsa+renesas@sang-engineering.com> References: <20240604212919.5038-4-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Fix to the proper variable type 'unsigned long' while here. Signed-off-by: Wolfram Sang --- drivers/mtd/nand/raw/intel-nand-controller.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index f0ad2308f6d5..78174c463b36 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -295,7 +295,7 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir, unsigned long flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; dma_addr_t buf_dma; int ret; - u32 timeout; + unsigned long time_left; if (dir == DMA_DEV_TO_MEM) { chan = ebu_host->dma_rx; @@ -335,8 +335,8 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir, dma_async_issue_pending(chan); /* Wait DMA to finish the data transfer.*/ - timeout = wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000)); - if (!timeout) { + time_left = wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000)); + if (!time_left) { dev_err(ebu_host->dev, "I/O Error in DMA RX (status %d)\n", dmaengine_tx_status(chan, cookie, NULL)); dmaengine_terminate_sync(chan); -- 2.43.0