1. 28 5月, 2016 1 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  2. 25 2月, 2016 1 次提交
  3. 16 2月, 2016 1 次提交
  4. 11 12月, 2015 1 次提交
  5. 10 7月, 2014 1 次提交
    • S
      drm/tilcdc: Fix build breakage · 62eb3e20
      Sachin Kamat 提交于
      Commit 34ea3d38 ("drm: add register and unregister functions
      for connectors") probably missed out converting the
      drm_sysfs_connector_remove instances in the following files.
      Without this patch we get the following compilation error:
      ERROR: "drm_sysfs_connector_remove" [drivers/gpu/drm/tilcdc/tilcdc.ko] undefined!
      Signed-off-by: NSachin Kamat <sachin.kamat@samsung.com>
      CC: Thomas Wood <thomas.wood@intel.com>
      CC: David Herrmann <dh.herrmann@gmail.com>
      CC: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      62eb3e20
  6. 08 7月, 2014 2 次提交
  7. 19 6月, 2014 1 次提交
  8. 23 8月, 2013 1 次提交
    • W
      i2c: move OF helpers into the core · 687b81d0
      Wolfram Sang 提交于
      I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
      that it is much cleaner to have this in the core. This also removes a
      circular dependency between the helpers and the core, and so we can
      finally register child nodes in the core instead of doing this manually
      in each driver. So, fix the drivers and documentation, too.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      687b81d0
  9. 20 6月, 2013 1 次提交
  10. 26 4月, 2013 1 次提交
    • A
      drm/tilcdc: use only a single module device table · a59e1ff3
      Arnd Bergmann 提交于
      The tilcdc driver fails to be built as a module because of extraneous
      MODULE_DEVICE_TABLE entries:
      
      drivers/gpu/drm/tilcdc/tilcdc_slave.o:(.data+0x54): multiple definition of `__mod_of_device_table'
      drivers/gpu/drm/tilcdc/tilcdc_tfp410.o:(.data+0x54): first defined here
      drivers/gpu/drm/tilcdc/tilcdc_panel.o:(.data+0x54): multiple definition of `__mod_of_device_table'
      drivers/gpu/drm/tilcdc/tilcdc_tfp410.o:(.data+0x54): first defined here
      drivers/gpu/drm/tilcdc/tilcdc_drv.o:(.data+0x184): multiple definition of `__mod_of_device_table'
      drivers/gpu/drm/tilcdc/tilcdc_tfp410.o:(.data+0x54): first defined here
      
      Since the entire point of these entries is to make the module autoload
      when one of the devices is present, it's enough to keep the one entry
      for "ti,am33xx-tilcdc", which should always be there if any of the
      others are.
      Acked-by: NRob Clark <robdclark@gmail.com>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a59e1ff3
  11. 20 2月, 2013 1 次提交
    • R
      drm/tilcdc: add TI LCD Controller DRM driver (v4) · 16ea975e
      Rob Clark 提交于
      A simple DRM/KMS driver for the TI LCD Controller found in various
      smaller TI parts (AM33xx, OMAPL138, etc).  This driver uses the
      CMA helpers.  Currently only the TFP410 DVI encoder is supported
      (tested with beaglebone + DVI cape).  There are also various LCD
      displays, for which support can be added (as I get hw to test on),
      and an external i2c HDMI encoder found on some boards.
      
      The display controller supports a single CRTC.  And the encoder+
      connector are split out into sub-devices.  Depending on which LCD
      or external encoder is actually present, the appropriate output
      module(s) will be loaded.
      
      v1: original
      v2: fix fb refcnting and few other cleanups
      v3: get +/- vsync/hsync from timings rather than panel-info, add
          option DT max-bandwidth field so driver doesn't attempt to
          pick a display mode with too high memory bandwidth, and other
          small cleanups
      v4: remove some unneeded stuff from panel-info struct, properly
          set high bits for hfp/hsw/hbp for rev 2, add DT bindings docs
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: NKoen Kooi <koen@dominion.thruhere.net>
      16ea975e