[1/3] x86: cpu: Use constant definitions for CPU type
diff mbox series

Message ID bb09309eb9b4de8b8eff83d00d34c135b048fe25.1565856842.git.rahul.tanwar@linux.intel.com
State New
Headers show
Series
  • x86: cpu: Add new Airmont CPU model
Related show

Commit Message

Tanwar, Rahul Aug. 15, 2019, 9:46 a.m. UTC
This patch replaces direct values usage with constant definitions usage
when access CPU models.

Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
---
 arch/x86/kernel/cpu/intel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Thomas Gleixner Aug. 15, 2019, 10:31 a.m. UTC | #1
Rahul,

On Thu, 15 Aug 2019, Rahul Tanwar wrote:

Please use the proper prefix for your patches. x86 uses

x86/subsystem: not x86: subsystem:

> This patch replaces direct values usage with constant definitions usage
> when access CPU models.

Please do not use 'This patch'. We already know that this is a patch
otherwise you wouldn't have sent it with [PATCH] on the subject line,
right?

See Documentation/process/submitting-patches.rst and search for 'This
patch'.

> Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> ---
>  arch/x86/kernel/cpu/intel.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 8d6d92ebeb54..0419fba1ea56 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -265,9 +265,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
>  	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
>  	if (c->x86 == 6) {
>  		switch (c->x86_model) {
> -		case 0x27:	/* Penwell */
> -		case 0x35:	/* Cloverview */
> -		case 0x4a:	/* Merrifield */
> +		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
> +		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
> +		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */

Are these comments really still useful now that the defines are used? I
don't think so.

Thanks,

	tglx
Tanwar, Rahul Aug. 16, 2019, 3:17 a.m. UTC | #2
Hi Thomas,


Thanks for your comments.


On 15/8/2019 6:31 PM, Thomas Gleixner wrote:
> Rahul,
>
> On Thu, 15 Aug 2019, Rahul Tanwar wrote:
>
> Please use the proper prefix for your patches. x86 uses
>
> x86/subsystem: not x86: subsystem:


Well noted.


>> This patch replaces direct values usage with constant definitions usage
>> when access CPU models.
> Please do not use 'This patch'. We already know that this is a patch
> otherwise you wouldn't have sent it with [PATCH] on the subject line,
> right?
>
> See Documentation/process/submitting-patches.rst and search for 'This
> patch'.


Well noted.


>> Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
>> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>> ---
>>   arch/x86/kernel/cpu/intel.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
>> index 8d6d92ebeb54..0419fba1ea56 100644
>> --- a/arch/x86/kernel/cpu/intel.c
>> +++ b/arch/x86/kernel/cpu/intel.c
>> @@ -265,9 +265,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
>>   	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
>>   	if (c->x86 == 6) {
>>   		switch (c->x86_model) {
>> -		case 0x27:	/* Penwell */
>> -		case 0x35:	/* Cloverview */
>> -		case 0x4a:	/* Merrifield */
>> +		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
>> +		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
>> +		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */
> Are these comments really still useful now that the defines are used? I
> don't think so.


Agree that these comments can be removed here. These comments are useful to

associate the CPU model with the product name. But, i think, the right 
place to have

these comments is intel-family.h. I will remove these comments from here 
in V2.


Regards,

Rahul

Patch
diff mbox series

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 8d6d92ebeb54..0419fba1ea56 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -265,9 +265,9 @@  static void early_init_intel(struct cpuinfo_x86 *c)
 	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
 	if (c->x86 == 6) {
 		switch (c->x86_model) {
-		case 0x27:	/* Penwell */
-		case 0x35:	/* Cloverview */
-		case 0x4a:	/* Merrifield */
+		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
+		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
+		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */
 			set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
 			break;
 		default: