• G
    util_macros.h: have array pointer point to array of constants · 05836c37
    Guenter Roeck 提交于
    Using the new find_closest() macro can result in the following sparse
    warnings.
    
      drivers/hwmon/lm85.c:194:16: warning:
      		incorrect type in initializer (different modifiers)
      drivers/hwmon/lm85.c:194:16:    expected int *__fc_a
      drivers/hwmon/lm85.c:194:16:    got int static const [toplevel] *<noident>
      drivers/hwmon/lm85.c:210:16: warning:
      		incorrect type in initializer (different modifiers)
      drivers/hwmon/lm85.c:210:16:    expected int *__fc_a
      drivers/hwmon/lm85.c:210:16:    got int const *map
    
    This is because the array passed to find_closest() will typically be
    declared as array of constants, but the macro declares a non-constant
    pointer to it.
    Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
    Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    05836c37
util_macros.h 1.1 KB