Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp838528lqj; Mon, 3 Jun 2024 02:17:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7rOG39pA8wMUhoicYtxgDcDXispG9lwMgAlMgDTRehJRvcBDgS4s5TrjNR8wbo+a7sv9tIeomA/1vR8mgdvjZEf74oNl4elu0wRNJUg== X-Google-Smtp-Source: AGHT+IE9sjPZsaZAh0317xBLrzdobT0UrdUiHhgT6yFOIi1JR6c4VE6i9W7lTR1RmZfLKcV2j5Ps X-Received: by 2002:a9d:76cf:0:b0:6f9:91c:f271 with SMTP id 46e09a7af769-6f911f3c9d1mr9669967a34.19.1717406255522; Mon, 03 Jun 2024 02:17:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717406255; cv=pass; d=google.com; s=arc-20160816; b=bfWVO4ADI6bQar4jCDVhCX5hsLGwv0XNtahKJu4y2IKjNTgS49PWo2/vTiIiQOdmfa g6yqITxtwdY0OgoD3oMLsK1gF2BsdXSfzHTpO/lysrED4zzWpK+6avoGW05I3iPiiMSi Q9t3wHYBDDpi/s4DfqJz0GjRNq7tSnf8y6p8LhhXA09v9f8+xuoKDTn9RE0tmsGbZxbt pca7SoVwroteO71bXWf382x9rb761VeixAy3tViiTyDxv0VNU1yMEK4W/6cBeHvxhWW9 ZOrF+8tLGtBfyTcxEVYR9fUm8BW3qu9pgGztcAnqTRaGDTcZkZ0djh1oZ59Acwm+akDV U8XA== 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=vFiFwcvLEE/Pv747qc+Uul7awI7SHIx4wIkE2dTt7B4=; fh=33fmKjBkLbR7Be6evUTkgv76+cG2/jYmTUTec/JS0RY=; b=Q8+MwRna/Ey7Rnr11PdEMG0jtSoLLEE1u2hnMOg0WsUnKR4V2LldNEqHwXfcHaqakH fwSASEJRtd5UhuCBCulYILdNwquXEtJca3yeQejsLfC4uA90smPuk+445WRpQBMhmr27 zkJf+TCTf5p8My2UMediOMze+s2kcioI1mikOzR10mquUDDFyKl5Ic1J5MKDvwyCZ9Hy qtS0JKCve6Q1/GeQ76uEfZWsBUkgEeeQAYuroLTZLixwXeyKUeTBT69D60qXA6WJTfMz wV+FzMiIQkfbpYOWNZHd5GUmYENalw8IBUOdudRJEaPjPgymGLsANL3fE2vVMRyptAO/ d2jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=cehrddhk; 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-198852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198852-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 41be03b00d2f7-6c35552bafdsi6226960a12.237.2024.06.03.02.17.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 02:17:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198852-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=cehrddhk; 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-198852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198852-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 84F1B281E88 for ; Mon, 3 Jun 2024 09:17:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A04D84A30; Mon, 3 Jun 2024 09:15:56 +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="cehrddhk" 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 E504E82C76 for ; Mon, 3 Jun 2024 09:15:53 +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=1717406155; cv=none; b=Pa7ju6E5UkbhOg9JwokigGVKNFCgg/HFivy5g1QlhZuFGb1w6da5XhIUPc5ZdMHwAw9jrJTi/+cv+lKIdoXYHyAwt54GSXMNQH/vKkOxho/qutAba/nVHBP94kxJI+lwGADWObgBkaKohcMfuYSL7NkKtdY9oxbAPnaB+Tt3ljg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406155; c=relaxed/simple; bh=KuYORB2sueIbIdV8ZkFX68NtUj8C7l8czDRU62n4XqA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pz5YPnBllzmglpYCGV32Cz7ANy2BSLA0m/5ewQPSofzKjK9YQf91rewKtdhLzMVhOf9PeIM9fFk0MLnYCButsrYO2AUgbU2wF6qOSdn1z60s/s8T8u/0hD1kfIn6JIF780sZYauHferTNo7Rwk8g7PINbDPUsmV2DAXcF9oegZ4= 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=cehrddhk; 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=vFiFwcvLEE/Pv747qc+Uul7awI7SHIx4wIkE2dTt7B4=; b=cehrdd hkCdJJ+YulpyRRPe+BHxQNyclUx7ZmMqKEZlM0MNlosr64dlYNqoV6T+D3QAlxw9 o+cNHHkoNrL+hQ7URTExVQW7lVGo/AEOUe97VsFiQiKTdv73AO2ijC17VT4N/9qj 80TLuzLJWn5TKvwLw95t2fvNbd+vj1qIWDCDi3BDcEJWrdHR2+CHxoeOM2q0OYPN Y2i8Jgs0ZFlOx/Bp0HzjNtvlIRR8eqaj73RRRCMO09ZXMoCI1S44VV+VusPchxzl /I4iy7M46YZx3TBAAim4Mdn3wmdyVLTW6Y6iLQIWwxQefifjaX45apTgDTdhTkQ1 l3zdCjVzOZZyBWMA== Received: (qmail 1899402 invoked from network); 3 Jun 2024 11:15:50 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:15:50 +0200 X-UD-Smtp-Session: l3s3148p1@Wrp9x/gZKoYgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Kalle Valo , linux-wireless@vger.kernel.org Subject: [PATCH 6/6] wifi: zd1211rw: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 3 Jun 2024 11:15:39 +0200 Message-ID: <20240603091541.8367-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240603091541.8367-1-wsa+renesas@sang-engineering.com> References: <20240603091541.8367-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 --- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c index f3b567a13ded..2ee4218da1c5 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c @@ -1698,7 +1698,7 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values, int r, i, req_len, actual_req_len, try_count = 0; struct usb_device *udev; struct usb_req_read_regs *req = NULL; - unsigned long timeout; + unsigned long time_left; bool retry = false; if (count < 1) { @@ -1748,9 +1748,9 @@ int zd_usb_ioread16v(struct zd_usb *usb, u16 *values, goto error; } - timeout = wait_for_completion_timeout(&usb->intr.read_regs.completion, - msecs_to_jiffies(50)); - if (!timeout) { + time_left = wait_for_completion_timeout(&usb->intr.read_regs.completion, + msecs_to_jiffies(50)); + if (!time_left) { disable_read_regs_int(usb); dev_dbg_f(zd_usb_dev(usb), "read timed out\n"); r = -ETIMEDOUT; -- 2.43.0