lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3292933.Vhp5q9ibyJ@vostro.rjw.lan>
Date:	Mon, 17 Dec 2012 13:09:48 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Sivaram Nair <sivaramn@...dia.com>
Cc:	"rafael.j.wysocki@...el.com" <rafael.j.wysocki@...el.com>,
	"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
	"shuox.liu@...el.com" <shuox.liu@...el.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"yanmin_zhang@...el.com" <yanmin_zhang@...el.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] cpuidle: fix sysfs output for power_usage

On Monday, December 17, 2012 10:46:07 AM Sivaram Nair wrote:
> On Mon, Dec 17, 2012 at 08:56:45AM +0100, Rafael J. Wysocki wrote:
> > On Monday, December 17, 2012 09:38:15 AM Sivaram Nair wrote:
> > > On Sat, Dec 15, 2012 at 01:03:02AM +0100, Rafael J. Wysocki wrote:
> > > > On Friday, December 14, 2012 03:17:37 PM Sivaram Nair wrote:
> > > > > cpuidle_state->power_usage is signed; so change the corresponding sysfs
> > > > > ops to output signed value instead of unsigned.
> > > > 
> > > > What's actually wrong with printing it as an unsigned int?
> > > 
> > > power_usage could have negative values (for example cpuidle/driver.c
> > > inits this value to -1, -2 etc. when drv->power_specified is not set) and
> > > these shows up badly in the sysfs output.
> > 
> > Does "badly" mean "as big positive numbers"?
> 
> Yes (sorry for not being clearer).
> 
> > 
> > Should we actually print them at all in those case?  Perhaps it'll be better to
> > make the file appear empty then?
> 
> May be, but why is power_usage signed in the first place?

Please read the comment in driver.c:set_power_states() for the answer. :-)

> I also noticed
> Daniel Lezcano's patches that reduces the scope of this variable. So,
> perhaps we can just ignore this change.

OK

Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ