Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1289272lqa; Mon, 29 Apr 2024 04:29:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVi5Whwwmmkjwl1HsRPiIcgLzgl9lrkt8gs76MX8XTrBRiI/LyJfXUyf4Asp8c+C12xIpBrSyhlH2NZQuu6C1+wmCM54Xh0i6zzGjsRhw== X-Google-Smtp-Source: AGHT+IH+v24X0tKA5QNTk14F4yDH66bFkWhWZFE78R0uS4rLf3XnKWJtpnMobi8wy5G4KuRHBRM6 X-Received: by 2002:a05:620a:57cd:b0:78f:a416:1518 with SMTP id wl13-20020a05620a57cd00b0078fa4161518mr12595603qkn.3.1714390143452; Mon, 29 Apr 2024 04:29:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714390143; cv=pass; d=google.com; s=arc-20160816; b=NhBO2lfawRz6oabJtYtOIsxcEOYnVWuW/gEivVSe77S2Zy5iBQtN/1py2jPeQWnmxU LlDMefPA2gGrue0UpFu3Y2iBvq2RtRKmTNjlbs8kYn0eMDkhf+7HF7JoQVNNKj8hMKVA hqCrG5c0c0g7lak5bzTKWTlXHFrGCM9ZYRKCdg8id/sRWNR2I8d7RK9a/GvaOKijQACC +FVB4ppjeSXYpXR9jU0q9NOo+pckry07KVA0RyJbMZxCuRQ045R+hfdXt9FakFWVb7TU xca8p2723+Zu1VfWMQ1dNNHSyJy9YY+AHYpiuA6mz//kmJej6/fRUgczBwKy4DBGtuUZ 0bjg== 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=Tc5X/Zoe6TzZ7ehoGlEwf656j+yN61PTSQN5v3elxi4=; fh=HMmm4U7AbdvcJIoeDg7+Ktu1WvLDOfwmyLifKtq0VWM=; b=q9v+T66GDJgeXPuyB7MX8f6JwVxk5UgaU1ZS32tqxgPoaWfCkAsRlcF8JsEaEGzMmL p3M5qEU6ArXle7myZNruboV+NwiGBELEwg/lpjmN9HQZr9vWpre48a32mlLvPzp/X1ad OlH+0ljnQTbBoPtUEaEw7DmCesO0NcBlT1U6lWsV/5fxpo6bdD7HW0Pc5JhR2idycHmv EvTsGwn5QLIzrqHZh+iMlFleQ05v6SlQYtNEEe+dqRuiTkxA+bWGFztBZQshvUpd7eC7 iQdgDHX6WWrwXXBTy6HYnfftq/rD/mCMpBsJYGTeTTjUE/+jtB2BpvGTsphz7c+GHkMQ 2TUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=QiqdOS15; 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-162139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162139-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id os2-20020a05620a810200b0078edfeefea1si25782573qkn.257.2024.04.29.04.29.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 04:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=QiqdOS15; 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-162139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162139-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1BFE01C22787 for ; Mon, 29 Apr 2024 11:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B9E64502D; Mon, 29 Apr 2024 11:28:55 +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="QiqdOS15" 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 AF0533FE28 for ; Mon, 29 Apr 2024 11:28:52 +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=1714390134; cv=none; b=r8uRwnnRiceFtrQVnt35TnLhxFmJ0QWG1eS6VOIcvQrEzWfxMJdbLT/ynJxy0W/ThNoubIipbHC56XDoni0GI2K7ZPmhx10JUpqNU/LWoGpquoLjQEqMiekuFHvFQ8+oOGcxIjLWV2gw+44T10vaV7lLTeZjy8GuAtnC1nnjlTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714390134; c=relaxed/simple; bh=/+yQD/1xxpt49MoQExQ1xzYhBFcnigvlM4u45hspn/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y84ClKGzpERPDihFi9g3sIZZzGxw9rwvu15FDSLf1Z7ta/5LxK3NEzfm7YrCXrhKXoNgGaSdQW1H93dYpVtnI0T1z83IAgcIvS6LBYfjw/eD182lxaRwD3mmYbg+Xn5yofo5B6v4EtlAfanHGfEvn+GBaZCsSRcXjlL3gGG5sZg= 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=QiqdOS15; 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=Tc5X/Zoe6TzZ7ehoGlEwf656j+yN61PTSQN5v3elxi4=; b=QiqdOS 15/fKw2XKRiniG5gIdbcmDHbOpdjQWh7I8lyPv+YW4noWzynWoqS4K0+k/V7+Hbu xneolw1qFeu5yCzEFflcNHqp64h32A+twQhMzlEBDpmq8P/oO7XLq0H9ZYy124at iVCwNzV6cMjwXyUVLSINLpx6ay/79ouKo56lbcS4eB8DPEgIqX2EaQ+0rHdhhum1 2/NMEhn/exNkM7LTfAEI8Cx+fIwNLZ9YKLBlPOq64Wte+1DrSTeAcy4UQ9yHr7M0 uXiuT0dcPknJZxj0spnOiQyKs2LNOV+snuhUpEn/99ZthP+/K8OXxfsRSnaHLYe5 ylbECwhGfAQoa4nw== Received: (qmail 2279524 invoked from network); 29 Apr 2024 13:28:45 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 29 Apr 2024 13:28:45 +0200 X-UD-Smtp-Session: l3s3148p1@3bxgjjoXflVtKPB4 From: Wolfram Sang To: linux-spi@vger.kernel.org Cc: Wolfram Sang , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH 1/8] spi: armada-3700: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 29 Apr 2024 13:28:34 +0200 Message-ID: <20240429112843.67628-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429112843.67628-1-wsa+renesas@sang-engineering.com> References: <20240429112843.67628-1-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/spi/spi-armada-3700.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c index 3c9ed412932f..02c1e625742d 100644 --- a/drivers/spi/spi-armada-3700.c +++ b/drivers/spi/spi-armada-3700.c @@ -339,7 +339,7 @@ static irqreturn_t a3700_spi_interrupt(int irq, void *dev_id) static bool a3700_spi_wait_completion(struct spi_device *spi) { struct a3700_spi *a3700_spi; - unsigned int timeout; + unsigned long time_left; unsigned int ctrl_reg; unsigned long timeout_jiffies; @@ -361,12 +361,12 @@ static bool a3700_spi_wait_completion(struct spi_device *spi) a3700_spi->wait_mask); timeout_jiffies = msecs_to_jiffies(A3700_SPI_TIMEOUT); - timeout = wait_for_completion_timeout(&a3700_spi->done, - timeout_jiffies); + time_left = wait_for_completion_timeout(&a3700_spi->done, + timeout_jiffies); a3700_spi->wait_mask = 0; - if (timeout) + if (time_left) return true; /* there might be the case that right after we checked the -- 2.43.0