From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 21 23:19:38 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D502106566B; Sun, 21 Nov 2010 23:19:38 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3928FC0A; Sun, 21 Nov 2010 23:19:37 +0000 (UTC) Received: by wwd20 with SMTP id 20so6484986wwd.31 for ; Sun, 21 Nov 2010 15:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=ccmNA94plpP68HTN7nX3uix6zuhXK+Ky4pdleWjFyjw=; b=vUeUnQ3LpKG8dDP0jdqSztA7rG543J3LbYKndEYOIfRpOS4s4LCA8YTbQORchOzl0s cl0ZFLnvPi7amdgJq8o8GRLFYEADT+c92yT/a87zeij0bvcEz4gBNQ+OTVwmpkgJJe9i Sej5pHSGFwNZLP4iu1yicpuVkL1tFUhQIFrwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=CML/vHAJywRlpmQtRMcVJ0Ctx/cAur+QCGlAeCGxQuV9lgZY2rZ/rn9Dxoz63vJdAo LeF+IrywcfrZmLEii3v7hP9SdHi+cQbRcAqOqo8nGFuWzTZ+T6EcefENaQnElYHvdWsv SaB4S296EmaMlsRI04pOlUrL2fn7UxX0wwCGQ= Received: by 10.216.15.75 with SMTP id e53mr3291447wee.107.1290381560177; Sun, 21 Nov 2010 15:19:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.234.82 with HTTP; Sun, 21 Nov 2010 15:18:59 -0800 (PST) In-Reply-To: <4CE98C7E.90301@freebsd.org> References: <4CE98C7E.90301@freebsd.org> From: Paul B Mahol Date: Sun, 21 Nov 2010 23:18:59 +0000 Message-ID: To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Remove printf in acpi_tz_sanity() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 23:19:38 -0000 On Sun, Nov 21, 2010 at 9:17 PM, Andriy Gapon wrote: > on 21/11/2010 13:07 Paul B Mahol said the following: >> This patch removes printf which spams console whenever thermal state >> is changed in laptop. Source of problem is in buggy BIOS. >> >> diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal= .c >> index 515a742..00866b2 100644 >> --- a/sys/dev/acpica/acpi_thermal.c >> +++ b/sys/dev/acpica/acpi_thermal.c >> @@ -697,11 +697,8 @@ acpi_tz_getparam(struct acpi_tz_softc *sc, char >> *node, int *data) >> =A0static void >> =A0acpi_tz_sanity(struct acpi_tz_softc *sc, int *val, char *what) >> =A0{ >> - =A0 =A0if (*val !=3D -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 2000)= ) { >> - =A0 =A0 device_printf(sc->tz_dev, "%s value is absurd, ignored (%d.%dC= )\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 what, TZ_KELVTOC(*val)); >> + =A0 =A0if (*val !=3D -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 2000)= ) >> =A0 =A0 =A0 *val =3D -1; >> - =A0 =A0} >> =A0} > > As is - this is a perfect candidate for a "local only" patch. > To be included into the tree - this, most probably, has to be controlled = by a > tunable/sysctl. So solution for useless console spamming is to add useless sysctl. For -1 values, sane default values should be picked up. Anyway only _CRT is showing on console, and _PSV & _HOT are both -1 for tz0= . I'm not first one mentioning this and issue is old several years.