All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
Cc: linux-mmc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	cbouatmailru@gmail.com, cjb@laptop.org, AFLEMING@freescale.com,
	r39252@freescale.com, X.Xie@freescale.com,
	Haijun Zhang <Haijun.Zhang@freescale.com>,
	Zhao Chenhui <chenhui.zhao@freescale.com>
Subject: Re: [PATCH 1/4 V2] powerpc/85xx: Add support for 85xx cpu type detection
Date: Wed, 10 Jul 2013 16:48:13 -0500	[thread overview]
Message-ID: <1373492893.8183.236@snotra> (raw)
In-Reply-To: <1373441941-32650-1-git-send-email-Haijun.Zhang@freescale.com> (from Haijun.Zhang@freescale.com on Wed Jul 10 02:39:01 2013)

On 07/10/2013 02:39:01 AM, Haijun Zhang wrote:
> +/* Get current SOC Version */
> +#define GET_SVR()	(mfspr(SPRN_SVR))

Unnecessary parens.  Why do we need GET_SVR(), versus opencoding it?   
Note that U-Boot (which this is patterned after) doesn't have  
GET_SVR(), so code that wants to work on both can't use it anyway.

> +#define IS_SVR_REV(svr, maj, min) \
> +	((SVR_MAJ(svr) == (maj)) && (SVR_MIN(svr) == (min)))

I don't think IS_SVR_REV is needed.  Callers can just do "if  
(SVR_REV(svr) == 0x30)" or whatever, especially since we're relying on  
them to do this for greater/less than comparisons.

-Scott

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Haijun Zhang <Haijun.Zhang@freescale.com>
Cc: Zhao Chenhui <chenhui.zhao@freescale.com>,
	linux-mmc@vger.kernel.org, r39252@freescale.com,
	AFLEMING@freescale.com, Haijun Zhang <Haijun.Zhang@freescale.com>,
	cbouatmailru@gmail.com, cjb@laptop.org,
	linuxppc-dev@lists.ozlabs.org, X.Xie@freescale.com
Subject: Re: [PATCH 1/4 V2] powerpc/85xx: Add support for 85xx cpu type detection
Date: Wed, 10 Jul 2013 16:48:13 -0500	[thread overview]
Message-ID: <1373492893.8183.236@snotra> (raw)
In-Reply-To: <1373441941-32650-1-git-send-email-Haijun.Zhang@freescale.com> (from Haijun.Zhang@freescale.com on Wed Jul 10 02:39:01 2013)

On 07/10/2013 02:39:01 AM, Haijun Zhang wrote:
> +/* Get current SOC Version */
> +#define GET_SVR()	(mfspr(SPRN_SVR))

Unnecessary parens.  Why do we need GET_SVR(), versus opencoding it?  =20
Note that U-Boot (which this is patterned after) doesn't have =20
GET_SVR(), so code that wants to work on both can't use it anyway.

> +#define IS_SVR_REV(svr, maj, min) \
> +	((SVR_MAJ(svr) =3D=3D (maj)) && (SVR_MIN(svr) =3D=3D (min)))

I don't think IS_SVR_REV is needed.  Callers can just do "if =20
(SVR_REV(svr) =3D=3D 0x30)" or whatever, especially since we're relying on =
=20
them to do this for greater/less than comparisons.

-Scott=

  reply	other threads:[~2013-07-10 21:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10  7:39 [PATCH 1/4 V2] powerpc/85xx: Add support for 85xx cpu type detection Haijun Zhang
2013-07-10  7:39 ` Haijun Zhang
2013-07-10 21:48 ` Scott Wood [this message]
2013-07-10 21:48   ` Scott Wood
2013-07-11  8:43   ` David Laight
2013-07-11  8:43     ` David Laight
2013-07-11  9:02     ` Zhang Haijun-B42677
2013-07-11  9:02       ` Zhang Haijun-B42677
2013-07-11 14:15     ` Scott Wood
2013-07-11 14:15       ` Scott Wood

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=1373492893.8183.236@snotra \
    --to=scottwood@freescale.com \
    --cc=AFLEMING@freescale.com \
    --cc=Haijun.Zhang@freescale.com \
    --cc=X.Xie@freescale.com \
    --cc=cbouatmailru@gmail.com \
    --cc=chenhui.zhao@freescale.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=r39252@freescale.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.