SUPERH platform development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC][PATCH 1/4] sh-pfc: Add r8a7778 pinmux support
Date: Wed, 10 Apr 2013 08:57:08 +0000	[thread overview]
Message-ID: <3200441.QMe7rKqykn@avalon> (raw)
In-Reply-To: <8761zwb74q.wl%kuninori.morimoto.gx@renesas.com>

Hi Morimoto-san,

On Tuesday 09 April 2013 19:23:00 Kuninori Morimoto wrote:
> Hi Laurent
> 
> Thank you for your review
> I will send v2 patch which includes your point.
> 
> > > +#define SH_PFC_MUX1(name, arg1)		static const unsigned int name
> > > ##_mux[]  = { arg1##_MARK, }
> > > +#define SH_PFC_MUX2(name, arg1, arg2)	static const unsigned int name
> > > ##_mux[]  = { arg1##_MARK, arg2##_MARK, }
> > 
> > This is an interesting approach, but I'm afraid it won't scale. We will
> > have groups with more than 2 pins, and I'd like to avoid defining MUX3,
> > MUX4, ... macros.
> > 
> > One possible solution woud be to define a single SH_PFC_MUX macro with a
> > variable number of arguments, and add the _MARK suffix explicitly. The
> > other solution is to define the tables explicitly as done in the other
> > pfc-*.c files. I have no strong preference.
> 
> (snip)
> 
> > Aligning the pins and mux is nice here, but will result it way too long
> > lines later for groups with more than two pins. I'll let you decide
> > whether to keep the alignment here or not.
> 
> Thank you.
> I can agree that this SH_PFC_MUXx() is not good approach :P
> 
> But, I would like to keep readable code approach somehow.
> Then, how about below ?
> 
> #define SCIF_PFC_DATA(a, b)
> #define SCIF_PFC_CTRL(a, b)
> #define SCIF_PFC_CLK(a)
> 
> It is for "SCIF" definition,
> and, we can add new macro or raw tables (case by case)
> when we add other PFC on this file ?

That sounds very good to me. Please put the macro definitions right after the 
first
/* - SCIF ------------ ... */ line.

-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2013-04-10  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09  5:33 [RFC][PATCH 1/4] sh-pfc: Add r8a7778 pinmux support Kuninori Morimoto
2013-04-09 14:45 ` Laurent Pinchart
2013-04-10  2:23 ` Kuninori Morimoto
2013-04-10  8:57 ` Laurent Pinchart [this message]
2013-04-10  9:07 ` Kuninori Morimoto

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=3200441.QMe7rKqykn@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --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