Message ID | 5981326.lOV4Wx5bFT@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3616213vqi; Tue, 19 Sep 2023 12:05:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGg1ndy9ekH88q0bUys4hXgP8XX/gpYzr6SOIRN8pXGwz6qpFdbFQdDXsWbA7WA7+BjKJE X-Received: by 2002:a17:90b:4f41:b0:273:ec82:5554 with SMTP id pj1-20020a17090b4f4100b00273ec825554mr660270pjb.9.1695150332985; Tue, 19 Sep 2023 12:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695150332; cv=none; d=google.com; s=arc-20160816; b=Pyu84mKzSmFPzRIjzhHp2tiOHIUy5LjoOyF0tPXXUBVvX4WGo7XRBSGJUQ4tQjbExn 58Mi3iW9AISjyz2vDZApwxZpnefv26pSTsuY40dJHlWcsUZSs3PfpdIY21hXMwEEObxV ior3xKgCIJdEvgyMvY64ka9SjQauMX4/NzWkmZr4Mty4uJhz/rqAc3+UmOfmUNrWDKgG VjAuebma4qVE3kXpQg/ObWRV2lLt+TbV7mfJZfNaY7e0cGTfQE0kt6hhNXISfalYNy+/ T2Hzp9aExrV3i9aK/LpfhMZlFiT+ZVdF6bGLufd5Xhq/n8Iv+K6c7nA1Z1F7gUJRnmPv 50tg== 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 :message-id:date:subject:cc:to:from; bh=gcLgaKreOEs0HfWYEVlK3oWWhI2u09wLHbBBzZWDcoc=; fh=MU4YjG0GBN+qqU28ljjhKmK96YDURGAAG3mD3otID7I=; b=YY4Ryi9u33dxBLnT3Hn+GcnfXKJk4o75llt/PnvlhY+QpP7ZZ65FDLn9M/urjRGTL2 SEg/HvhJkxQg/g1rx+jktJbqS+da2Kl0Jt1WiW+Z+xFA9J83ic4ojGGQPpqwbEh5ffgr JddAEkTqYPaJDqMCudnrr3HTOP68UAMb/TcQJQ56CS4mXCVXOMNebI9Ird75Reze4Vt4 da+rGoahbYwGo9PHLgt31KlR7S5kwqeUY6JUM1f20hP355ggYzNYm8MmRyhQScCDmsMy FmL0C8x2R2to3eJ7my2F0qd8eRSsGm5lZZfqHBBKGwHz5x5EpTbSB+dXaAlKrjXqBWUX gaJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l7-20020a17090a850700b00268307ac3cfsi12101954pjn.185.2023.09.19.12.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 12:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0AD088088A59; Tue, 19 Sep 2023 12:00:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232594AbjISTAG (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Tue, 19 Sep 2023 15:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232490AbjISTAD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 19 Sep 2023 15:00:03 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578BEEA; Tue, 19 Sep 2023 11:59:56 -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.2.0) id b5efa5a60af9636d; Tue, 19 Sep 2023 20:59:54 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=<UNKNOWN>) Received: from kreacher.localnet (unknown [195.136.19.94]) (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 370506646D4; Tue, 19 Sep 2023 20:59:54 +0200 (CEST) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Linux PM <linux-pm@vger.kernel.org> Cc: LKML <linux-kernel@vger.kernel.org>, Zhang Rui <rui.zhang@intel.com>, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Daniel Lezcano <daniel.lezcano@linaro.org> Subject: [PATCH v1] thermal: core: Drop redundant trips check from for_each_thermal_trip() Date: Tue, 19 Sep 2023 20:59:53 +0200 Message-ID: <5981326.lOV4Wx5bFT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudekuddguddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhr tghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 12:00:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777493955507739106 X-GMAIL-MSGID: 1777493955507739106 |
Series |
[v1] thermal: core: Drop redundant trips check from for_each_thermal_trip()
|
|
Commit Message
Rafael J. Wysocki
Sept. 19, 2023, 6:59 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> It is invalid to call for_each_thermal_trip() on an unregistered thermal zone anyway, and as per thermal_zone_device_register_with_trips(), the trips[] table must be present if num_trips is greater than zero for the given thermal zone. Hence, the trips check in for_each_thermal_trip() is redundant and so it can be dropped. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> --- drivers/thermal/thermal_trip.c | 3 --- 1 file changed, 3 deletions(-)
Comments
On 19/09/2023 20:59, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > It is invalid to call for_each_thermal_trip() on an unregistered thermal > zone anyway, and as per thermal_zone_device_register_with_trips(), the > trips[] table must be present if num_trips is greater than zero for the > given thermal zone. > > Hence, the trips check in for_each_thermal_trip() is redundant and so it > can be dropped. > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Index: linux-pm/drivers/thermal/thermal_trip.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_trip.c +++ linux-pm/drivers/thermal/thermal_trip.c @@ -17,9 +17,6 @@ int for_each_thermal_trip(struct thermal lockdep_assert_held(&tz->lock); - if (!tz->trips) - return -ENODATA; - for (i = 0; i < tz->num_trips; i++) { ret = cb(&tz->trips[i], data); if (ret)