All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ferron <chris.e.ferron at linux.intel.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] Fix backlight usage reporting when backlight control is not supported
Date: Mon, 13 Aug 2012 10:33:53 -0700	[thread overview]
Message-ID: <50293A81.6050607@linux.intel.com> (raw)
In-Reply-To: 1344876549-13923-1-git-send-email-i.zhbanov@samsung.com

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

On 08/13/2012 09:49 AM, Igor Zhbanov wrote:
> On PC file /sys/class/backlight/.../max_brightness can contain 0
> when backlight control is not supported. Added check helps to avoid
> dividing by zero and printing NaN.
> ---
>   src/devices/backlight.cpp |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/devices/backlight.cpp b/src/devices/backlight.cpp
> index b8c9147..82cb1e0 100644
> --- a/src/devices/backlight.cpp
> +++ b/src/devices/backlight.cpp
> @@ -145,6 +145,9 @@ double backlight::utilization(void)
>   {
>   	double p;
>   
> +	if (max_level == 0)
> +		return 0.0;
> +
>   	p = 100.0 * (end_level + start_level) / 2 / max_level;
>   	return p;
>   }
Igor,
    Thank you for the patches, but in the future please send like 
patches in series and be more verbose in your commit messages.

Thanks
Chris Ferron


             reply	other threads:[~2012-08-13 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 17:33 Chris Ferron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-13 16:49 [Powertop] [PATCH] Fix backlight usage reporting when backlight control is not supported Igor Zhbanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50293A81.6050607@linux.intel.com \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.