* [patch] v4l: saa7134 byteorder fix
@ 2005-05-11 19:59 Gerd Knorr
2005-05-11 21:13 ` Alexey Dobriyan
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Knorr @ 2005-05-11 19:59 UTC (permalink / raw)
To: Andrew Morton, Linux Kernel Mailing List, video4linux list
Fix byteorder bug in the saa7134 driver. With that ObviouslyCorrect[tm]
patch applied the driver reportly works on powerpc.
Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
---
drivers/media/video/saa7134/saa7134-core.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.12-rc3/drivers/media/video/saa7134/saa7134-core.c
===================================================================
--- linux-2.6.12-rc3.orig/drivers/media/video/saa7134/saa7134-core.c 2005-04-26 12:18:56.000000000 +0200
+++ linux-2.6.12-rc3/drivers/media/video/saa7134/saa7134-core.c 2005-05-11 21:54:54.000000000 +0200
@@ -340,7 +340,7 @@ int saa7134_pgtable_build(struct pci_dev
ptr = pt->cpu + startpage;
for (i = 0; i < length; i++, list++)
for (p = 0; p * 4096 < list->length; p++, ptr++)
- *ptr = sg_dma_address(list) - list->offset;
+ *ptr = cpu_to_le32(sg_dma_address(list) - list->offset);
return 0;
}
--
-mm seems unusually stable at present.
-- akpm about 2.6.12-rc3-mm3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] v4l: saa7134 byteorder fix
2005-05-11 19:59 [patch] v4l: saa7134 byteorder fix Gerd Knorr
@ 2005-05-11 21:13 ` Alexey Dobriyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-05-11 21:13 UTC (permalink / raw)
To: Gerd Knorr; +Cc: Linux Kernel Mailing List, video4linux list
On Wednesday 11 May 2005 23:59, Gerd Knorr wrote:
> Fix byteorder bug in the saa7134 driver. With that ObviouslyCorrect[tm]
> patch applied the driver reportly works on powerpc.
> --- linux-2.6.12-rc3.orig/drivers/media/video/saa7134/saa7134-core.c
> +++ linux-2.6.12-rc3/drivers/media/video/saa7134/saa7134-core.c
> - *ptr = sg_dma_address(list) - list->offset;
> + *ptr = cpu_to_le32(sg_dma_address(list) - list->offset);
Clearly mark pointers to little-endian things.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
diff -uprN linux-vanilla/drivers/media/video/saa7134/saa7134-core.c linux-saa/drivers/media/video/saa7134/saa7134-core.c
--- linux-vanilla/drivers/media/video/saa7134/saa7134-core.c 2005-05-10 03:13:22.000000000 +0400
+++ linux-saa/drivers/media/video/saa7134/saa7134-core.c 2005-05-12 00:27:23.000000000 +0400
@@ -316,7 +316,7 @@ unsigned long saa7134_buffer_base(struct
int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt)
{
- u32 *cpu;
+ __le32 *cpu;
dma_addr_t dma_addr;
cpu = pci_alloc_consistent(pci, SAA7134_PGTABLE_SIZE, &dma_addr);
@@ -332,7 +332,7 @@ int saa7134_pgtable_build(struct pci_dev
struct scatterlist *list, unsigned int length,
unsigned int startpage)
{
- u32 *ptr;
+ __le32 *ptr;
unsigned int i,p;
BUG_ON(NULL == pt || NULL == pt->cpu);
diff -uprN linux-vanilla/drivers/media/video/saa7134/saa7134.h linux-saa/drivers/media/video/saa7134/saa7134.h
--- linux-vanilla/drivers/media/video/saa7134/saa7134.h 2005-05-10 03:13:22.000000000 +0400
+++ linux-saa/drivers/media/video/saa7134/saa7134.h 2005-05-12 00:26:20.000000000 +0400
@@ -241,7 +241,7 @@ struct saa7134_dma;
/* saa7134 page table */
struct saa7134_pgtable {
unsigned int size;
- u32 *cpu;
+ __le32 *cpu;
dma_addr_t dma;
};
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-11 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-11 19:59 [patch] v4l: saa7134 byteorder fix Gerd Knorr
2005-05-11 21:13 ` Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox