From patchwork Tue May 12 20:25:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 23334 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4CKmdNf023395 for ; Tue, 12 May 2009 20:48:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750939AbZELUsg (ORCPT ); Tue, 12 May 2009 16:48:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752665AbZELUsg (ORCPT ); Tue, 12 May 2009 16:48:36 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:50663 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbZELUsf (ORCPT ); Tue, 12 May 2009 16:48:35 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n4CKiJgO008527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 May 2009 13:44:56 -0700 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n4CKiJd2027310; Tue, 12 May 2009 13:44:19 -0700 Message-Id: <200905122044.n4CKiJd2027310@imap1.linux-foundation.org> Subject: [patch for 2.6.30? 1/1] acpi thermal: fix off-by-1 error in trip point trigger condition To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, eightgraph@gmail.com, rui.zhang@intel.com From: akpm@linux-foundation.org Date: Tue, 12 May 2009 13:25:03 -0700 X-Spam-Status: No, hits=-3.489 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Vladimir Zajac Fix a regression caused by commit b1569e99c795bf83b4ddf41c4f1c42761ab7f75e ("ACPI: move thermal trip handling to generic thermal layer") which accidentally changed trip point trigger condition to temp > trip_temp This patch changes the trigger condition back to temp >= trip_temp Signed-off-by: Vladimir Zajac Cc: Zhang Rui Cc: Len Brown Signed-off-by: Andrew Morton --- drivers/thermal/thermal_sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/thermal/thermal_sys.c~acpi-thermal-fix-off-by-1-error-in-trip-point-trigger-condition drivers/thermal/thermal_sys.c --- a/drivers/thermal/thermal_sys.c~acpi-thermal-fix-off-by-1-error-in-trip-point-trigger-condition +++ a/drivers/thermal/thermal_sys.c @@ -961,7 +961,7 @@ void thermal_zone_device_update(struct t switch (trip_type) { case THERMAL_TRIP_CRITICAL: - if (temp > trip_temp) { + if (temp >= trip_temp) { if (tz->ops->notify) ret = tz->ops->notify(tz, count, trip_type); @@ -974,7 +974,7 @@ void thermal_zone_device_update(struct t } break; case THERMAL_TRIP_HOT: - if (temp > trip_temp) + if (temp >= trip_temp) if (tz->ops->notify) tz->ops->notify(tz, count, trip_type); break; @@ -986,14 +986,14 @@ void thermal_zone_device_update(struct t cdev = instance->cdev; - if (temp > trip_temp) + if (temp >= trip_temp) cdev->ops->set_cur_state(cdev, 1); else cdev->ops->set_cur_state(cdev, 0); } break; case THERMAL_TRIP_PASSIVE: - if (temp > trip_temp || tz->passive) + if (temp >= trip_temp || tz->passive) thermal_zone_device_passive(tz, temp, trip_temp, count); break;