Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1408232lqm; Thu, 2 May 2024 14:00:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuVDUv/faPkPZeTYZ7OoiDlhUg6ojT60E0JtpChEkE4inoatGodMH19JxEu5IubgYN0jrlHetzO1UYT7XTuT+GPy5J1BfnchBIPv5slw== X-Google-Smtp-Source: AGHT+IEuNF8EQq3EWHfdP206VGnfLZ5/eab18BbU2hl6DrsqbveOwZgqQK/DKn8HqbNDwV16LpmA X-Received: by 2002:a17:90a:8581:b0:2b2:7c42:bf6e with SMTP id m1-20020a17090a858100b002b27c42bf6emr990214pjn.12.1714683655263; Thu, 02 May 2024 14:00:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714683655; cv=pass; d=google.com; s=arc-20160816; b=luPdjdMm+qmQdLJq8AqBTaDOY8Itb2UQ1nTc43RBogUjgEWzBjNLl4V9/30aYXdPtQ lAHziTGE1G+NOT4aBDCJx8soh0+g67F6SyKf+guKFsc1me8+QbxG6xqibxIhyER5KbP6 pQK+ZVpfZQwMe5fwnhWNQj42cwVu3ZwGwnX9myS0vr1DbojesoA1yYwzMRLrSyMf/oyP v98YlnGFggC+2c/rn/fBpjYlpWfWTYmboq7X6GeXLm8+zBshyuZuRDGcP3HFCZSN5i20 2wQ6U2PmOZnmybobUnM36eMEASY+UofWSKoFPF4UEbh7hR/JC48JzLOulwjre3uHOYJ3 aFfg== 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=vAMWiez7uDZZTZNLu3icHY1jKUo9NfGEJcQneAUfCvc=; fh=mhLaGtqVbB55BAwdFAV3NEJpNKLdqySqwdXrKKCUgYA=; b=j3OQa9cMObDFJem2TsblTK5Hn5zFUCsIcsmlC0Hbwg1vTgS8vusBYBkXsNCy1HQTY+ QXQAaVCZj4UmfGQ6No2cM89jxlAnwfG2aZa5wQ6bJSQavhoRST/KrbRGSVZktLPQCgs6 xEoq+Qr2L/11iNbxOZVn9NLOhnc1NRcUU2fCHzakE7AMt0AUxpXzbUvkUc3Y6QZ4kxGn qMGOL1hTcUBj+EaG6N+boj+4xD3b1J61fLQw2jMNddh3gwi5PjLyKaeegxqVlncmsk4r kYbXg0ujEs9h7CWDVZEUqGWt6/HmySUyRBPn+3XfUk4vf0lhO0iVwNCyG3Osuvj3UHaK tQ1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=AHoBLdRg; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-crypto+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id rm2-20020a17090b3ec200b002b285de58f9si4180963pjb.178.2024.05.02.14.00.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=AHoBLdRg; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-crypto+bounces-4004-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4004-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 E4AC4283732 for ; Thu, 2 May 2024 21:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56C79180A95; Thu, 2 May 2024 21:00:47 +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="AHoBLdRg" X-Original-To: linux-crypto@vger.kernel.org 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 BDC50179972 for ; Thu, 2 May 2024 21:00:42 +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=1714683646; cv=none; b=UPzXbTxOTY3V9veepJTi595TuboHnBL9r1JAp9ZkcQczVtCfeNIL8XMPmx7cYEMgftsty7pAAAcsdBBqDhhc516K7eDHMNPF1nT6dc8sUvLXEFvkYw4cgy3ilk48IRp+d9N1WpAQAZZWPlgOJr4K17Rg7OTtXe6A8v858KfLbBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714683646; c=relaxed/simple; bh=OB0axKIV+52dkYXP9Tf4JLw3GKj3ZQlRiztet/h+5Yk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jyVw9S30tsz+b5J0e8bSdr+K6e09fUZn7owUcnxboUIdZvDwN3xdj9REvhuys7ryr9zfDcwY8C+wlH7l7M8wVw2MZVDMIFXsvD5BXxlOA4mDiGK/V+y2UAF4PTFU2UdYvRFs7NtEkCOGXYHWxMykb8mZtzU9NAJILbDXixd8Wwg= 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=AHoBLdRg; 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=vAMWiez7uDZZTZNLu3icHY1jKUo9NfGEJcQneAUfCvc=; b=AHoBLd Rgmg7yijf1cZpxtTmp/J4Wi+06H9prcdpvbDsJbxa6Y6YsnvcObNg5URdS7UsXIJ ThYDPtH/918GbzabGRiBSb3gTqXuT/mWnq1VWF9JCu1Yu8vKppXJcGOGRkCuEysb Eod0AL0E368hkgHU7eyvI/f+iwdAWJTTNgIfq4Hq/6VXBgUyIR1u7U+eEwBam5oV 05gaoqhFpSSGj6LXVtNSBqZLVdftbrqAi7OqFziOdpiTQLiscOrmknwAZMh7C+Ep iTB+kYXPpi4K9YO4Pt3qdtigblQWsfAuHtjsgCCPWpBuXttEYaBoBAG7k0/OMNl1 KlNZvTumqSnxxwug== Received: (qmail 3365832 invoked from network); 2 May 2024 23:00:40 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 2 May 2024 23:00:40 +0200 X-UD-Smtp-Session: l3s3148p1@JpJK5X4XZopehhrT From: Wolfram Sang To: linux-crypto@vger.kernel.org Cc: Wolfram Sang , Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , linux-fpga@vger.kernel.org Subject: [PATCH 1/2] fpga: socfpga: use 'time_left' variable with wait_for_completion_interruptible_timeout() Date: Thu, 2 May 2024 23:00:36 +0200 Message-ID: <20240502210038.11480-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240502210038.11480-1-wsa+renesas@sang-engineering.com> References: <20240502210038.11480-1-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-crypto@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_interruptible_timeout() causing patterns like: timeout = wait_for_completion_interruptible_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 'long' while here. Signed-off-by: Wolfram Sang --- drivers/fpga/socfpga.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/fpga/socfpga.c b/drivers/fpga/socfpga.c index 723ea0ad3f09..b08b4bb8f650 100644 --- a/drivers/fpga/socfpga.c +++ b/drivers/fpga/socfpga.c @@ -301,16 +301,17 @@ static irqreturn_t socfpga_fpga_isr(int irq, void *dev_id) static int socfpga_fpga_wait_for_config_done(struct socfpga_fpga_priv *priv) { - int timeout, ret = 0; + int ret = 0; + long time_left; socfpga_fpga_disable_irqs(priv); init_completion(&priv->status_complete); socfpga_fpga_enable_irqs(priv, SOCFPGA_FPGMGR_MON_CONF_DONE); - timeout = wait_for_completion_interruptible_timeout( + time_left = wait_for_completion_interruptible_timeout( &priv->status_complete, msecs_to_jiffies(10)); - if (timeout == 0) + if (time_left == 0) ret = -ETIMEDOUT; socfpga_fpga_disable_irqs(priv); -- 2.43.0