All of lore.kernel.org
 help / color / mirror / Atom feed
From: jingchang.lu@freescale.com (Jingchang Lu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G	support in big-endian model
Date: Tue, 23 Sep 2014 17:21:06 +0000	[thread overview]
Message-ID: <1411492862884.42316@freescale.com> (raw)
In-Reply-To: <20140923103721.GQ5182@n2100.arm.linux.org.uk>

_______________________________________
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
Sent: Tuesday, September 23, 2014 6:37 PM
To: Lu Jingchang-B35083
Cc: vinod.koul at intel.com; dmaengine at vger.kernel.org; linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G   support in big-endian model

On Tue, Sep 23, 2014 at 05:15:19PM +0800, Jingchang Lu wrote:
>  static u16 edma_readw(struct fsl_edma_engine *edma, void __iomem *addr)
>  {
> -     if (edma->big_endian)
> -             return ioread16be(addr);
> -     else
> +     u32 dst;

This should be unsigned long, if it needs to exist.

> +     /* swap the reg offset for these in big-endian mode */
> +     if (edma->big_endian) {
> +             dst = ((u32)addr & ~0x3) | (((u32)addr & 0x3) ^ 0x2);

This can be simplified to:

                addr = (void __iomem *)((unsigned long)addr ^ 2);

Ditto for all the other cases.

I will do that, Thanks.

Best Regards,
Jingchang

WARNING: multiple messages have this Message-ID (diff)
From: Jingchang Lu <jingchang.lu@freescale.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "vinod.koul@intel.com" <vinod.koul@intel.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G	support in big-endian model
Date: Tue, 23 Sep 2014 17:21:06 +0000	[thread overview]
Message-ID: <1411492862884.42316@freescale.com> (raw)
In-Reply-To: <20140923103721.GQ5182@n2100.arm.linux.org.uk>

_______________________________________
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
Sent: Tuesday, September 23, 2014 6:37 PM
To: Lu Jingchang-B35083
Cc: vinod.koul@intel.com; dmaengine@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G   support in big-endian model

On Tue, Sep 23, 2014 at 05:15:19PM +0800, Jingchang Lu wrote:
>  static u16 edma_readw(struct fsl_edma_engine *edma, void __iomem *addr)
>  {
> -     if (edma->big_endian)
> -             return ioread16be(addr);
> -     else
> +     u32 dst;

This should be unsigned long, if it needs to exist.

> +     /* swap the reg offset for these in big-endian mode */
> +     if (edma->big_endian) {
> +             dst = ((u32)addr & ~0x3) | (((u32)addr & 0x3) ^ 0x2);

This can be simplified to:

                addr = (void __iomem *)((unsigned long)addr ^ 2);

Ditto for all the other cases.

I will do that, Thanks.

Best Regards,
Jingchang


  reply	other threads:[~2014-09-23 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  9:15 [PATCH] dmaengine: fsl-edma: fixup reg offset and hw S/G support in big-endian model Jingchang Lu
2014-09-23  9:15 ` Jingchang Lu
2014-09-23 10:37 ` Russell King - ARM Linux
2014-09-23 10:37   ` Russell King - ARM Linux
2014-09-23 17:21   ` Jingchang Lu [this message]
2014-09-23 17:21     ` Jingchang Lu
2014-09-23 12:30 ` Arnd Bergmann
2014-09-23 12:30   ` Arnd Bergmann
2014-09-23 17:18   ` Jingchang Lu
2014-09-23 17:18     ` Jingchang Lu
2014-09-23 18:23     ` Arnd Bergmann
2014-09-23 18:23       ` Arnd Bergmann

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=1411492862884.42316@freescale.com \
    --to=jingchang.lu@freescale.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.