All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Sanjeev Premi <premi@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/1] omap2/3: Update revision identification
Date: Thu, 23 Sep 2010 09:56:37 -0700	[thread overview]
Message-ID: <20100923165636.GL4211@atomide.com> (raw)
In-Reply-To: <1281973989-2484-1-git-send-email-premi@ti.com>

* Sanjeev Premi <premi@ti.com> [100816 08:46]:
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
> @@ -366,21 +366,23 @@ static void __init omap3_cpuinfo(void)
>  		strcpy(cpu_rev, "1.0");
>  		break;
>  	case OMAP_REVBITS_01:
> -		strcpy(cpu_rev, "1.1");
> +		if (cpu_is_omap3630()) {
> +			strcpy(cpu_rev, "1.1");
> +		} else {
> +			strcpy(cpu_rev, "2.0");
> +		}
>  		break;

No { } brackets needed if it's one line + one line if else
statement.

>  	case OMAP_REVBITS_02:
> -		strcpy(cpu_rev, "1.2");
> -		break;
> -	case OMAP_REVBITS_10:
> -		strcpy(cpu_rev, "2.0");
> -		break;
> -	case OMAP_REVBITS_20:
> -		strcpy(cpu_rev, "2.1");
> +		if (cpu_is_omap3630()) {
> +			strcpy(cpu_rev, "1.2");
> +		} else {
> +			strcpy(cpu_rev, "2.1");
> +		}
>  		break;

Not needed here either.

> -	case OMAP_REVBITS_30:
> +	case OMAP_REVBITS_03:
>  		strcpy(cpu_rev, "3.0");
>  		break;
> -	case OMAP_REVBITS_40:
> +	case OMAP_REVBITS_04:
>  	/* FALLTHROUGH */
>  	default:
>  		/* Use the latest known revision as default */

Also, maybe just set a separate switch for 36xx?

In the long run it's best to avoid sprinkiling the cpu_is_omapxxxx
tests as that adds more places to patch when new omap xyz is
added.

> -#define OMAP2420_REV_ES2_0	0x24201024
> +#define OMAP2420_REV_ES1_0	(OMAP242X_CLASS)
> +#define OMAP2420_REV_ES2_0	(OMAP242X_CLASS | (OMAP_REVBITS_01 << 8))

No parens needed around OMAP242X_CLASS if it's just one value.
  
>  #define OMAP243X_CLASS		0x24300024
> -#define OMAP2430_REV_ES1_0	0x24300024
> +#define OMAP2430_REV_ES1_0	(OMAP243X_CLASS)

Not needed around OMAP243X_CLASS either. Please check
the other places too.

Regards,

Tony  

      parent reply	other threads:[~2010-09-23 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 15:53 [PATCH 1/1] omap2/3: Update revision identification Sanjeev Premi
2010-09-03  8:21 ` Premi, Sanjeev
2010-09-23 16:56 ` Tony Lindgren [this message]

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=20100923165636.GL4211@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=premi@ti.com \
    /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.