1. 19 Apr, 2016 2 commits
    • Stephen Boyd's avatar
      clkdev: Add clk_hw based registration APIs · e4f1b49b
      Stephen Boyd authored
      Now that we have a clk registration API that doesn't return
      struct clks, we need to have some way to hand out struct clks via
      the clk_get() APIs that doesn't involve associating struct clk
      pointers with a struct clk_lookup. Luckily, clkdev already
      operates on struct clk_hw pointers, except for the registration
      facing APIs where it converts struct clk pointers into struct
      clk_hw pointers almost immediately.
      Let's add clk_hw based registration APIs so that we can skip the
      conversion step and provide a way for clk provider drivers to
      operate exclusively on clk_hw structs. This way we clearly
      split the API between consumers and providers.
      Cc: Russell King <linux@arm.linux.org.uk>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    • Stephen Boyd's avatar
      clkdev: Remove clk_register_clkdevs() · a14b9e05
      Stephen Boyd authored
      Now that we've converted the only caller over to another clkdev
      API, remove this one.
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
  2. 16 Feb, 2016 1 commit
    • Kees Cook's avatar
      ARM: 8503/1: clk_register_clkdev: remove format string interface · 416dd13a
      Kees Cook authored
      Many callers either use NULL or const strings for the third argument of
      clk_register_clkdev. For those that do not and use a non-const string,
      this is a risk for format strings being accidentally processed (for
      example in device names). As this interface is already used as if it
      weren't a format string (prints nothing when NULL), and there are zero
      users of the format strings, remove the format string interface to make
      sure format strings will not leak into the clkdev.
      $ git grep '\bclk_register_clkdev\b' | grep % | wc -l
      Unfortunately, all the internals expect a va_list even though they treat
      a NULL format string as special. To deal with this, we must pass either
      (..., "%s", string) or (..., NULL) so that a the va_list will be created
      correctly (passing the name as an argument, not as a format string).
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
  3. 17 Jul, 2015 1 commit
    • Nicolas Iooss's avatar
      include, lib: add __printf attributes to several function prototypes · 8db14860
      Nicolas Iooss authored
      Using __printf attributes helps to detect several format string issues
      at compile time (even though -Wformat-security is currently disabled in
      Makefile).  For example it can detect when formatting a pointer as a
      number, like the issue fixed in commit a3fa71c4 ("wl18xx: show
      rx_frames_per_rates as an array as it really is"), or when the arguments
      do not match the format string, c.f.  for example commit 5ce1aca8
      ("reiserfs: fix __RASSERT format string").
      To prevent similar bugs in the future, add a __printf attribute to every
      function prototype which needs one in include/linux/ and lib/.  These
      functions were mostly found by using gcc's -Wsuggest-attribute=format
      Signed-off-by: default avatarNicolas Iooss <nicolas.iooss_linux@m4x.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  4. 06 May, 2015 3 commits
    • Russell King's avatar
      clkdev: add clkdev_create() helper · 25689998
      Russell King authored
      Add a helper to allocate and add a clk_lookup structure.  This can not
      only be used in several places in clkdev.c to simplify the code, but
      more importantly, can be used by callers of the clkdev code to simplify
      their clkdev creation and registration.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    • Russell King's avatar
      clkdev: const-ify connection id to clk_add_alias() · b3d8d7e8
      Russell King authored
      The connection id is only passed to clk_get() which is already const.
      Const-ify this argument too.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    • Russell King's avatar
      clkdev: use clk_hw internally · d5622a9c
      Russell King authored
      clk_add_alias() calls clk_get() followed by clk_put() but in between
      those two calls it saves away the struct clk pointer to a clk_lookup
      structure. This leaves the 'clk' member of the clk_lookup pointing at
      freed memory on configurations where CONFIG_COMMON_CLK=y. This is a
      problem because clk_get_sys() will eventually try to dereference the
      freed pointer by calling __clk_get_hw() on it. Fix this by saving away
      the struct clk_hw pointer instead of the struct clk pointer so that when
      we try to create a per-user struct clk in clk_get_sys() we don't
      dereference a junk pointer.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
  5. 04 Dec, 2013 1 commit
  6. 02 May, 2012 1 commit
  7. 13 Oct, 2011 1 commit
  8. 26 Nov, 2010 1 commit
  9. 29 Mar, 2010 1 commit
  10. 12 Feb, 2010 1 commit
  11. 27 Nov, 2008 1 commit