All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
Date: Fri, 4 May 2012 22:34:44 +0800	[thread overview]
Message-ID: <20120504143442.GL2194@S2101-09.ap.freescale.net> (raw)
In-Reply-To: <201205041415.04095.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> >  static int __init mxs_add_mxs_dma(void)
> >  {
> > -	char *apbh = "mxs-dma-apbh";
> > -	char *apbx = "mxs-dma-apbx";
> > +	char *mx23_apbh = "imx23-dma-apbh";
> > +	char *mx23_apbx = "imx23-dma-apbx";
> > +	char *mx28_apbh = "imx28-dma-apbh";
> > +	char *mx28_apbx = "imx28-dma-apbx";
> 
> Wild guess ... but const char * won't hurt here ?
> 
Right.  I guess it just followed how the existing code looks like.
Considering this whole function will be removed patch #4, it should
not be a big problem, I guess.

> > -#define MXS_DMA_APBH		0
> > -#define MXS_DMA_APBX		1
> > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > -
> > -#define APBH_VERSION_LATEST	3
> > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> > 
...
> > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > +{
> > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> 
> Do you need the above here ? :)
> 
I have to confess it's my bad.  I made the code hard to read when I
created the driver.  The dma_is_apbh() should really takes mxs_dma
as a parameter than hiding it in the macro.

While I agree this is something should be improved, it may be better
to do it in another patch?

> > +
> > +	return dma_is_apbh();
> > +}

-- 
Regards,
Shawn

WARNING: multiple messages have this Message-ID (diff)
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
Date: Fri, 4 May 2012 22:34:44 +0800	[thread overview]
Message-ID: <20120504143442.GL2194@S2101-09.ap.freescale.net> (raw)
In-Reply-To: <201205041415.04095.marek.vasut@gmail.com>

On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> >  static int __init mxs_add_mxs_dma(void)
> >  {
> > -	char *apbh = "mxs-dma-apbh";
> > -	char *apbx = "mxs-dma-apbx";
> > +	char *mx23_apbh = "imx23-dma-apbh";
> > +	char *mx23_apbx = "imx23-dma-apbx";
> > +	char *mx28_apbh = "imx28-dma-apbh";
> > +	char *mx28_apbx = "imx28-dma-apbx";
> 
> Wild guess ... but const char * won't hurt here ?
> 
Right.  I guess it just followed how the existing code looks like.
Considering this whole function will be removed patch #4, it should
not be a big problem, I guess.

> > -#define MXS_DMA_APBH		0
> > -#define MXS_DMA_APBX		1
> > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > -
> > -#define APBH_VERSION_LATEST	3
> > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> > 
...
> > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > +{
> > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> 
> Do you need the above here ? :)
> 
I have to confess it's my bad.  I made the code hard to read when I
created the driver.  The dma_is_apbh() should really takes mxs_dma
as a parameter than hiding it in the macro.

While I agree this is something should be improved, it may be better
to do it in another patch?

> > +
> > +	return dma_is_apbh();
> > +}

-- 
Regards,
Shawn

  parent reply	other threads:[~2012-05-04 14:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 12:12 [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-05-04 12:12 ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found]   ` <1336133539-13465-2-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:15     ` Marek Vasut
2012-05-04 12:15       ` Marek Vasut
     [not found]       ` <201205041415.04095.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-04 14:34         ` Shawn Guo [this message]
2012-05-04 14:34           ` Shawn Guo
     [not found]           ` <20120504143442.GL2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-05 13:12             ` Marek Vasut
2012-05-05 13:12               ` Marek Vasut
     [not found]               ` <201205051512.17972.marex-ynQEQJNshbs@public.gmane.org>
2012-05-05 13:25                 ` Shawn Guo
2012-05-05 13:25                   ` Shawn Guo
     [not found]                   ` <CAAQ0ZWTztNaqwjVA257N+42PByhH1k1Gswi18S9G=dHEaO5PhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-05 14:32                     ` Marek Vasut
2012-05-05 14:32                       ` Marek Vasut
     [not found]                       ` <201205051632.14882.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  3:55                         ` Dong Aisheng
2012-05-07  3:55                           ` Dong Aisheng
     [not found]                           ` <20120507035558.GB31245-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:52                             ` Shawn Guo
2012-05-07  3:52                               ` Shawn Guo
     [not found]                               ` <CAAQ0ZWSh8PL36VAQHY1NJLr+0fubkWY-LpNKZk6HOu+Hbxngiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07  4:07                                 ` Marek Vasut
2012-05-07  4:07                                   ` Marek Vasut
     [not found]                                   ` <201205070607.58855.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  4:14                                     ` Shawn Guo
2012-05-07  4:14                                       ` Shawn Guo
2012-05-04 12:12 ` [PATCH v2 3/5] dma: mxs-dma: add device tree probe support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 5/5] ARM: mx28evk: add mxs-dma dt support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found] ` <1336133539-13465-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:12   ` [PATCH v2 4/5] ARM: mxs: do not add dma device by default Dong Aisheng
2012-05-04 12:12     ` Dong Aisheng
2012-05-04 14:44   ` [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Shawn Guo
2012-05-04 14:44     ` Shawn Guo
     [not found]     ` <20120504144453.GM2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:20       ` Dong Aisheng
2012-05-07  3:20         ` Dong Aisheng
2012-05-04 16:02   ` Wolfram Sang
2012-05-04 16:02     ` Wolfram Sang

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=20120504143442.GL2194@S2101-09.ap.freescale.net \
    --to=shawn.guo-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 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.