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]
Date:	Wed, 12 Aug 2009 09:34:16 -0300
From:	Kevin Winchester <kjwinchester@...il.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	tglx@...utronix.de, mingo@...e.hu,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86, mce: therm_throt - change when we print 
	messages

2009/8/11 Dmitry Torokhov <dmitry.torokhov@...il.com>:
> On Tue, Aug 11, 2009 at 09:31:14AM -0300, Kevin Winchester wrote:
>> 2009/8/11 tip-bot for Dmitry Torokhov <dmitry.torokhov@...il.com>:
>> >  static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES;
>> >  static DEFINE_PER_CPU(unsigned long, thermal_throttle_count);
>> > +static DEFINE_PER_CPU(bool, thermal_throttle_active);
>> >
>> >  static atomic_t therm_throt_en         = ATOMIC_INIT(0);
>> >
>> > @@ -96,24 +97,27 @@ static int therm_throt_process(int curr)
>> >  {
>> >        unsigned int cpu = smp_processor_id();
>> >        __u64 tmp_jiffs = get_jiffies_64();
>> > +       bool was_throttled = __get_cpu_var(thermal_throttle_active);
>> > +       bool is_throttled = __get_cpu_var(thermal_throttle_active) = curr;
>>
>> This seems a little odd (or perhaps my lack of experience is
>> showing...) - should it be:
>>
>> bool is_throttled = __get_cpu_var(thermal_throttle_active) == curr;
>>
>> ?
>
> No, you still want to assign the value to thermal_throttle_active.
> is_throttled is just a temp so you don't need to invoke
> __get_cpu_var(thermal_throttle_active) all over the function.
>

Thanks - now I understand.  I guess I'm used to seeing:

bool a = b == c;

So it jumped out at me.

-- 
Kevin Winchester
--
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