From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 01/05] dmaengine: shdma: Remove sh_dmae_slave_chan_id enum
Date: Fri, 19 Mar 2010 08:02:49 +0000 [thread overview]
Message-ID: <aec7e5c31003190102w3584813cq5ae5f9f1007453de@mail.gmail.com> (raw)
In-Reply-To: <20100319044638.17051.97049.sendpatchset@t400s>
Hey Guennadi,
On Fri, Mar 19, 2010 at 4:30 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Fri, 19 Mar 2010, Magnus Damm wrote:
>> --- 0001/arch/sh/include/asm/dmaengine.h
>> +++ work/arch/sh/include/asm/dmaengine.h 2010-03-18 23:30:46.000000000 +0900
>> @@ -17,7 +17,7 @@
>>
>> #define SH_DMAC_MAX_CHANNELS 6
>>
>> -enum sh_dmae_slave_chan_id {
>> +enum {
>> SHDMA_SLAVE_SCIF0_TX,
>> SHDMA_SLAVE_SCIF0_RX,
>> SHDMA_SLAVE_SCIF1_TX,
>> @@ -38,7 +38,7 @@ enum sh_dmae_slave_chan_id {
>> };
>>
>> struct sh_dmae_slave_config {
>> - enum sh_dmae_slave_chan_id slave_id;
>> + unsigned int slave_id;
>
> I think, INT_MAX DMA slave IDs will be enough;) So, you could just use an
> int to save typing and to reserve -1 (or -EINVAL) as an invalid DMA ID. As
> I am currencly realising, it can be useful, e.g., if you want to enable
> DMA only on Rx and not on Tx of some device. This, of course, throughout
> this patch.
Reserving some number sounds like a good plan, but exactly what is the
best is a different question. If I'm allowed to nitpick then I think
its wasteful to use one bit for the sign when only needing one value
to mark unused. So I'd prefer to go with unsigned and 0 as unused mark
and the rest as valid ids.
>> --- 0001/drivers/dma/shdma.c
>> +++ work/drivers/dma/shdma.c 2010-03-18 23:30:46.000000000 +0900
>> @@ -266,7 +266,7 @@ static struct sh_desc *sh_dmae_get_desc(
>> }
>>
>> static struct sh_dmae_slave_config *sh_dmae_find_slave(
>> - struct sh_dmae_chan *sh_chan, enum sh_dmae_slave_chan_id slave_id)
>> + struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param)
>
> This doesn't seem to be needed, at least, not in this patch.
Well, I have to change the function to something, no? =)
Cheers,
/ magnus
next prev parent reply other threads:[~2010-03-19 8:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-19 4:46 [PATCH 01/05] dmaengine: shdma: Remove sh_dmae_slave_chan_id enum Magnus Damm
2010-03-19 7:30 ` [PATCH 01/05] dmaengine: shdma: Remove sh_dmae_slave_chan_id Guennadi Liakhovetski
2010-03-19 8:02 ` Magnus Damm [this message]
2010-03-19 8:16 ` Guennadi Liakhovetski
2010-03-19 8:23 ` [PATCH 01/05] dmaengine: shdma: Remove sh_dmae_slave_chan_id enum Paul Mundt
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=aec7e5c31003190102w3584813cq5ae5f9f1007453de@mail.gmail.com \
--to=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).