Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4261458iob; Sun, 8 May 2022 07:37:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQZV6pDiWXjTudIuEYE7dIF1KqHkWxi2SVwAGzfu/g/VlEqcU+EdwgIktKepqbDG42/IBi X-Received: by 2002:a63:1d13:0:b0:3c5:f9bb:cb6e with SMTP id d19-20020a631d13000000b003c5f9bbcb6emr9763878pgd.98.1652020657769; Sun, 08 May 2022 07:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652020657; cv=none; d=google.com; s=arc-20160816; b=CbXcyYZj20D42TdGADqIn5TgK0To3pI/IjjQzQHcjPY+ixmJnRywgvw/+UG2S+g4gZ 9hHxyxpndc6WFb6mxef5pwVFBvt7hllrHs5l8cNxhjpv1kiF5StzncWovS3OEy0ozrlb EseLD5C4ydV0BqneUhtybN53AoIjnEzc0owKU/60D1p3MFDhbf1rUnFiYUxHPUmJecCZ 3g/BhTteZY3hzYR7M/kud17SLvJwh/S0wtgpHC2909M9fx8PVW6jbxmlhvvxROAD4+Q9 7sBPgHsdOLDEbwIl4p8qRCWRh2Es+HhwLlj+s1m6sevw8D1z8LPA53ZkOMUMbmGK7WH4 7hcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=G+mtBW8QYs3kkLdn/BL3NMUuklKfGlIhnBTRSWcvrMY=; b=P90OqMiCe9qTgoUllUjDUUOjz0HkVm0uCectHF9BMu9Lh9deoAw/UNouTrqK3xpe36 qD9SjCL3hLN15GjeO7S27hrRO3zTrtRDtP9lGRsVAcv2nZ5u0MJ/uUGMSJgNLXUGSIR+ XnOu5vqZie7inTrYPHet8YIR1/Zftw0ef3rbPnSTY9yiORWBts65d9w28BKcIXinngk4 igBSreYT291SuR7gGV1cPjbM5ADabZvV+tDelMNVty7rdSCh5t5QXTynzJOwQdll8AAY XiWiP3xYfVmikcFyI9X60rmRd6H5K5YjKN8A5vORAJRHy8rrU6mCoJFNMgbdz/XUbS2x P+HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b22-20020a056a000cd600b0050db6efbaedsi12407638pfv.105.2022.05.08.07.37.23; Sun, 08 May 2022 07:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380152AbiEEShR (ORCPT + 99 others); Thu, 5 May 2022 14:37:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381112AbiEESff (ORCPT ); Thu, 5 May 2022 14:35:35 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D242D14087; Thu, 5 May 2022 11:26:38 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id e30f9251d57c40cd; Thu, 5 May 2022 20:19:30 +0200 Received: from kreacher.localnet (unknown [213.134.161.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 0EFE266C2F2; Thu, 5 May 2022 20:19:30 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PCI Cc: LKML , Linux PM , Mika Westerberg , Bjorn Helgaas , Nathan Chancellor , Anders Roxell Subject: [PATCH v1 09/11] PCI/PM: Clean up pci_set_low_power_state() Date: Thu, 05 May 2022 20:15:34 +0200 Message-ID: <2539071.Lt9SDvczpP@kreacher> In-Reply-To: <4738492.GXAFRqVoOG@kreacher> References: <4738492.GXAFRqVoOG@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.219 X-CLIENT-HOSTNAME: 213.134.161.219 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrdduiedurddvudelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeiuddrvdduledphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdhptghisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgv lhdrtghomhdprhgtphhtthhopehhvghlghgrrghssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehnrghthhgrnheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnuggvrhhsrdhrohigvghllheslhhinhgrrhhordhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Make the following assorted non-essential changes in pci_set_low_power_state(): 1. Drop two redundant checks from it (the caller takes care of these conditions). 2. Change the log level of a messages printed by it to "debug", because it only indicates a programming mistake. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg --- drivers/pci/pci.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) Index: linux-pm/drivers/pci/pci.c =================================================================== --- linux-pm.orig/drivers/pci/pci.c +++ linux-pm/drivers/pci/pci.c @@ -1341,16 +1341,9 @@ static int pci_set_low_power_state(struc { u16 pmcsr; - /* Check if we're already there */ - if (dev->current_state == state) - return 0; - if (!dev->pm_cap) return -EIO; - if (state < PCI_D1 || state > PCI_D3hot) - return -EINVAL; - /* * Validate transition: We can enter D0 from any state, but if * we're already in a low-power state, we can only go deeper. E.g., @@ -1358,7 +1351,7 @@ static int pci_set_low_power_state(struc * we'd have to go from D3 to D0, then to D1. */ if (dev->current_state <= PCI_D3cold && dev->current_state > state) { - pci_err(dev, "invalid power transition (from %s to %s)\n", + pci_dbg(dev, "Invalid power transition (from %s to %s)\n", pci_power_name(dev->current_state), pci_power_name(state)); return -EINVAL;