Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1963895lqa; Tue, 30 Apr 2024 04:54:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgegb1ZuLNpt3Iv4wiUSds30spRowd7yZmU+HEDwUCLeED+EkY6bs5Kqe4rWeks5XpnHBN+FGthVzd+OKkynyhYX52nNZiGfu/37GQsg== X-Google-Smtp-Source: AGHT+IHn92hLcf5wmuAdVhSXEfpTm5cli5qzWnNccDq3ydWZRqCzVHyQ0VW/f99ffFeZlPkSB2cR X-Received: by 2002:a05:6a00:4b4a:b0:6eb:40:6bff with SMTP id kr10-20020a056a004b4a00b006eb00406bffmr10789214pfb.14.1714478097964; Tue, 30 Apr 2024 04:54:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714478097; cv=pass; d=google.com; s=arc-20160816; b=jI7g7HCx3s9mdrS9DjZfCOEIYr5v6YeK1TWfEDqaRj0j5OG37UqoQwMJQgGEbPqNwE Zfo2w2xpNtSBz4YfmxQfoy7mP0Mpl/UaiunXrvSGk+bsIAmHVhPYPHuXnIhmqQE0PEj/ qDWVyBlZwc0/12xA0+YQfIA/+VswyZhC32Vw59r0GnLw4KA133HpNXtovcakgB4qcudJ oUdblaKjpVNFJKAKDRHMCOQ7lnWn0hoaVpqBHf9Ukq9i1AbsZEmXqtOWMt8wY9XrKL10 aK4RP3a5NrYbx5Xjy/9Sgm5VYGobyvx8dtGwM66UxyEA8JgCY6V+rgB4mTp82aTsFaLQ qc7g== 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=zwiSUDPpKEKl2A0JVQtlH+c9e9Co8VShhAKYP5+ABCA=; fh=FWvBladxccCph5BkZ14ag7L9lyMPV2Mh3oz0oUyoCMU=; b=y7c8zQlQ8YXFHaSMDyA5zp8JDfCfqh7a289R0GWgh9VKq9O1oq9r3w8Nnaz45isBsB P5O1p+pQ5CmlMx5sqiqttuEjBo0WcTvTwyPVSVQBzwNEwxnMEpshGhAlN7qMUjVVzgAg 2E+I6na+JEk93cbmPcHjXzo1h21xu8YRlcnTkRv3ItJxeDW9mBxeW74MiCP3tuD5pIKS LegSBthJzq3zy2UqcU/Xxv7KieOYxp+f2F9k7wGZPuVaVNNSzreNi3N75BMOjAtIsU8i gcGszFWMmPGrwWrvUbfYiXqyN8nna6vK2MBPqtJkPVk315JwEHsPfFAf1BWcFcCxxEXw 1/7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=jOZ2ihVM; 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-163871-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163871-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 ln22-20020a056a003cd600b006ecf4764fd7si22355291pfb.27.2024.04.30.04.54.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 04:54:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163871-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=jOZ2ihVM; 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-163871-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163871-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 245B8284D28 for ; Tue, 30 Apr 2024 11:54:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FC6313D600; Tue, 30 Apr 2024 11:54:44 +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="jOZ2ihVM" 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 D81C613D247 for ; Tue, 30 Apr 2024 11:54:41 +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=1714478083; cv=none; b=EWo2/CsgBtsQG2PVVRibFucf0hSNqmr0oMM60AA4XwCKaG/3ODFPsy8F7JikF/+eESLKiXl9Csfw5tfaGiiO01iNG3iVr4HApjyCJBlT7/ZqfDVjSRfR6d7Vf1fxlWSxzu4GRv1sOXcvNzQG2cfmMFN3QFXt5KAj6V3S4s0r03s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714478083; c=relaxed/simple; bh=1ukMYFxzPfY1qsmq+J1Ewq78TfiLOMOqhtd5od5EB0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ehs41bZfERymN/7HNFILDRJp4/k+hax2WoPUO0AlHyiAxNRBkwZg7cNeY4PEP7sjc72CCmFHXqpcmBlocPWMJk9hVI6roCsVRsxODI5SV0f0nxVn+mYuKXPJ9J1FlgIN3Ti/Acvr3iuOWOZBU1GKquxj6s9ig01jelm59xV2tS0= 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=jOZ2ihVM; 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=zwiSUDPpKEKl2A0JVQtlH+c9e9Co8VShhAKYP5+ABCA=; b=jOZ2ih VMtj+LpEO83K4WUH05bZJkKW2aIENuvPgJj6kMqSJkUJwVNzWGkBeQHzdS6Cwbtb LblUrnd60FpBxtCcNegap7qS86svKc+82Q4tGgaxOVbn6i9EXWK3psAGrvSv9aA2 gwePwEmqHPskdH3WSR6bwODgDdCOHPCn6+f4QFR3wSb98qJVPtQ/aZnZ7T1bw+SJ hcR2MswKtdaJOwTYlMf3iywl6kzN+nz30CNAkYPP+KEtvT6XKdaduFDELqKS7OSc xnT3A6EUSYGvqHIssmN0A8x120NvmnsX0xgfbV5KihL3uBn+lcUZ6W/Q8cVzf0ht 5SB0ql11qSVI3zeQ== Received: (qmail 2621497 invoked from network); 30 Apr 2024 13:54:39 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Apr 2024 13:54:39 +0200 X-UD-Smtp-Session: l3s3148p1@ds3jCE8XMqtehhrb From: Wolfram Sang To: alsa-devel@alsa-project.org Cc: Wolfram Sang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] ASoC: codecs: wm8962: use 'time_left' variable with wait_for_completion_timeout() Date: Tue, 30 Apr 2024 13:54:34 +0200 Message-ID: <20240430115438.29134-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240430115438.29134-1-wsa+renesas@sang-engineering.com> References: <20240430115438.29134-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. Signed-off-by: Wolfram Sang --- sound/soc/codecs/wm8962.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 7c6ed2983128..3856e7a8eeff 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2886,7 +2886,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s { struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); struct _fll_div fll_div; - unsigned long timeout; + unsigned long time_left; int ret; int fll1 = 0; @@ -2974,14 +2974,14 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s * higher if we'll error out */ if (wm8962->irq) - timeout = msecs_to_jiffies(5); + time_left = msecs_to_jiffies(5); else - timeout = msecs_to_jiffies(1); + time_left = msecs_to_jiffies(1); - timeout = wait_for_completion_timeout(&wm8962->fll_lock, - timeout); + time_left = wait_for_completion_timeout(&wm8962->fll_lock, + time_left); - if (timeout == 0 && wm8962->irq) { + if (time_left == 0 && wm8962->irq) { dev_err(component->dev, "FLL lock timed out"); snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0); -- 2.43.0