From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] dmaengine: Add an enum for the dmaengine alignment constraints
Date: Mon, 20 Jul 2015 11:03:25 +0200 [thread overview]
Message-ID: <20150720110325.502af335@free-electrons.com> (raw)
In-Reply-To: <1437381693-18948-1-git-send-email-maxime.ripard@free-electrons.com>
Maxime,
On Mon, 20 Jul 2015 10:41:32 +0200, Maxime Ripard wrote:
> /**
> + * enum dmaengine_alignment - defines alignment of the DMA async tx
> + * buffers
> + */
> +enum dmaengine_alignment {
> + DMAENGINE_ALIGN_1_BYTE = 0,
> + DMAENGINE_ALIGN_2_BYTES = 1,
> + DMAENGINE_ALIGN_4_BYTES = 2,
> + DMAENGINE_ALIGN_8_BYTES = 3,
> + DMAENGINE_ALIGN_16_BYTES = 4,
> + DMAENGINE_ALIGN_32_BYTES = 5,
> + DMAENGINE_ALIGN_64_BYTES = 6,
> +};
Sorry I didn't think about this during the first iteration, but this
define is just the log2 of the values, no? So maybe you could simply do
something like:
static inline unsigned int dmaengine_alignment(size_t bytes)
{
return ilog2(bytes);
}
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Ludovic Desroches <ludovic.desroches@atmel.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] dmaengine: Add an enum for the dmaengine alignment constraints
Date: Mon, 20 Jul 2015 11:03:25 +0200 [thread overview]
Message-ID: <20150720110325.502af335@free-electrons.com> (raw)
In-Reply-To: <1437381693-18948-1-git-send-email-maxime.ripard@free-electrons.com>
Maxime,
On Mon, 20 Jul 2015 10:41:32 +0200, Maxime Ripard wrote:
> /**
> + * enum dmaengine_alignment - defines alignment of the DMA async tx
> + * buffers
> + */
> +enum dmaengine_alignment {
> + DMAENGINE_ALIGN_1_BYTE = 0,
> + DMAENGINE_ALIGN_2_BYTES = 1,
> + DMAENGINE_ALIGN_4_BYTES = 2,
> + DMAENGINE_ALIGN_8_BYTES = 3,
> + DMAENGINE_ALIGN_16_BYTES = 4,
> + DMAENGINE_ALIGN_32_BYTES = 5,
> + DMAENGINE_ALIGN_64_BYTES = 6,
> +};
Sorry I didn't think about this during the first iteration, but this
define is just the log2 of the values, no? So maybe you could simply do
something like:
static inline unsigned int dmaengine_alignment(size_t bytes)
{
return ilog2(bytes);
}
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-07-20 9:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 8:41 [PATCH v2 1/2] dmaengine: Add an enum for the dmaengine alignment constraints Maxime Ripard
2015-07-20 8:41 ` Maxime Ripard
2015-07-20 9:03 ` Thomas Petazzoni [this message]
2015-07-20 9:03 ` Thomas Petazzoni
2015-07-27 6:48 ` Maxime Ripard
2015-07-27 6:48 ` Maxime Ripard
2015-07-27 7:09 ` Thomas Petazzoni
2015-07-27 7:09 ` Thomas Petazzoni
2015-08-05 5:26 ` Vinod Koul
2015-08-05 5:26 ` Vinod Koul
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=20150720110325.502af335@free-electrons.com \
--to=thomas.petazzoni@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 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.