SUPERH platform development
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 2.2/5 v2] ARM: mach-shmobile: R-Mobile A1 PFC support.
Date: Mon, 07 Nov 2011 04:44:01 +0000	[thread overview]
Message-ID: <20111107044401.GB3927@linux-sh.org> (raw)
In-Reply-To: <871utksrir.wl%kuninori.morimoto.gx@renesas.com>

On Sun, Nov 06, 2011 at 04:30:39PM -0800, Kuninori Morimoto wrote:
> +#define _1(fn, pfx, sfx) fn(pfx, sfx)
> +
> +#define _10(fn, pfx, sfx)				\
> +	_1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx),	\
> +	_1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx),	\
> +	_1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx),	\
> +	_1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx),	\
> +	_1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
> +
..

> +
> +#define _PORT(pfx, sfx) pfx##_##sfx
> +
Perhaps these are better off moved in to a pfc helper header, before we
start copying them all over the place.

> +#define _IO___(nr) \
> +	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,	\
> +		    PORT##nr##_OUT, PORT##nr##_IN)
> +
> +#define _IO__D(nr) \
> +	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,	\
> +		    PORT##nr##_OUT, PORT##nr##_IN, PORT##nr##_IN_PD)
> +
> +#define _IO_U_(nr) \
> +	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,	\
> +		    PORT##nr##_OUT, PORT##nr##_IN, PORT##nr##_IN_PU)
> +
> +#define _IO_UD(nr) \
> +	PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,	\
> +		    PORT##nr##_OUT, PORT##nr##_IN,	\
> +		    PORT##nr##_IN_PD, PORT##nr##_IN_PU)
> +
Likewise for these.

You can just move the definitions out from pfc-sh7367.c and stick with
the verbose names. There's very little value in this sort of obfuscation.

> +/* helper for top 4 bits in PORTnCR */
> +#define PCRH(in, in_pd, in_pu, out)	\
> +	0, (out), (in), 0,		\
> +	0, 0, 0, 0,			\
> +	0, 0, (in_pd), 0,		\
> +	0, 0, (in_pu), 0
> +
> +#define PORTCR(nr, reg)	\
> +	{ PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {		\
> +		PCRH(PORT##nr##_IN,  PORT##nr##_IN_PD,		\
> +		     PORT##nr##_IN_PU, PORT##nr##_OUT),		\
> +		PORT##nr##_FN0, PORT##nr##_FN1,	PORT##nr##_FN2,	\
> +		PORT##nr##_FN3,	PORT##nr##_FN4, PORT##nr##_FN5,	\
> +		PORT##nr##_FN6, PORT##nr##_FN7 }		\
> +	}
> +
These too.

      reply	other threads:[~2011-11-07  4:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07  0:30 [PATCH 2.2/5 v2] ARM: mach-shmobile: R-Mobile A1 PFC support Kuninori Morimoto
2011-11-07  4:44 ` Paul Mundt [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=20111107044401.GB3927@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox