1. 24 Jan, 2011 1 commit
    • Rusty Russell's avatar
      BUILD_BUG_ON: make it handle more cases · 7ef88ad5
      Rusty Russell authored
      BUILD_BUG_ON used to use the optimizer to do code elimination or fail
      at link time; it was changed to first the size of a negative array (a
      nicer compile time error), then (in
      8c87df45) to a bitfield.
      
      This forced us to change some non-constant cases to MAYBE_BUILD_BUG_ON();
      as Jan points out in that commit, it didn't work as intended anyway.
      
      bitfields: needs a literal constant at parse time, and can't be put under
      	"if (__builtin_constant_p(x))" for example.
      negative array: can handle anything, but if the compiler can't tell it's
      	a constant, silently has no effect.
      link time: breaks link if the compiler can't determine the value, but the
      	linker output is not usually as informative as a compiler error.
      
      If we use the negative-array-size method *and* the link time trick,
      we get the ability to use BUILD_BUG_ON() under __builtin_constant_p()
      branches, and maximal ability for the compiler to detect errors at
      build time.
      
      We also document it thoroughly.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: Jan Beulich <JBeulich@novell.com>
      Acked-by: default avatarHollis Blanchard <hollisb@us.ibm.com>
      7ef88ad5
  2. 22 Jan, 2011 2 commits
    • Linus Torvalds's avatar
      Linux 2.6.38-rc2 · 1bae4ce2
      Linus Torvalds authored
      1bae4ce2
    • Linus Torvalds's avatar
      Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · 13a3cec8
      Linus Torvalds authored
      * 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (101 commits)
        [media] staging/lirc: fix mem leaks and ptr err usage
        [media] hdpvr: reduce latency of i2c read/write w/recycled buffer
        [media] hdpvr: enable IR part
        [media] rc/mceusb: timeout should be in ns, not us
        [media] v4l2-device: fix 'use-after-freed' oops
        [media] v4l2-dev: don't memset video_device.dev
        [media] zoran: use video_device_alloc instead of kmalloc
        [media] w9966: zero device state after a detach
        [media] v4l: Fix a use-before-set in the control framework
        [media] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h
        [media] DocBook/v4l: update V4L2 revision and update copyright years
        [media] DocBook/v4l: fix validation error in dev-rds.xml
        [media] v4l2-ctrls: queryctrl shouldn't attempt to replace V4L2_CID_PRIVATE_BASE IDs
        [media] v4l2-ctrls: fix missing 'read-only' check
        [media] pvrusb2: Provide more information about IR units to lirc_zilog and ir-kbd-i2c
        [media] ir-kbd-i2c: Add back defaults setting for Zilog Z8's at addr 0x71
        [media] lirc_zilog: Update TODO.lirc_zilog
        [media] lirc_zilog: Add Andy Walls to copyright notice and authors list
        [media] lirc_zilog: Remove useless struct i2c_driver.command function
        [media] lirc_zilog: Remove unneeded tests for existence of the IR Tx function
        ...
      13a3cec8
  3. 21 Jan, 2011 37 commits