Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1958121lqa; Tue, 30 Apr 2024 04:42:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtiwghlOHg9kSayVSDmG9Xsylgd3VBQS1WAy68GYDuS911HXJVdqw2ilBFgGhMcyJJ49BO18memZQNa0jYY0ehUaoZoLqUU5+LcqCXRQ== X-Google-Smtp-Source: AGHT+IEFMItn7uudALUKUQRX+DDpzkMOFud8ksexjXUv83nIRsniKofvuahUQRZMRmpmlUwwSfYa X-Received: by 2002:a17:906:15d7:b0:a46:bfe2:521f with SMTP id l23-20020a17090615d700b00a46bfe2521fmr9484495ejd.24.1714477343217; Tue, 30 Apr 2024 04:42:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714477343; cv=pass; d=google.com; s=arc-20160816; b=SMy2CCBe8ZSfzskukQIqJhz1fCuZw+i1OHP5EayFfw7WlNXIPeDTDF1z0RBYEah8oB LkzAHfvomzsC8GtWxy9D9OnrO0XTwZvAovNTtWqLyP6jMCfzZvEi21wIbZsarGEeVDOq 0w7aFb+csl3TN3LARHu0aCvR3ZmXzuFWc1Cx5zMwxC1Wp2amA0kzL2xox+lMaGufEqu9 STjDROp90X35CWvfsGNE5tj8In0sSlBWvL1wTKlSs7IiFiiP5HUXk969jkITZ03AFCTb 6Ss26oQXrH8Xijf2UDT7Pp8xVgTFtnm3yyCq7rHWqiCpcwVwYwoSjnfU1//Wf1U2Zh8l vkaA== 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=rpLjss5ddpJbfZh9dMVz4Fvk8ojPRYA4onbcjmoERmjbYUGW8TFyZsOGAEGIRpRXaq el3BYYYIAliqhkkNWaBA+bA1s0PFjdxsU9JiT/YWL7tYTgkjUhwYYjMEjxhHkoFdsjZC VZhpaP8S/KKuCFiPB3KNeOOaJCcW3hLOynnlNppgGveWVigTGv6XHofb0jcmiSPqLVqO 81VaHviDRtZPiTj8nbioIVilNpjQUpK6vJT73B1GA+uvB9XFsT5eG1aSU5Dp/Dc7Dthl 5myAsdNvePWl1jy4wT8ohNf2CHExaoPeJXraZG5RnNNgjitKcqqPH1bwnho7tmAWF21H GxTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="SLz7/teq"; 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-163855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163855-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p10-20020a17090653ca00b00a587e1423basi8926412ejo.70.2024.04.30.04.42.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 04:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="SLz7/teq"; 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-163855-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163855-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 942791F23CB5 for ; Tue, 30 Apr 2024 11:42:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B66213D26F; Tue, 30 Apr 2024 11:41: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="SLz7/teq" 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 7F0D3131BA7 for ; Tue, 30 Apr 2024 11:41:51 +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=1714477314; cv=none; b=NpOHpCojDUYOTAPbLhM/rZ3xBPgUFptPJy0A4VgtqdxAawEdDXWwURP7y42sf1WthxDZnpnYVuV6lGcKCChDCHAvvo5J9TPhsFcsMdddf286c0lt18DqDXm1EJpS1FqYJ/Kc8PYL8ZJ9mfqEoZEZZkYPOKt5ZafZyr2w38aZ7bE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714477314; c=relaxed/simple; bh=/+yQD/1xxpt49MoQExQ1xzYhBFcnigvlM4u45hspn/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=btuHCT5E9WW3a+ylDf0Ot/uhtGZknrpz2EgG8JDFykAxOPtT+bxnPQqROwdSGT+QVGEQyiGrgssIy0IZrVm7S28YkIHSkmbxU8YyhjcRE0Q55RWOKOMKPj1UGOFNnbWHAVchtsmPSH/fOfMhWf93Q2nQ0+UXtOK7JlDmGR4nv4E= 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=SLz7/teq; 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=SLz7/t eqVmXqY8JhMbX+u/25uNAtIG77C2ODWZywg0PPebVQOfpySVdMQWH+zJ9xtI1ZZ/ 5Y7PMtGvpMY0pJlWb32bpN4ofkP0I4tbxK+zmKNSJ48rzzZGaELMZgA7KxTPpWJu iSaa0/sH1WVPOTM1zs0+XNBEUKP6ISPjq0glHGkm6nbP+WHpdsTUckgvKBWhNMIY RGhojboqbusd3rp2+g5ZBIyYuwjLVSCstU5FVY9ib/AsvU+/7TwhlH8OJv5EotY6 Tyf/hQwtfZ+1n3VqG3hUEqtya1GyfaBtnIQ5HsZw/gF8c5Z3KfQyc4HSDfT8PtfE KRKEVMK/KrF4pSeA== Received: (qmail 2617773 invoked from network); 30 Apr 2024 13:41:44 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Apr 2024 13:41:44 +0200 X-UD-Smtp-Session: l3s3148p1@nw+x2k4XrOhehhrb From: Wolfram Sang To: linux-spi@vger.kernel.org Cc: Wolfram Sang , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/8] spi: armada-3700: use 'time_left' variable with wait_for_completion_timeout() Date: Tue, 30 Apr 2024 13:41:33 +0200 Message-ID: <20240430114142.28551-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240430114142.28551-1-wsa+renesas@sang-engineering.com> References: <20240430114142.28551-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