public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/5] dmaengine: sun6i: Simplify some macros
Date: Mon, 21 Mar 2016 08:48:43 +0100	[thread overview]
Message-ID: <20160321074843.GX30977@lukather> (raw)
In-Reply-To: <a25c76bc3c63afc311069366af4970b909d356ef.1458311540.git.moinejf@free.fr>

On Fri, Mar 18, 2016 at 03:21:11PM +0100, Jean-Francois Moine wrote:
> As the max burst and bus width values are now checked, there is
> no reason to check them again when setting the hardware registers.
> 
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> ---
>  drivers/dma/sun6i-dma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
> index 3f73123..643ba4c 100644
> --- a/drivers/dma/sun6i-dma.c
> +++ b/drivers/dma/sun6i-dma.c
> @@ -65,8 +65,8 @@
>  #define DMA_CHAN_CFG_SRC_DRQ(x)		((x) & 0x1f)
>  #define DMA_CHAN_CFG_SRC_IO_MODE	BIT(5)
>  #define DMA_CHAN_CFG_SRC_LINEAR_MODE	(0 << 5)
> -#define DMA_CHAN_CFG_SRC_BURST(x)	(((x) & 0x3) << 7)
> -#define DMA_CHAN_CFG_SRC_WIDTH(x)	(((x) & 0x3) << 9)
> +#define DMA_CHAN_CFG_SRC_BURST(x)	((x) << 7)
> +#define DMA_CHAN_CFG_SRC_WIDTH(x)	((x) << 9)

Well, you can easily end up with values higher than that. I still
believe that making sure you only always write what is expected is a
good thing.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160321/8f446f4c/attachment.sig>

  reply	other threads:[~2016-03-21  7:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 14:32 [PATCH v3 0/5] dmaengine: sun6i: Upgrade for audio transfers Jean-Francois Moine
2016-03-18 11:50 ` [PATCH v3 1/5] dmaengine: sun6i: Simplify and fix lli setting Jean-Francois Moine
2016-03-21  7:27   ` Maxime Ripard
2016-03-18 14:12 ` [PATCH v3 2/5] dmaengine: sun6i: Add 4 as a possible burst value for the H3 Jean-Francois Moine
2016-03-21  7:29   ` Maxime Ripard
2016-03-21  8:35     ` Jean-Francois Moine
2016-03-29  6:46       ` Maxime Ripard
2016-03-29  9:03         ` Jean-Francois Moine
2016-03-18 14:18 ` [PATCH v3 3/5] dmaengine: sun6i: Add cyclic capability Jean-Francois Moine
2016-03-21  7:33   ` Maxime Ripard
2016-03-18 14:21 ` [PATCH v3 4/5] dmaengine: sun6i: Simplify some macros Jean-Francois Moine
2016-03-21  7:48   ` Maxime Ripard [this message]
2016-03-21 14:40     ` Jean-Francois Moine
2016-03-18 14:25 ` [PATCH v3 5/5] dmaengine: sun6i: Compact a bit some config constants Jean-Francois Moine

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=20160321074843.GX30977@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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