Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1138432rdb; Tue, 30 Jan 2024 08:58:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IErzb2n/evOjOc00ywprzPlN+nnaHcNQMcy9+vXEZ/mdBi8vg9YSmx4TM4mXXL1GN7rSIlF X-Received: by 2002:a05:6358:93a3:b0:176:4ac9:5509 with SMTP id h35-20020a05635893a300b001764ac95509mr5883951rwb.13.1706633914468; Tue, 30 Jan 2024 08:58:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706633914; cv=pass; d=google.com; s=arc-20160816; b=nEn/tU1lwZFKj2igqqtRd9EgYxr0OqtPju9wFoBLtSr+k9z27nNP0CFW/1Nh1x6vnQ iIB3umz5GgaEai8pGxBuyAJvOH3m6NGSs2FXZ9WbhIeQ1czb9E1X/wCupsKgy1kwGoOD 03v6LTERxLtgkQZDarMfuMjuuccN6BBSEW+Q3YIS3fuE+mGZrt5kPmGC7I+dOKYgsuVO NQvHugjaAJXpGQ8ifjgNGQFPlObuWQW+J3NkUIciGUNxtVJrL37K2P/0AX2Yf3Cw8Zq9 Ma1TtHN7dvmKi5HtHpBW4qCJOEe9M32+SfbGo5bnCoxQcsTKhFTY7nmUXJQSgK3GeGKm vTWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TplrVwlT1KQQSHzhl19fkElU89ykPDWXpM5Ja8kRAJg=; fh=zJ6tyQPSPJtpNE1kDDjqZJNbBRQIRffCQQMnrzX3sgI=; b=zJY8d5fz/oAfs90CCpBM3KJ4Q3WAx/73Y7x+p1xVE7sKAy4Va3tCk0mh0HrhZL5e+r pw0haIxd0FoAZ4S1xSUyyTWrlNCXVta4B+wD/61X1P9EdaGkdtkHsXRyZcMlR8bXmRuX CbitLWizEZfxM6/oSzEmeFXkbvCPN8L7WKvU9qlXg7GTQpAy0BL65FtH4WN/fP8OR8f7 749HxEFVDYXuR+GxeFzEV+lRGhPRw4W51ecVbx2p1z38JLb1vHHZR6YcMyWgVqOWwTsV BMFyBnOHg1gtj/V/GkcsL/14GpKdHG4oWtK+CyGbM3KclsR5uV/DcTpILKyPLOfKxVJr C+PA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WJnGlYvs; 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-44963-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44963-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z17-20020a63e551000000b005bdff97f97bsi5936992pgj.92.2024.01.30.08.58.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:58:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44963-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WJnGlYvs; 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-44963-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44963-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 51EFAB23331 for ; Tue, 30 Jan 2024 16:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DED02129A8F; Tue, 30 Jan 2024 16:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="WJnGlYvs" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 9C46B128388; Tue, 30 Jan 2024 16:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706632702; cv=none; b=cPkMig5llDg0pMilykzhr+u6+3eTk7nvT3QG99KubRg8DkQB0IRUkivD5scUBYxeKB+vZe0cLqi3VD6Qh60wpkLbGFG9T5aLBj8P5ymd189cMySlqkdIT8JOM3zzk7wPiNzEzdlByyDb2yJDTS9bNsQ901eZOY9ainrZeFGD7fQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706632702; c=relaxed/simple; bh=M2wO7sSvCPR2982vZ06PIUvIfGKMG54QQ49RvdvfJ4o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u5bGL3U1v8nIb9taC0nv1lBGU9QxIxr0cMEbh7HFu7+ItShq5PtfKKtgceNWE+fiGBzICyCdbfVz1XYqUN7xgofgqNrb0hkgs/+HISMIhbI/4wt3KEfhlVE4EMEHH2M9Ftckjw9fNe6DT701Xd19ITyTF4WHySRgXYPDPze1P/s= 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=WJnGlYvs; arc=none smtp.client-ip=217.70.183.199 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: by mail.gandi.net (Postfix) with ESMTPSA id 7C932FF802; Tue, 30 Jan 2024 16:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706632690; 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=TplrVwlT1KQQSHzhl19fkElU89ykPDWXpM5Ja8kRAJg=; b=WJnGlYvsLktLg5YVEN9Gc1gRr1+qFsRheBxrdMHtKhX0EhYL6k098CAcruxMCEhyHXGutn vFpG6qz/d4LOwRUl4ySVuhnkRWEaRDVB/weY8qLcaLhH4lVfe59poYOcxtBCfQLdIsQgsT cr+TW103IMpfivL5fTtM6wDz2VB0cl1yixDpo0WKESic98lfwYdjvkOMTFxJCEyKvUEabW mteGb4Ee6jVAsVdMafL7bmIXSQRjTkhrB4gIDXJQJNMh68dL2595yEmPLQCqqJYohbIpan ibg0KXyFQrPgV/3vESu7rY8nQo9lUZ651P006nibWUVpZ+tGeyoBDKzZMv5Lvg== Message-ID: <3fa57200-4218-4ac8-86b9-3f86723d5cd8@bootlin.com> Date: Tue, 30 Jan 2024 17:38:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 04/15] mux: add mux_chip_resume() function Content-Language: en-US To: Andy Shevchenko Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Tom Joseph , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> <20240102-j7200-pcie-s2r-v2-4-8e4f7d228ec2@bootlin.com> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com On 1/26/24 22:28, Andy Shevchenko wrote: > On Fri, Jan 26, 2024 at 4:37 PM Thomas Richard > wrote: >> >> The mux_chip_resume() function restores a mux_chip using the cached state >> of each mux. > > ... > >> +int mux_chip_resume(struct mux_chip *mux_chip) >> +{ >> + int ret, i; >> + >> + for (i = 0; i < mux_chip->controllers; ++i) { >> + struct mux_control *mux = &mux_chip->mux[i]; > >> + if (mux->cached_state != MUX_CACHE_UNKNOWN) { > > if (_state == ...) > continue; > > ? Yes it makes the code easier to read. Fixed in next iteration. -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com