RE: Magic in videobuf

2010-03-17 Thread Pawel Osciak
Hans Verkuil wrote: Andy Walls wrote: On Mon, 2010-03-15 at 14:26 -0300, Mauro Carvalho Chehab wrote: Hans Verkuil wrote: Hans Verkuil wrote: Pawel Osciak wrote: is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as

Re: Magic in videobuf

2010-03-17 Thread Hans Verkuil
On Wednesday 17 March 2010 07:50:27 Pawel Osciak wrote: That is my opinion, yes. However, there is one case where this is actually useful. Take for example the function videobuf_to_dma in videobuf-dma-sg.c. This is called by drivers and it makes sense that that function should double-check that

RE: Magic in videobuf

2010-03-16 Thread Pawel Osciak
Andy Walls wrote: On Mon, 2010-03-15 at 14:26 -0300, Mauro Carvalho Chehab wrote: Hans Verkuil wrote: Hans Verkuil wrote: Pawel Osciak wrote: is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as we weren't able to

RE: Magic in videobuf

2010-03-16 Thread Pawel Osciak
Mauro Carvalho Chehab wrote: is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as we weren't able to find any particular use for them when we were discussing this at the memory handling meeting in Norway... It is a sort of

RE: Magic in videobuf

2010-03-16 Thread Hans Verkuil
Andy Walls wrote: On Mon, 2010-03-15 at 14:26 -0300, Mauro Carvalho Chehab wrote: Hans Verkuil wrote: Hans Verkuil wrote: Pawel Osciak wrote: is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as we weren't able

Re: Magic in videobuf

2010-03-16 Thread Devin Heitmueller
On Tue, Mar 16, 2010 at 12:35 PM, Hans Verkuil hverk...@xs4all.nl wrote: That is my opinion, yes. However, there is one case where this is actually useful. Take for example the function videobuf_to_dma in videobuf-dma-sg.c. This is called by drivers and it makes sense that that function should

Magic in videobuf

2010-03-15 Thread Pawel Osciak
Hello, is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as we weren't able to find any particular use for them when we were discussing this at the memory handling meeting in Norway... Best regards -- Pawel Osciak Linux

Re: Magic in videobuf

2010-03-15 Thread Mauro Carvalho Chehab
bad. The real situation will depend on how fragmented is the memory. It pollutes the code There are only 18 occurences of MAGIC* at a given videobuf driver: $ grep MAGIC ~v4l/master_hg/v4l/videobuf-dma-sg.c |wc -l 18 So, I don't think it is too much pollution. for no good

Re: Magic in videobuf

2010-03-15 Thread Hans Verkuil
are unlikely to be close in memory to the actual buffers. Magic values that are actually put in the buffers themselves might serve some purpose. It pollutes the code There are only 18 occurences of MAGIC* at a given videobuf driver: $ grep MAGIC ~v4l/master_hg/v4l/videobuf-dma-sg.c |wc

Re: Magic in videobuf

2010-03-15 Thread Mauro Carvalho Chehab
18 occurences of MAGIC* at a given videobuf driver: $ grep MAGIC ~v4l/master_hg/v4l/videobuf-dma-sg.c |wc -l 18 So, I don't think it is too much pollution. It is, because it is absolute not clear what its purpose is, and in this case even when I know the purpose it still makes

Re: Magic in videobuf

2010-03-15 Thread Andy Walls
On Mon, 2010-03-15 at 14:26 -0300, Mauro Carvalho Chehab wrote: Hans Verkuil wrote: Hans Verkuil wrote: Pawel Osciak wrote: is anyone aware of any other uses for MAGIC_CHECK()s in videobuf code besides driver debugging? I intend to remove them, as we weren't able to find any particular