Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp130519lqr; Wed, 5 Jun 2024 00:46:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlzrw9J3fLZBHTQvlvLIaXi9N2lf8OV0b/zxm19AVhgPIF3xNpJTrHD6iuziHv+mNWp3X2y+1SGke/r6XpR72VDAoS62frHIA2wCweAQ== X-Google-Smtp-Source: AGHT+IEqeO6YSyXK9rVMZ5LgtjLICEGnoUNqdmn5rcQZStyAI2gg2RXm3xMDamvFDGZnExtQIEYV X-Received: by 2002:a05:6214:5984:b0:6ae:d3f9:d71f with SMTP id 6a1803df08f44-6b00487ebb7mr36736276d6.5.1717573610367; Wed, 05 Jun 2024 00:46:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717573610; cv=pass; d=google.com; s=arc-20160816; b=I0O+v+AH5+DKNSEmMbPOKOwMw+t7p0iCgtV02Zq0m+8I9cw3YghuxyYlHiwl4gF3PD Z97oBsjUssg4ikpKKta+2YG13OdoqEzOVwa9lvQnYLV9dDel7vcI5Xg/TlT7TBIcYEbG FJES1Kel2gQjiM9XY+3IO45oJYvCgfCl4RaqzgnAd2InW89JuJ75j6xN6TAtLItK+YW4 6/A7YoZ398+VXHlKzLEQS7HS1tvdQubuECWnEMQDp8NXOhnlZJbcqnjjyr4nnA0zfVkG fULIk8as/BmjH5EfTVqekmTLplksroHKIsgYDemDdpok8OvkMQHugdHvbVF7nvJF/ii+ RjBA== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=gMazlr+f0ay0OQRRaQaLtVjPs1acjHVrV/9BzKL3MHk=; fh=kkjij1uhKfCWjvn2F+5H0V+kTSCLRTCbyPKVLd0k8pw=; b=wY0YYamdep69rWcfZ6cMzYELvgsnmAux8xHDKRu8gCJGkpoJ0pSAaFj5oNtWPy6Dh0 l+yLxPUlfwzPNfDtrgEpUHzU0S1Ky4YFNt4mj0XQbRm8aahfOK/KjoAzMdMZ/2oe1STN E2Up/6GXRWUhZe1wIEikpgfrxJf1epweREWH3RfoNbEcnLSzB6IRctnxXedXUXBSUJ6p CQwiBshJwxGgrwrzCckD6HjpozqEgDWsPqoLrGQBBNJMDKYyV/hDFEQ2Ez3Fnld+Z/ay kAeCZZ7TT0BoHRWpw7sF/IxQlkg3wWAamGtInHT8ZZpxeA8imP7h8rGSDNU1DyE+pvti dq/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QGKdGKKg; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-201897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b402050si125536226d6.218.2024.06.05.00.46.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:46:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201897-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=@bootlin.com header.s=gm1 header.b=QGKdGKKg; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-201897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 1C2391C229AD for ; Wed, 5 Jun 2024 07:46:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3103818C34F; Wed, 5 Jun 2024 07:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QGKdGKKg" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 846FE18F2D3 for ; Wed, 5 Jun 2024 07:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717573593; cv=none; b=G8B5eLuAIb4VICP2yKZRgqzVWyxF+S6Tr896ZvDDNgUv9BI3g3Qc0vIJpaLYPOKwzaqq9SnoyRiqdGHuPJMTUyPpILnNAjchPfnOBS1mV7OaPgORCVM704TlsCvNYBadSUVAZjbCcIrpTk6RzAVPqqv7X1Fc7ARgZ0nsnZWeHUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717573593; c=relaxed/simple; bh=r3Kzc+XJxiov2vmnrA4MZmY3LMokV9cIB0YO9V095a4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xdvz7O23MH/tcWErKLi8dA7NKFvhI1ornrl9xk2i+Hgh6zPVYgoN6X9d12Ko+uUtd8Nisdh91wIlksOxFZ1OwVRP14um2IPiF1TtbuO+4lgBBl9fLyfdReeI7NKxm7JdWuDzKW7jcj+AFeLcJaAKelJr26pE5nbADVGSmvKpQuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QGKdGKKg; arc=none smtp.client-ip=217.70.178.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay8-d.mail.gandi.net (unknown [217.70.183.201]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 96935C696C for ; Wed, 5 Jun 2024 07:44:09 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id B21C01BF20A; Wed, 5 Jun 2024 07:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1717573442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gMazlr+f0ay0OQRRaQaLtVjPs1acjHVrV/9BzKL3MHk=; b=QGKdGKKgTQwaxwc7fzB9V3qEm+4vNF63AtrXImg09JWC6pPjni7y6vu9B4TIVsawzG1ri+ utuOAP2q5gaPux+W+FabcM5e8JGR74mA6aitOyTySvwAynZ4qPIyAjf5ElVLFusrKaAeIO QNJl7eBavwHYr0tiIfNM+bt+3aENtas+Yd0pmM5FRcYAv5E3Pv+ZIMJUbbz7TPs3hjlM6n giURPVPgGjS2A/1+/WPXZDGStYZpaBe6t8o850O10cBLFosy6TF67428plfi6cVPrKr3b0 4lmf6Ojyyw74JLYMGSFqAZ8UsuVrk2ARRxAzjHSucGncWW1hT1WYpyUxLZjlpQ== Date: Wed, 5 Jun 2024 09:43:59 +0200 From: Miquel Raynal To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Richard Weinberger , Vignesh Raghavendra Subject: Re: [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions Message-ID: <20240605094359.53a6d8ca@xps-13> In-Reply-To: <20240604212919.5038-4-wsa+renesas@sang-engineering.com> References: <20240604212919.5038-4-wsa+renesas@sang-engineering.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Wolfram, wsa+renesas@sang-engineering.com wrote on Tue, 4 Jun 2024 23:29:19 +0200: > There is a confusing pattern in the kernel to use a variable named 'timeo= ut' to > store the result of wait_*() functions causing patterns like: >=20 > timeout =3D wait_for_completion_timeout(...) > if (!timeout) return -ETIMEDOUT; >=20 > with all kinds of permutations. Use 'time_left' as a variable to make the= code > obvious and self explaining. Good idea. The waiting functions are generally confusing because the semantics of the return values are different, so this is a good first step, I'll take them through mtd-next soon. Thanks, Miqu=C3=A8l