From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Vinod Koul <vinod.koul@intel.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Subject: Re: [PATCH v2 04/15] DMA: shdma: make a pointer const
Date: Sun, 21 Jul 2013 23:54:22 +0200 [thread overview]
Message-ID: <15445605.PE49oOgv4F@avalon> (raw)
In-Reply-To: <1374251374-30186-5-git-send-email-g.liakhovetski@gmx.de>
Hi Guennadi,
Thanks for the patch.
On Friday 19 July 2013 18:29:29 Guennadi Liakhovetski wrote:
> Platform data shouldn't be changed at run-time, so, pointers to it should
> be const.
If you move this patch to the beginning of the series you could make the pdata
structures const in 02/15 and 03/15.
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> ---
> drivers/dma/sh/shdma.h | 2 +-
> drivers/dma/sh/shdmac.c | 10 +++++-----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/dma/sh/shdma.h b/drivers/dma/sh/shdma.h
> index 82a83f8..ae0c65f 100644
> --- a/drivers/dma/sh/shdma.h
> +++ b/drivers/dma/sh/shdma.h
> @@ -36,7 +36,7 @@ struct sh_dmae_chan {
> struct sh_dmae_device {
> struct shdma_dev shdma_dev;
> struct sh_dmae_chan *chan[SH_DMAE_MAX_CHANNELS];
> - struct sh_dmae_pdata *pdata;
> + const struct sh_dmae_pdata *pdata;
> struct list_head node;
> void __iomem *chan_reg;
> void __iomem *dmars;
> diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
> index 6546bf9..859ddbe 100644
> --- a/drivers/dma/sh/shdmac.c
> +++ b/drivers/dma/sh/shdmac.c
> @@ -177,7 +177,7 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan)
> static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr)
> {
> struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
> - struct sh_dmae_pdata *pdata = shdev->pdata;
> + const struct sh_dmae_pdata *pdata = shdev->pdata;
> int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) |
> ((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift);
>
> @@ -190,7 +190,7 @@ static unsigned int calc_xmit_shift(struct sh_dmae_chan
> *sh_chan, u32 chcr) static u32 log2size_to_chcr(struct sh_dmae_chan
> *sh_chan, int l2size) {
> struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
> - struct sh_dmae_pdata *pdata = shdev->pdata;
> + const struct sh_dmae_pdata *pdata = shdev->pdata;
> int i;
>
> for (i = 0; i < pdata->ts_shift_num; i++)
> @@ -250,7 +250,7 @@ static int dmae_set_chcr(struct sh_dmae_chan *sh_chan,
> u32 val) static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
> {
> struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
> - struct sh_dmae_pdata *pdata = shdev->pdata;
> + const struct sh_dmae_pdata *pdata = shdev->pdata;
> const struct sh_dmae_channel *chan_pdata =
> &pdata->channel[sh_chan->shdma_chan.id]; void __iomem *addr = shdev->dmars;
> unsigned int shift = chan_pdata->dmars_bit;
> @@ -319,7 +319,7 @@ static const struct sh_dmae_slave_config
> *dmae_find_slave( struct sh_dmae_chan *sh_chan, int match)
> {
> struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
> - struct sh_dmae_pdata *pdata = shdev->pdata;
> + const struct sh_dmae_pdata *pdata = shdev->pdata;
> const struct sh_dmae_slave_config *cfg;
> int i;
>
> @@ -665,7 +665,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = {
>
> static int sh_dmae_probe(struct platform_device *pdev)
> {
> - struct sh_dmae_pdata *pdata;
> + const struct sh_dmae_pdata *pdata;
> unsigned long irqflags = IRQF_DISABLED,
> chan_flag[SH_DMAE_MAX_CHANNELS] = {};
> int errirq, chan_irq[SH_DMAE_MAX_CHANNELS];
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-07-21 21:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 16:29 [PATCH v2 00/15] ARM: shmobile: move DMAC configuration data in the driver Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 01/15] DMA: shdma: add support for DMAC configuration data, supplied via device ID Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 02/15] DMA: shdma: add r8a7740 DMAC data to the device ID table Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 03/15] DMA: shdma: add r8a73a4 " Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 04/15] DMA: shdma: make a pointer const Guennadi Liakhovetski
2013-07-21 21:54 ` Laurent Pinchart [this message]
2013-07-22 7:53 ` Guennadi Liakhovetski
2013-07-22 23:37 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 05/15] DMA: shdma: pass SoC-specific configuration to the driver via OF matching Guennadi Liakhovetski
2013-07-21 22:12 ` Laurent Pinchart
2013-07-22 7:29 ` Guennadi Liakhovetski
2013-07-22 23:23 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 06/15] DMA: shdma: make multiplexer platform data optional Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 07/15] DMA: shdma: add sh73a0 DMAC data to the device ID table Guennadi Liakhovetski
2013-07-20 11:28 ` [PATCH v3 " Guennadi Liakhovetski
2013-07-23 1:29 ` Simon Horman
2013-07-19 16:29 ` [PATCH v2 08/15] DMA: shdma: move two macros to a header Guennadi Liakhovetski
2013-07-21 22:16 ` Laurent Pinchart
2013-07-22 6:40 ` Guennadi Liakhovetski
2013-07-22 23:30 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 09/15] DMA: shdma: support referencing specific DMACs within a multiplexer in DT Guennadi Liakhovetski
2013-07-21 22:23 ` Laurent Pinchart
2013-07-22 6:34 ` Guennadi Liakhovetski
2013-07-22 23:35 ` Laurent Pinchart
2013-07-19 20:22 ` [PATCH v2 10/15] ARM: shmobile: r8a73a4: add a DMAC platform device and clock for it Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 11/15] ARM: shmobile: r8a7740: switch DMAC controllers to using device ID data Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 12/15] ARM: shmobile: r8a7740: add DT nodes and clock aliases for three DMAC instances Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 13/15] ARM: shmobile: r8a73a4: add a DT node and a clock alias for the DMAC Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 14/15] ARM: shmobile: sh73a0: switch DMAC controllers to using device ID data Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 15/15] ARM: shmobile: r8a7740: add support for 2 RTDMACs Guennadi Liakhovetski
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=15445605.PE49oOgv4F@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski+renesas@gmail.com \
--cc=g.liakhovetski@gmx.de \
--cc=horms@verge.net.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=vinod.koul@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox