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] [thread-next>] [day] [month] [year] [list]
Message-ID: <500DA7EB.1030608@linaro.org>
Date:	Mon, 23 Jul 2012 12:37:15 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	Ingo Molnar <mingo@...nel.org>
CC:	lkml <linux-kernel@...r.kernel.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Richard Cochran <richardcochran@...il.com>,
	Prarit Bhargava <prarit@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 1/2] jiffies: Allow CLOCK_TICK_RATE to be undefined

On 07/19/2012 02:37 AM, Ingo Molnar wrote:
> * John Stultz <john.stultz@...aro.org> wrote:
>
>> From: Catalin Marinas <catalin.marinas@....com>
...
>> diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
>> index 265e2c3..a2134be 100644
>> --- a/include/linux/jiffies.h
>> +++ b/include/linux/jiffies.h
>> @@ -39,9 +39,6 @@
>>   # error Invalid value of HZ.
>>   #endif
>>   
>> -/* LATCH is used in the interval timer and ftape setup. */
>> -#define LATCH  ((CLOCK_TICK_RATE + HZ/2) / HZ)	/* For divider */
>> -
>>   /* Suppose we want to divide two numbers NOM and DEN: NOM/DEN, then we can
>>    * improve accuracy by shifting LSH bits, hence calculating:
>>    *     (NOM << LSH) / DEN
>> @@ -54,8 +51,15 @@
>>   #define SH_DIV(NOM,DEN,LSH) (   (((NOM) / (DEN)) << (LSH))              \
>>                                + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
>>   
>> +#ifdef CLOCK_TICK_RATE
>> +/* LATCH is used in the interval timer and ftape setup. */
>> +#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ)	/* For divider */
>> +
>>   /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
>>   #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
>> +#else
>> +#define ACTHZ (HZ << 8)
>> +#endif
> The ACTHZ naming ugliness slipped past me. 'ACT' can mean so
> many things - please improve it to something more obvious, like
> 'REAL_HZ' or 'KERNEL_HZ'.

ACTHZ has been around for a while. ~2002 I think?

Is it ok if I do the rename in a following patch?

> Also, we tend to write such #if/#else/#endif patterns as:
>
> #if FOO
> # define BAR
> #else
> # define BAZ
> #endif
I'll fix this.

Thanks for the review
-john

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