1. 17 6月, 2009 2 次提交
  2. 25 7月, 2008 1 次提交
    • A
      PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures · 27ac792c
      Andrea Righi 提交于
      On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
      boundary. For example:
      
      	u64 val = PAGE_ALIGN(size);
      
      always returns a value < 4GB even if size is greater than 4GB.
      
      The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
      example):
      
      #define PAGE_SHIFT      12
      #define PAGE_SIZE       (_AC(1,UL) << PAGE_SHIFT)
      #define PAGE_MASK       (~(PAGE_SIZE-1))
      ...
      #define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)
      
      The "~" is performed on a 32-bit value, so everything in "and" with
      PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
      Using the ALIGN() macro seems to be the right way, because it uses
      typeof(addr) for the mask.
      
      Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
      include/linux/mm.h.
      
      See also lkml discussion: http://lkml.org/lkml/2008/6/11/237
      
      [akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
      [akpm@linux-foundation.org: fix v850]
      [akpm@linux-foundation.org: fix powerpc]
      [akpm@linux-foundation.org: fix arm]
      [akpm@linux-foundation.org: fix mips]
      [akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
      [akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
      [akpm@linux-foundation.org: fix powerpc]
      Signed-off-by: NAndrea Righi <righi.andrea@gmail.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      27ac792c
  3. 21 5月, 2008 1 次提交
  4. 29 4月, 2008 1 次提交
    • H
      media: fix integer as NULL pointer warnings · a6a3a17b
      Harvey Harrison 提交于
      drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
      drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
      drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
      drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
      drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
      drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6a3a17b
  5. 25 4月, 2008 11 次提交
  6. 18 2月, 2008 1 次提交
  7. 26 1月, 2008 5 次提交
  8. 13 12月, 2007 1 次提交
  9. 12 12月, 2007 2 次提交
  10. 22 10月, 2007 1 次提交
  11. 14 10月, 2007 1 次提交
  12. 11 10月, 2007 1 次提交
  13. 10 10月, 2007 10 次提交
  14. 09 5月, 2007 1 次提交
  15. 21 2月, 2007 1 次提交
    • M
      V4L/DVB (5147): Make vivi driver to use vmalloced pointers · b50e7fe9
      Mauro Carvalho Chehab 提交于
      Before this patch, vivi were simulating a scatter gather DMA transfer.
      While this is academic, showing how stuff really works on a real PCI 
      device, this means a non-optimized code. 
      There are only two memory models that vivi implements:
      	1) kernel alloced memory. This is also used by read() method.
      	   On this case, a vmalloc32 buffer is allocated at kernel;
      	2) userspace allocated memory. This is used by most userspace apps.
      	   video-buf will store this pointer.
      	   a simple copy_to_user is enough to transfer data.
      The third memory model scenario supported by video-buf is overlay mode. 
      This model is not implemented on vivi and unlikely to be implemented on 
      newer drivers, since now, most userspace apps do some post-processing 
      (like de-interlacing).
      After this patch, some cleanups may be done at video-buf.c to avoid 
      allocating pages, when the driver doesn't need a PCI buffer. This is the 
      case of vivi and usb drivers.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
      b50e7fe9