[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20141007.131646.1417551297088545264.davem@davemloft.net>
Date: Tue, 07 Oct 2014 13:16:46 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: sylvain.hitier@...il.com
Cc: linux-kernel@...r.kernel.org, nhorman@...driver.com,
mroos@...ux.ee, netdev@...r.kernel.org,
klassert@...hematik.tu-chemnitz.de
Subject: Re: [PATCH RESEND v3] 3c59x: fix bad split of
cpu_to_le32(pci_map_single())
From: Sylvain 'ythier' Hitier <sylvain.hitier@...il.com>
Date: Tue, 7 Oct 2014 13:40:34 +0000
> From: Sylvain "ythier" Hitier <sylvain.hitier@...il.com>
>
> In commit 6f2b6a3005b2c34c39f207a87667564f64f2f91a,
> # 3c59x: Add dma error checking and recovery
> the intent is to split out the mapping from the byte-swapping in order to
> insert a dma_mapping_error() check.
>
> Kinda this semantic patch:
>
> // See http://coccinelle.lip6.fr/
> //
> // Beware, grouik-and-dirty!
> @@
> expression DEV, X, Y, Z;
> @@
> - cpu_to_le32(pci_map_single(DEV, X, Y, Z))
> + dma_addr_t addr = pci_map_single(DEV, X, Y, Z);
> + if (dma_mapping_error(&DEV->dev, addr))
> + /* snip */;
> + cpu_to_le32(addr)
>
> However, the #else part (of the #if DO_ZEROCOPY test) is changed this way:
>
> - cpu_to_le32(pci_map_single(DEV, X, Y, Z))
> + dma_addr_t addr = cpu_to_le32(pci_map_single(DEV, X, Y, Z));
> // ^^^^^^^^^^^
> // That mismatches the 3 other changes!
> + if (dma_mapping_error(&DEV->dev, addr))
> + /* snip */;
> + cpu_to_le32(addr)
>
> Let's remove the leftover cpu_to_le32() for coherency.
>
> v2: Better changelog.
> v3: Add Acked-by
>
> Fixes: 6f2b6a3005b2c34c39f207a87667564f64f2f91a
> # 3c59x: Add dma error checking and recovery
> Acked-by: Neil Horman <nhorman@...driver.com>
> Signed-off-by: Sylvain "ythier" Hitier <sylvain.hitier@...il.com>
Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists