* [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
@ 2025-02-10 6:48 Raag Jadav
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
` (19 more replies)
0 siblings, 20 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
This series
1. Splits device/devres.h for the users that are only interested in devres APIs.
Original work by Andy Shevchenko:
https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com
2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
across drivers.
The idea behind embedding both work into a single series is to make the review
process easier and reduce conflicts while merging.
Current proposal is to merge initial patches with an immutable tag (volunteered
by Andy) for other subsystems to use. Feel free to share a better alternative.
v2: Use size_mul() for multiplication (Dmitry)
Update commit message (Dmitry)
v3: Embed devres.h work by Andy
Add more users of devm_kmemdup_array()
Update tags and rebase
v4: Use IOMEM_ERR_PTR() to fix sparse warnings (Andy)
Use source size and make it robust against type changes (Andy)
Andy Shevchenko (2):
driver core: Split devres APIs to device/devres.h
iio: imu: st_lsm9ds0: Replace device.h with what is needed
Raag Jadav (18):
devres: Introduce devm_kmemdup_array()
pinctrl: intel: copy communities using devm_kmemdup_array()
pinctrl: baytrail: copy communities using devm_kmemdup_array()
pinctrl: cherryview: use devm_kmemdup_array()
pinctrl: tangier: use devm_kmemdup_array()
pinctrl: pxa2xx: use devm_kmemdup_array()
input: sparse-keymap: use devm_kmemdup_array()
input: ipaq-micro-keys: use devm_kmemdup_array()
regulator: devres: use devm_kmemdup_array()
regulator: cros-ec: use devm_kmemdup_array()
power: supply: sc27xx: use devm_kmemdup_array()
iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
ASoC: Intel: avs: use devm_kmemdup_array()
ASoC: hdac_hdmi: use devm_kmemdup_array()
ASoC: tlv320dac33: use devm_kmemdup_array()
ASoC: uda1380: use devm_kmemdup_array()
ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
ASoC: uniphier: use devm_kmemdup_array()
drivers/iio/adc/xilinx-xadc-core.c | 4 +-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 2 +-
drivers/input/keyboard/ipaq-micro-keys.c | 5 +-
drivers/input/sparse-keymap.c | 3 +-
drivers/pinctrl/intel/pinctrl-baytrail.c | 6 +-
drivers/pinctrl/intel/pinctrl-cherryview.c | 5 +-
drivers/pinctrl/intel/pinctrl-intel.c | 6 +-
drivers/pinctrl/intel/pinctrl-tangier.c | 5 +-
drivers/pinctrl/pxa/pinctrl-pxa2xx.c | 8 +-
drivers/power/supply/sc27xx_fuel_gauge.c | 5 +-
drivers/regulator/cros-ec-regulator.c | 4 +-
drivers/regulator/devres.c | 5 +-
include/linux/device.h | 119 +-----------------
include/linux/device/devres.h | 130 ++++++++++++++++++++
sound/soc/codecs/hdac_hdmi.c | 3 +-
sound/soc/codecs/tlv320dac33.c | 6 +-
sound/soc/codecs/uda1380.c | 6 +-
sound/soc/intel/avs/boards/da7219.c | 3 +-
sound/soc/intel/avs/boards/es8336.c | 3 +-
sound/soc/intel/avs/boards/nau8825.c | 3 +-
sound/soc/intel/avs/boards/rt274.c | 3 +-
sound/soc/intel/avs/boards/rt286.c | 3 +-
sound/soc/intel/avs/boards/rt298.c | 3 +-
sound/soc/intel/avs/boards/rt5663.c | 3 +-
sound/soc/intel/avs/boards/rt5682.c | 3 +-
sound/soc/meson/axg-tdm-interface.c | 9 +-
sound/soc/uniphier/aio-cpu.c | 8 +-
28 files changed, 181 insertions(+), 184 deletions(-)
create mode 100644 include/linux/device/devres.h
base-commit: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
--
2.34.1
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 14:08 ` kernel test robot
` (2 more replies)
2025-02-10 6:48 ` [PATCH v4 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
` (18 subsequent siblings)
19 siblings, 3 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
device.h is a huge header which is hard to follow and easy to miss
something. Improve that by splitting devres APIs to device/devres.h.
In particular this helps to speedup the build of the code that includes
device.h solely for a devres APIs.
While at it, cast the error pointers to __iomem using IOMEM_ERR_PTR()
and fix sparse warnings.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
include/linux/device.h | 119 +-------------------------------
include/linux/device/devres.h | 125 ++++++++++++++++++++++++++++++++++
2 files changed, 126 insertions(+), 118 deletions(-)
create mode 100644 include/linux/device/devres.h
diff --git a/include/linux/device.h b/include/linux/device.h
index 80a5b3268986..78ca7fd0e625 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -26,9 +26,9 @@
#include <linux/atomic.h>
#include <linux/uidgid.h>
#include <linux/gfp.h>
-#include <linux/overflow.h>
#include <linux/device/bus.h>
#include <linux/device/class.h>
+#include <linux/device/devres.h>
#include <linux/device/driver.h>
#include <linux/cleanup.h>
#include <asm/device.h>
@@ -281,123 +281,6 @@ int __must_check device_create_bin_file(struct device *dev,
void device_remove_bin_file(struct device *dev,
const struct bin_attribute *attr);
-/* device resource management */
-typedef void (*dr_release_t)(struct device *dev, void *res);
-typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
-
-void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
- int nid, const char *name) __malloc;
-#define devres_alloc(release, size, gfp) \
- __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release)
-#define devres_alloc_node(release, size, gfp, nid) \
- __devres_alloc_node(release, size, gfp, nid, #release)
-
-void devres_for_each_res(struct device *dev, dr_release_t release,
- dr_match_t match, void *match_data,
- void (*fn)(struct device *, void *, void *),
- void *data);
-void devres_free(void *res);
-void devres_add(struct device *dev, void *res);
-void *devres_find(struct device *dev, dr_release_t release,
- dr_match_t match, void *match_data);
-void *devres_get(struct device *dev, void *new_res,
- dr_match_t match, void *match_data);
-void *devres_remove(struct device *dev, dr_release_t release,
- dr_match_t match, void *match_data);
-int devres_destroy(struct device *dev, dr_release_t release,
- dr_match_t match, void *match_data);
-int devres_release(struct device *dev, dr_release_t release,
- dr_match_t match, void *match_data);
-
-/* devres group */
-void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp);
-void devres_close_group(struct device *dev, void *id);
-void devres_remove_group(struct device *dev, void *id);
-int devres_release_group(struct device *dev, void *id);
-
-/* managed devm_k.alloc/kfree for device drivers */
-void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) __alloc_size(2);
-void *devm_krealloc(struct device *dev, void *ptr, size_t size,
- gfp_t gfp) __must_check __realloc_size(3);
-__printf(3, 0) char *devm_kvasprintf(struct device *dev, gfp_t gfp,
- const char *fmt, va_list ap) __malloc;
-__printf(3, 4) char *devm_kasprintf(struct device *dev, gfp_t gfp,
- const char *fmt, ...) __malloc;
-static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
-{
- return devm_kmalloc(dev, size, gfp | __GFP_ZERO);
-}
-static inline void *devm_kmalloc_array(struct device *dev,
- size_t n, size_t size, gfp_t flags)
-{
- size_t bytes;
-
- if (unlikely(check_mul_overflow(n, size, &bytes)))
- return NULL;
-
- return devm_kmalloc(dev, bytes, flags);
-}
-static inline void *devm_kcalloc(struct device *dev,
- size_t n, size_t size, gfp_t flags)
-{
- return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
-}
-static inline __realloc_size(3, 4) void * __must_check
-devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags)
-{
- size_t bytes;
-
- if (unlikely(check_mul_overflow(new_n, new_size, &bytes)))
- return NULL;
-
- return devm_krealloc(dev, p, bytes, flags);
-}
-
-void devm_kfree(struct device *dev, const void *p);
-char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
-const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp);
-void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp)
- __realloc_size(3);
-
-unsigned long devm_get_free_pages(struct device *dev,
- gfp_t gfp_mask, unsigned int order);
-void devm_free_pages(struct device *dev, unsigned long addr);
-
-#ifdef CONFIG_HAS_IOMEM
-void __iomem *devm_ioremap_resource(struct device *dev,
- const struct resource *res);
-void __iomem *devm_ioremap_resource_wc(struct device *dev,
- const struct resource *res);
-
-void __iomem *devm_of_iomap(struct device *dev,
- struct device_node *node, int index,
- resource_size_t *size);
-#else
-
-static inline
-void __iomem *devm_ioremap_resource(struct device *dev,
- const struct resource *res)
-{
- return ERR_PTR(-EINVAL);
-}
-
-static inline
-void __iomem *devm_ioremap_resource_wc(struct device *dev,
- const struct resource *res)
-{
- return ERR_PTR(-EINVAL);
-}
-
-static inline
-void __iomem *devm_of_iomap(struct device *dev,
- struct device_node *node, int index,
- resource_size_t *size)
-{
- return ERR_PTR(-EINVAL);
-}
-
-#endif
-
/* allows to add/remove a custom action to devres stack */
int devm_remove_action_nowarn(struct device *dev, void (*action)(void *), void *data);
diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h
new file mode 100644
index 000000000000..4ec4c658879a
--- /dev/null
+++ b/include/linux/device/devres.h
@@ -0,0 +1,125 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _DEVICE_DEVRES_H_
+#define _DEVICE_DEVRES_H_
+
+#include <linux/errno.h>
+#include <linux/gfp_types.h>
+#include <linux/io.h>
+#include <linux/numa.h>
+#include <linux/overflow.h>
+#include <linux/stdarg.h>
+#include <linux/types.h>
+
+struct device;
+struct device_node;
+struct resource;
+
+/* device resource management */
+typedef void (*dr_release_t)(struct device *dev, void *res);
+typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
+
+void * __malloc
+__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid, const char *name);
+#define devres_alloc(release, size, gfp) \
+ __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release)
+#define devres_alloc_node(release, size, gfp, nid) \
+ __devres_alloc_node(release, size, gfp, nid, #release)
+
+void devres_for_each_res(struct device *dev, dr_release_t release,
+ dr_match_t match, void *match_data,
+ void (*fn)(struct device *, void *, void *),
+ void *data);
+void devres_free(void *res);
+void devres_add(struct device *dev, void *res);
+void *devres_find(struct device *dev, dr_release_t release, dr_match_t match, void *match_data);
+void *devres_get(struct device *dev, void *new_res, dr_match_t match, void *match_data);
+void *devres_remove(struct device *dev, dr_release_t release, dr_match_t match, void *match_data);
+int devres_destroy(struct device *dev, dr_release_t release, dr_match_t match, void *match_data);
+int devres_release(struct device *dev, dr_release_t release, dr_match_t match, void *match_data);
+
+/* devres group */
+void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp);
+void devres_close_group(struct device *dev, void *id);
+void devres_remove_group(struct device *dev, void *id);
+int devres_release_group(struct device *dev, void *id);
+
+/* managed devm_k.alloc/kfree for device drivers */
+void * __alloc_size(2)
+devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
+void * __must_check __realloc_size(3)
+devm_krealloc(struct device *dev, void *ptr, size_t size, gfp_t gfp);
+static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
+{
+ return devm_kmalloc(dev, size, gfp | __GFP_ZERO);
+}
+static inline void *devm_kmalloc_array(struct device *dev, size_t n, size_t size, gfp_t flags)
+{
+ size_t bytes;
+
+ if (unlikely(check_mul_overflow(n, size, &bytes)))
+ return NULL;
+
+ return devm_kmalloc(dev, bytes, flags);
+}
+static inline void *devm_kcalloc(struct device *dev, size_t n, size_t size, gfp_t flags)
+{
+ return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
+}
+static inline __realloc_size(3, 4) void * __must_check
+devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags)
+{
+ size_t bytes;
+
+ if (unlikely(check_mul_overflow(new_n, new_size, &bytes)))
+ return NULL;
+
+ return devm_krealloc(dev, p, bytes, flags);
+}
+
+void devm_kfree(struct device *dev, const void *p);
+
+void * __realloc_size(3)
+devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp);
+
+char * __malloc
+devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
+const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp);
+char * __printf(3, 0) __malloc
+devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, va_list ap);
+char * __printf(3, 4) __malloc
+devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
+
+unsigned long devm_get_free_pages(struct device *dev, gfp_t gfp_mask, unsigned int order);
+void devm_free_pages(struct device *dev, unsigned long addr);
+
+#ifdef CONFIG_HAS_IOMEM
+
+void __iomem *devm_ioremap_resource(struct device *dev, const struct resource *res);
+void __iomem *devm_ioremap_resource_wc(struct device *dev, const struct resource *res);
+
+void __iomem *devm_of_iomap(struct device *dev, struct device_node *node, int index,
+ resource_size_t *size);
+#else
+
+static inline
+void __iomem *devm_ioremap_resource(struct device *dev, const struct resource *res)
+{
+ return IOMEM_ERR_PTR(-EINVAL);
+}
+
+static inline
+void __iomem *devm_ioremap_resource_wc(struct device *dev, const struct resource *res)
+{
+ return IOMEM_ERR_PTR(-EINVAL);
+}
+
+static inline
+void __iomem *devm_of_iomap(struct device *dev, struct device_node *node, int index,
+ resource_size_t *size)
+{
+ return IOMEM_ERR_PTR(-EINVAL);
+}
+
+#endif
+
+#endif /* _DEVICE_DEVRES_H_ */
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 03/20] devres: Introduce devm_kmemdup_array() Raag Jadav
` (17 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav, Jonathan Cameron
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Instead of including a huge device.h with tons of dependencies
include only what driver actually uses.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index 0732cfa258c4..8cc071463249 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -7,7 +7,7 @@
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*/
-#include <linux/device.h>
+#include <linux/device/devres.h>
#include <linux/err.h>
#include <linux/gfp_types.h>
#include <linux/i2c.h>
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
index 43ec57c1e604..806e55f75f65 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
@@ -7,7 +7,7 @@
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*/
-#include <linux/device.h>
+#include <linux/device/devres.h>
#include <linux/err.h>
#include <linux/gfp_types.h>
#include <linux/module.h>
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 03/20] devres: Introduce devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-10 6:48 ` [PATCH v4 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 04/20] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
` (16 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Introduce '_array' variant of devm_kmemdup() which is more robust and
consistent with alloc family of helpers.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
include/linux/device/devres.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h
index 4ec4c658879a..634af06ec775 100644
--- a/include/linux/device/devres.h
+++ b/include/linux/device/devres.h
@@ -80,6 +80,11 @@ void devm_kfree(struct device *dev, const void *p);
void * __realloc_size(3)
devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp);
+static inline void *devm_kmemdup_array(struct device *dev, const void *src,
+ size_t n, size_t size, gfp_t flags)
+{
+ return devm_kmemdup(dev, src, size_mul(size, n), flags);
+}
char * __malloc
devm_kstrdup(struct device *dev, const char *s, gfp_t gfp);
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 04/20] pinctrl: intel: copy communities using devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (2 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 03/20] devres: Introduce devm_kmemdup_array() Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 05/20] pinctrl: baytrail: " Raag Jadav
` (15 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Copy communities using devm_kmemdup_array() instead of doing it manually.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/intel/pinctrl-intel.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index d593ad03f949..baa3686d7764 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1577,8 +1577,8 @@ int intel_pinctrl_probe(struct platform_device *pdev,
* to the registers.
*/
pctrl->ncommunities = pctrl->soc->ncommunities;
- pctrl->communities = devm_kcalloc(dev, pctrl->ncommunities,
- sizeof(*pctrl->communities), GFP_KERNEL);
+ pctrl->communities = devm_kmemdup_array(dev, pctrl->soc->communities, pctrl->ncommunities,
+ sizeof(*pctrl->soc->communities), GFP_KERNEL);
if (!pctrl->communities)
return -ENOMEM;
@@ -1588,8 +1588,6 @@ int intel_pinctrl_probe(struct platform_device *pdev,
u32 offset;
u32 value;
- *community = pctrl->soc->communities[i];
-
regs = devm_platform_ioremap_resource(pdev, community->barno);
if (IS_ERR(regs))
return PTR_ERR(regs);
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 05/20] pinctrl: baytrail: copy communities using devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (3 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 04/20] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 06/20] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
` (14 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Copy communities using devm_kmemdup_array() instead of doing it manually.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/intel/pinctrl-baytrail.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index c4458ac539ff..969137c4cb06 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -1560,16 +1560,14 @@ static int byt_set_soc_data(struct intel_pinctrl *vg,
vg->soc = soc;
vg->ncommunities = vg->soc->ncommunities;
- vg->communities = devm_kcalloc(vg->dev, vg->ncommunities,
- sizeof(*vg->communities), GFP_KERNEL);
+ vg->communities = devm_kmemdup_array(vg->dev, vg->soc->communities, vg->ncommunities,
+ sizeof(*vg->soc->communities), GFP_KERNEL);
if (!vg->communities)
return -ENOMEM;
for (i = 0; i < vg->soc->ncommunities; i++) {
struct intel_community *comm = vg->communities + i;
- *comm = vg->soc->communities[i];
-
comm->pad_regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(comm->pad_regs))
return PTR_ERR(comm->pad_regs);
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 06/20] pinctrl: cherryview: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (4 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 05/20] pinctrl: baytrail: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 07/20] pinctrl: tangier: " Raag Jadav
` (13 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/intel/pinctrl-cherryview.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index c673e262e1db..69b18ce0f685 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1631,9 +1631,8 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
pctrl->soc = soc_data;
pctrl->ncommunities = pctrl->soc->ncommunities;
- pctrl->communities = devm_kmemdup(dev, pctrl->soc->communities,
- pctrl->ncommunities * sizeof(*pctrl->communities),
- GFP_KERNEL);
+ pctrl->communities = devm_kmemdup_array(dev, pctrl->soc->communities, pctrl->ncommunities,
+ sizeof(*pctrl->soc->communities), GFP_KERNEL);
if (!pctrl->communities)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 07/20] pinctrl: tangier: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (5 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 06/20] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 08/20] pinctrl: pxa2xx: " Raag Jadav
` (12 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/intel/pinctrl-tangier.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-tangier.c b/drivers/pinctrl/intel/pinctrl-tangier.c
index d3baf0f4eea0..ac61e632b487 100644
--- a/drivers/pinctrl/intel/pinctrl-tangier.c
+++ b/drivers/pinctrl/intel/pinctrl-tangier.c
@@ -524,7 +524,6 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
struct device *dev = &pdev->dev;
struct tng_family *families;
struct tng_pinctrl *tp;
- size_t families_len;
void __iomem *regs;
unsigned int i;
@@ -543,8 +542,8 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
* Make a copy of the families which we can use to hold pointers
* to the registers.
*/
- families_len = size_mul(sizeof(*families), tp->nfamilies);
- families = devm_kmemdup(dev, tp->families, families_len, GFP_KERNEL);
+ families = devm_kmemdup_array(dev, tp->families, tp->nfamilies,
+ sizeof(*tp->families), GFP_KERNEL);
if (!families)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 08/20] pinctrl: pxa2xx: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (6 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 07/20] pinctrl: tangier: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 09/20] input: sparse-keymap: " Raag Jadav
` (11 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/pxa/pinctrl-pxa2xx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
index 9e34b92ff5f2..9fd7a8fb2bc4 100644
--- a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
+++ b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
@@ -281,9 +281,8 @@ static int pxa2xx_build_functions(struct pxa_pinctrl *pctl)
for (df = pctl->ppins[i].functions; df->name; df++)
if (!pxa2xx_find_function(pctl, df->name, functions))
(functions + pctl->nfuncs++)->name = df->name;
- pctl->functions = devm_kmemdup(pctl->dev, functions,
- pctl->nfuncs * sizeof(*functions),
- GFP_KERNEL);
+ pctl->functions = devm_kmemdup_array(pctl->dev, functions, pctl->nfuncs,
+ sizeof(*functions), GFP_KERNEL);
if (!pctl->functions)
return -ENOMEM;
@@ -314,7 +313,8 @@ static int pxa2xx_build_groups(struct pxa_pinctrl *pctl)
pctl->ppins[j].pin.name;
func = pctl->functions + i;
func->ngroups = ngroups;
- func->groups = devm_kmemdup(pctl->dev, gtmp, ngroups * sizeof(*gtmp), GFP_KERNEL);
+ func->groups = devm_kmemdup_array(pctl->dev, gtmp, ngroups,
+ sizeof(*gtmp), GFP_KERNEL);
if (!func->groups)
return -ENOMEM;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 09/20] input: sparse-keymap: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (7 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 08/20] pinctrl: pxa2xx: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 10/20] input: ipaq-micro-keys: " Raag Jadav
` (10 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/input/sparse-keymap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 25bf8be6e711..96f23ae57d5a 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev,
for (e = keymap; e->type != KE_END; e++)
map_size++;
- map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map),
- GFP_KERNEL);
+ map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*keymap), GFP_KERNEL);
if (!map)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 10/20] input: ipaq-micro-keys: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (8 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 09/20] input: sparse-keymap: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 11/20] regulator: devres: " Raag Jadav
` (9 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/input/keyboard/ipaq-micro-keys.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/ipaq-micro-keys.c b/drivers/input/keyboard/ipaq-micro-keys.c
index 58631bf7ce55..ca7ec054b1ce 100644
--- a/drivers/input/keyboard/ipaq-micro-keys.c
+++ b/drivers/input/keyboard/ipaq-micro-keys.c
@@ -102,9 +102,8 @@ static int micro_key_probe(struct platform_device *pdev)
keys->input->keycodesize = sizeof(micro_keycodes[0]);
keys->input->keycodemax = ARRAY_SIZE(micro_keycodes);
- keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
- keys->input->keycodesize * keys->input->keycodemax,
- GFP_KERNEL);
+ keys->codes = devm_kmemdup_array(&pdev->dev, micro_keycodes, keys->input->keycodemax,
+ keys->input->keycodesize, GFP_KERNEL);
if (!keys->codes)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 11/20] regulator: devres: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (9 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 10/20] input: ipaq-micro-keys: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 12/20] regulator: cros-ec: " Raag Jadav
` (8 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/regulator/devres.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 36164aec30e8..ab238579879c 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -332,9 +332,8 @@ int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
const struct regulator_bulk_data *in_consumers,
struct regulator_bulk_data **out_consumers)
{
- *out_consumers = devm_kmemdup(dev, in_consumers,
- num_consumers * sizeof(*in_consumers),
- GFP_KERNEL);
+ *out_consumers = devm_kmemdup_array(dev, in_consumers, num_consumers,
+ sizeof(*in_consumers), GFP_KERNEL);
if (*out_consumers == NULL)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 12/20] regulator: cros-ec: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (10 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 11/20] regulator: devres: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:48 ` [PATCH v4 13/20] power: supply: sc27xx: " Raag Jadav
` (7 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/regulator/cros-ec-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index fb9643ed7a49..fb0767b33a36 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -138,8 +138,8 @@ static int cros_ec_regulator_init_info(struct device *dev,
data->num_voltages =
min_t(u16, ARRAY_SIZE(resp.voltages_mv), resp.num_voltages);
data->voltages_mV =
- devm_kmemdup(dev, resp.voltages_mv,
- sizeof(u16) * data->num_voltages, GFP_KERNEL);
+ devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
+ sizeof(resp.voltages_mv[0]), GFP_KERNEL);
if (!data->voltages_mV)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 13/20] power: supply: sc27xx: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (11 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 12/20] regulator: cros-ec: " Raag Jadav
@ 2025-02-10 6:48 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 14/20] iio: adc: xilinx-xadc-core: " Raag Jadav
` (6 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:48 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/power/supply/sc27xx_fuel_gauge.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index f36edc2ba708..573838ca8ed8 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1014,9 +1014,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
if (!table)
return -EINVAL;
- data->cap_table = devm_kmemdup(data->dev, table,
- data->table_len * sizeof(*table),
- GFP_KERNEL);
+ data->cap_table = devm_kmemdup_array(data->dev, table, data->table_len,
+ sizeof(*table), GFP_KERNEL);
if (!data->cap_table) {
power_supply_put_battery_info(data->battery, info);
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (12 preceding siblings ...)
2025-02-10 6:48 ` [PATCH v4 13/20] power: supply: sc27xx: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 15/20] ASoC: Intel: avs: " Raag Jadav
` (5 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index cfbfcaefec0f..e1f8740ae688 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1245,8 +1245,8 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
channel_templates = xadc_us_channels;
max_channels = ARRAY_SIZE(xadc_us_channels);
}
- channels = devm_kmemdup(dev, channel_templates,
- sizeof(channels[0]) * max_channels, GFP_KERNEL);
+ channels = devm_kmemdup_array(dev, channel_templates, max_channels,
+ sizeof(*channel_templates), GFP_KERNEL);
if (!channels)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 15/20] ASoC: Intel: avs: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (13 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 14/20] iio: adc: xilinx-xadc-core: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 16/20] ASoC: hdac_hdmi: " Raag Jadav
` (4 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav, Amadeusz Sławiński
Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
sound/soc/intel/avs/boards/da7219.c | 3 ++-
sound/soc/intel/avs/boards/es8336.c | 3 ++-
sound/soc/intel/avs/boards/nau8825.c | 3 ++-
sound/soc/intel/avs/boards/rt274.c | 3 ++-
sound/soc/intel/avs/boards/rt286.c | 3 ++-
sound/soc/intel/avs/boards/rt298.c | 3 ++-
sound/soc/intel/avs/boards/rt5663.c | 3 ++-
sound/soc/intel/avs/boards/rt5682.c | 3 ++-
8 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c
index 76078a7005b0..9507a96f26ac 100644
--- a/sound/soc/intel/avs/boards/da7219.c
+++ b/sound/soc/intel/avs/boards/da7219.c
@@ -113,7 +113,8 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
}
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/es8336.c b/sound/soc/intel/avs/boards/es8336.c
index 426ce37105ae..6f3c4f6c9302 100644
--- a/sound/soc/intel/avs/boards/es8336.c
+++ b/sound/soc/intel/avs/boards/es8336.c
@@ -109,7 +109,8 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
data = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c
index bf902540744c..6833eebd82d6 100644
--- a/sound/soc/intel/avs/boards/nau8825.c
+++ b/sound/soc/intel/avs/boards/nau8825.c
@@ -88,7 +88,8 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/rt274.c b/sound/soc/intel/avs/boards/rt274.c
index 4b6c02a40204..f5caafc21861 100644
--- a/sound/soc/intel/avs/boards/rt274.c
+++ b/sound/soc/intel/avs/boards/rt274.c
@@ -98,7 +98,8 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/rt286.c b/sound/soc/intel/avs/boards/rt286.c
index e40563ca99fd..1eb0399c0fae 100644
--- a/sound/soc/intel/avs/boards/rt286.c
+++ b/sound/soc/intel/avs/boards/rt286.c
@@ -59,7 +59,8 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/rt298.c b/sound/soc/intel/avs/boards/rt298.c
index 94fce07c83f9..85269a3be981 100644
--- a/sound/soc/intel/avs/boards/rt298.c
+++ b/sound/soc/intel/avs/boards/rt298.c
@@ -70,7 +70,8 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/rt5663.c b/sound/soc/intel/avs/boards/rt5663.c
index b456b9d14665..e3310b3268ba 100644
--- a/sound/soc/intel/avs/boards/rt5663.c
+++ b/sound/soc/intel/avs/boards/rt5663.c
@@ -65,7 +65,8 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = &priv->jack;
num_pins = ARRAY_SIZE(card_headset_pins);
- pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+ sizeof(card_headset_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
diff --git a/sound/soc/intel/avs/boards/rt5682.c b/sound/soc/intel/avs/boards/rt5682.c
index 335960cfd7ba..339df0b944c1 100644
--- a/sound/soc/intel/avs/boards/rt5682.c
+++ b/sound/soc/intel/avs/boards/rt5682.c
@@ -102,7 +102,8 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
jack = snd_soc_card_get_drvdata(card);
num_pins = ARRAY_SIZE(card_jack_pins);
- pins = devm_kmemdup(card->dev, card_jack_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+ pins = devm_kmemdup_array(card->dev, card_jack_pins, num_pins,
+ sizeof(card_jack_pins[0]), GFP_KERNEL);
if (!pins)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 16/20] ASoC: hdac_hdmi: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (14 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 15/20] ASoC: Intel: avs: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 17/20] ASoC: tlv320dac33: " Raag Jadav
` (3 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/codecs/hdac_hdmi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index e1a7f0b0c0f3..3bea5d09219a 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1017,8 +1017,7 @@ static int hdac_hdmi_create_pin_port_muxs(struct hdac_device *hdev,
return -ENOMEM;
}
- se->texts = devm_kmemdup(&hdev->dev, items,
- (num_items * sizeof(char *)), GFP_KERNEL);
+ se->texts = devm_kmemdup_array(&hdev->dev, items, num_items, sizeof(items[0]), GFP_KERNEL);
if (!se->texts)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 17/20] ASoC: tlv320dac33: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (15 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 16/20] ASoC: hdac_hdmi: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 18/20] ASoC: uda1380: " Raag Jadav
` (2 subsequent siblings)
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/codecs/tlv320dac33.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index fa46f51d4341..423b9264a205 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -1477,10 +1477,8 @@ static int dac33_i2c_probe(struct i2c_client *client)
if (dac33 == NULL)
return -ENOMEM;
- dac33->reg_cache = devm_kmemdup(&client->dev,
- dac33_reg,
- ARRAY_SIZE(dac33_reg) * sizeof(u8),
- GFP_KERNEL);
+ dac33->reg_cache = devm_kmemdup_array(&client->dev, dac33_reg, ARRAY_SIZE(dac33_reg),
+ sizeof(dac33_reg[0]), GFP_KERNEL);
if (!dac33->reg_cache)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 18/20] ASoC: uda1380: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (16 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 17/20] ASoC: tlv320dac33: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 19/20] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 20/20] ASoC: uniphier: " Raag Jadav
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/codecs/uda1380.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 4f8fdd574585..c179d865b938 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -766,10 +766,8 @@ static int uda1380_i2c_probe(struct i2c_client *i2c)
return ret;
}
- uda1380->reg_cache = devm_kmemdup(&i2c->dev,
- uda1380_reg,
- ARRAY_SIZE(uda1380_reg) * sizeof(u16),
- GFP_KERNEL);
+ uda1380->reg_cache = devm_kmemdup_array(&i2c->dev, uda1380_reg, ARRAY_SIZE(uda1380_reg),
+ sizeof(uda1380_reg[0]), GFP_KERNEL);
if (!uda1380->reg_cache)
return -ENOMEM;
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 19/20] ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (17 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 18/20] ASoC: uda1380: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
2025-02-10 6:49 ` [PATCH v4 20/20] ASoC: uniphier: " Raag Jadav
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/meson/axg-tdm-interface.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
index 09103eef2a97..421b5d719fb3 100644
--- a/sound/soc/meson/axg-tdm-interface.c
+++ b/sound/soc/meson/axg-tdm-interface.c
@@ -529,7 +529,6 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct snd_soc_dai_driver *dai_drv;
struct axg_tdm_iface *iface;
- int i;
iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL);
if (!iface)
@@ -541,15 +540,11 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
* We'll change the number of channel provided by DAI stream, so dpcm
* channel merge can be done properly
*/
- dai_drv = devm_kcalloc(dev, ARRAY_SIZE(axg_tdm_iface_dai_drv),
- sizeof(*dai_drv), GFP_KERNEL);
+ dai_drv = devm_kmemdup_array(dev, axg_tdm_iface_dai_drv, ARRAY_SIZE(axg_tdm_iface_dai_drv),
+ sizeof(axg_tdm_iface_dai_drv[0]), GFP_KERNEL);
if (!dai_drv)
return -ENOMEM;
- for (i = 0; i < ARRAY_SIZE(axg_tdm_iface_dai_drv); i++)
- memcpy(&dai_drv[i], &axg_tdm_iface_dai_drv[i],
- sizeof(*dai_drv));
-
/* Bit clock provided on the pad */
iface->sclk = devm_clk_get(dev, "sclk");
if (IS_ERR(iface->sclk))
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v4 20/20] ASoC: uniphier: use devm_kmemdup_array()
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
` (18 preceding siblings ...)
2025-02-10 6:49 ` [PATCH v4 19/20] ASoC: meson: axg-tdm-interface: " Raag Jadav
@ 2025-02-10 6:49 ` Raag Jadav
19 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 6:49 UTC (permalink / raw)
To: gregkh, rafael, linus.walleij, mika.westerberg, andriy.shevchenko,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel
Cc: linux-gpio, linux-kernel, linux-input, linux-sound, linux-pm,
linux-iio, Raag Jadav
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/uniphier/aio-cpu.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c
index 470f129166a4..3224c11a527f 100644
--- a/sound/soc/uniphier/aio-cpu.c
+++ b/sound/soc/uniphier/aio-cpu.c
@@ -762,14 +762,10 @@ int uniphier_aio_probe(struct platform_device *pdev)
return -ENOMEM;
chip->num_plls = chip->chip_spec->num_plls;
- chip->plls = devm_kcalloc(dev,
- chip->num_plls,
- sizeof(struct uniphier_aio_pll),
- GFP_KERNEL);
+ chip->plls = devm_kmemdup_array(dev, chip->chip_spec->plls, chip->num_plls,
+ sizeof(*chip->chip_spec->plls), GFP_KERNEL);
if (!chip->plls)
return -ENOMEM;
- memcpy(chip->plls, chip->chip_spec->plls,
- sizeof(struct uniphier_aio_pll) * chip->num_plls);
for (i = 0; i < chip->num_aios; i++) {
struct uniphier_aio *aio = &chip->aios[i];
--
2.34.1
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
@ 2025-02-10 14:08 ` kernel test robot
2025-02-10 14:30 ` kernel test robot
2025-02-10 18:43 ` kernel test robot
2 siblings, 0 replies; 35+ messages in thread
From: kernel test robot @ 2025-02-10 14:08 UTC (permalink / raw)
To: Raag Jadav, gregkh, rafael, linus.walleij, mika.westerberg,
andriy.shevchenko, dmitry.torokhov, lgirdwood, broonie, sre,
jic23, przemyslaw.kitszel
Cc: oe-kbuild-all, linux-gpio, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio, Raag Jadav
Hi Raag,
kernel test robot noticed the following build errors:
[auto build test ERROR on a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744]
url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/driver-core-Split-devres-APIs-to-device-devres-h/20250210-145732
base: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
patch link: https://lore.kernel.org/r/20250210064906.2181867-2-raag.jadav%40intel.com
patch subject: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
config: powerpc-randconfig-003-20250210 (https://download.01.org/0day-ci/archive/20250210/202502102137.SA3rtuTB-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250210/202502102137.SA3rtuTB-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502102137.SA3rtuTB-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from arch/powerpc/include/asm/io.h:22,
from drivers/video/fbdev/sis/init.h:64,
from drivers/video/fbdev/sis/init.c:59:
include/linux/io.h: In function 'pci_remap_cfgspace':
>> include/linux/io.h:106:16: error: implicit declaration of function 'ioremap_np' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
>> include/linux/io.h:106:44: error: implicit declaration of function 'ioremap' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
>> include/linux/io.h:106:42: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h: At top level:
>> arch/powerpc/include/asm/io.h:885:22: error: conflicting types for 'ioremap'; have 'void *(phys_addr_t, long unsigned int)' {aka 'void *(unsigned int, long unsigned int)'}
885 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
| ^~~~~~~
include/linux/io.h:106:44: note: previous implicit declaration of 'ioremap' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
In file included from arch/powerpc/include/asm/io.h:1031:
>> include/asm-generic/io.h:1161:20: error: conflicting types for 'ioremap_np'; have 'void *(phys_addr_t, size_t)' {aka 'void *(unsigned int, unsigned int)'}
1161 | #define ioremap_np ioremap_np
| ^~~~~~~~~~
include/asm-generic/io.h:1162:29: note: in expansion of macro 'ioremap_np'
1162 | static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
| ^~~~~~~~~~
include/linux/io.h:106:16: note: previous implicit declaration of 'ioremap_np' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
--
In file included from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from arch/powerpc/include/asm/io.h:22,
from drivers/video/fbdev/sis/init301.h:64,
from drivers/video/fbdev/sis/init301.c:72:
include/linux/io.h: In function 'pci_remap_cfgspace':
>> include/linux/io.h:106:16: error: implicit declaration of function 'ioremap_np' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
>> include/linux/io.h:106:44: error: implicit declaration of function 'ioremap' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
>> include/linux/io.h:106:42: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h: At top level:
>> arch/powerpc/include/asm/io.h:885:22: error: conflicting types for 'ioremap'; have 'void *(phys_addr_t, long unsigned int)' {aka 'void *(unsigned int, long unsigned int)'}
885 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
| ^~~~~~~
include/linux/io.h:106:44: note: previous implicit declaration of 'ioremap' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
In file included from arch/powerpc/include/asm/io.h:1031:
>> include/asm-generic/io.h:1161:20: error: conflicting types for 'ioremap_np'; have 'void *(phys_addr_t, size_t)' {aka 'void *(unsigned int, unsigned int)'}
1161 | #define ioremap_np ioremap_np
| ^~~~~~~~~~
include/asm-generic/io.h:1162:29: note: in expansion of macro 'ioremap_np'
1162 | static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
| ^~~~~~~~~~
include/linux/io.h:106:16: note: previous implicit declaration of 'ioremap_np' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
drivers/video/fbdev/sis/init301.c: In function 'SiS_SetCRT2ModeRegs':
drivers/video/fbdev/sis/init301.c:2687:24: warning: variable 'modeflag' set but not used [-Wunused-but-set-variable]
2687 | unsigned short i, j, modeflag, tempah=0;
| ^~~~~~~~
drivers/video/fbdev/sis/init301.c: In function 'SiS_SetGroup1':
drivers/video/fbdev/sis/init301.c:6233:52: warning: variable 'resinfo' set but not used [-Wunused-but-set-variable]
6233 | unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0;
| ^~~~~~~
vim +/ioremap_np +106 include/linux/io.h
7d3dcf26a6559f Christoph Hellwig 2015-08-10 84
4d312ac057da57 Arnd Bergmann 2023-05-16 85 /* architectures can override this */
4d312ac057da57 Arnd Bergmann 2023-05-16 86 pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
4d312ac057da57 Arnd Bergmann 2023-05-16 87 unsigned long size, pgprot_t prot);
4d312ac057da57 Arnd Bergmann 2023-05-16 88
4d312ac057da57 Arnd Bergmann 2023-05-16 89
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 90 #ifdef CONFIG_PCI
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 91 /*
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 92 * The PCI specifications (Rev 3.0, 3.2.5 "Transaction Ordering and
b10eb2d50911f9 Hector Martin 2021-03-25 93 * Posting") mandate non-posted configuration transactions. This default
b10eb2d50911f9 Hector Martin 2021-03-25 94 * implementation attempts to use the ioremap_np() API to provide this
b10eb2d50911f9 Hector Martin 2021-03-25 95 * on arches that support it, and falls back to ioremap() on those that
b10eb2d50911f9 Hector Martin 2021-03-25 96 * don't. Overriding this function is deprecated; arches that properly
b10eb2d50911f9 Hector Martin 2021-03-25 97 * support non-posted accesses should implement ioremap_np() instead, which
b10eb2d50911f9 Hector Martin 2021-03-25 98 * this default implementation can then use to return mappings compliant with
b10eb2d50911f9 Hector Martin 2021-03-25 99 * the PCI specification.
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 100 */
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 101 #ifndef pci_remap_cfgspace
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 102 #define pci_remap_cfgspace pci_remap_cfgspace
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 103 static inline void __iomem *pci_remap_cfgspace(phys_addr_t offset,
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 104 size_t size)
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 105 {
b10eb2d50911f9 Hector Martin 2021-03-25 @106 return ioremap_np(offset, size) ?: ioremap(offset, size);
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 107 }
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 108 #endif
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 109 #endif
cf9ea8ca4a0bea Lorenzo Pieralisi 2017-04-19 110
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-10 14:08 ` kernel test robot
@ 2025-02-10 14:30 ` kernel test robot
2025-02-10 15:23 ` Andy Shevchenko
2025-02-10 18:43 ` kernel test robot
2 siblings, 1 reply; 35+ messages in thread
From: kernel test robot @ 2025-02-10 14:30 UTC (permalink / raw)
To: Raag Jadav, gregkh, rafael, linus.walleij, mika.westerberg,
andriy.shevchenko, dmitry.torokhov, lgirdwood, broonie, sre,
jic23, przemyslaw.kitszel
Cc: oe-kbuild-all, linux-gpio, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio, Raag Jadav
Hi Raag,
kernel test robot noticed the following build errors:
[auto build test ERROR on a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744]
url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/driver-core-Split-devres-APIs-to-device-devres-h/20250210-145732
base: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
patch link: https://lore.kernel.org/r/20250210064906.2181867-2-raag.jadav%40intel.com
patch subject: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
config: powerpc64-randconfig-002-20250210 (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502102201.zLWaJC6V-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from arch/powerpc/include/asm/io.h:22,
from include/linux/scatterlist.h:9,
from crypto/rsassa-pkcs1.c:11:
include/linux/io.h: In function 'pci_remap_cfgspace':
include/linux/io.h:106:16: error: implicit declaration of function 'ioremap_np' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
include/linux/io.h:106:44: error: implicit declaration of function 'ioremap' [-Wimplicit-function-declaration]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
include/linux/io.h:106:42: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h: At top level:
>> arch/powerpc/include/asm/io.h:885:22: error: conflicting types for 'ioremap'; have 'void *(phys_addr_t, long unsigned int)' {aka 'void *(long long unsigned int, long unsigned int)'}
885 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
| ^~~~~~~
include/linux/io.h:106:44: note: previous implicit declaration of 'ioremap' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~
In file included from include/asm-generic/io.h:17,
from arch/powerpc/include/asm/io.h:1031:
>> include/asm-generic/iomap.h:106:20: error: conflicting types for 'ioremap_np'; have 'void *(phys_addr_t, size_t)' {aka 'void *(long long unsigned int, long unsigned int)'}
106 | #define ioremap_np ioremap_np
| ^~~~~~~~~~
include/asm-generic/iomap.h:107:29: note: in expansion of macro 'ioremap_np'
107 | static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
| ^~~~~~~~~~
include/linux/io.h:106:16: note: previous implicit declaration of 'ioremap_np' with type 'int()'
106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
| ^~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/acpi.h:14,
from include/linux/i2c.h:13,
from drivers/input/touchscreen/ili210x.c:5:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/touchright.c:17:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/touchright.c: In function 'tr_connect':
drivers/input/touchscreen/touchright.c:114:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/touchright.c:114:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/penmount.c:17:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/penmount.c: In function 'pm_connect':
drivers/input/touchscreen/penmount.c:211:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/penmount.c:211:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/inexio.c:19:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/inexio.c: In function 'inexio_connect':
drivers/input/touchscreen/inexio.c:126:59: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/inexio.c:126:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/touchwin.c:24:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/touchwin.c: In function 'tw_connect':
drivers/input/touchscreen/touchwin.c:121:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/touchwin.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/hampshire.c:19:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/hampshire.c: In function 'hampshire_connect':
drivers/input/touchscreen/hampshire.c:122:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
122 | "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/hampshire.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
121 | snprintf(phampshire->phys, sizeof(phampshire->phys),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122 | "%s/input0", serio->phys);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/tsc40.c:12:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/tsc40.c: In function 'tsc_connect':
drivers/input/touchscreen/tsc40.c:95:53: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/tsc40.c:95:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/io.h:274,
from include/linux/io.h:14,
from include/linux/device/devres.h:7,
from include/linux/device.h:31,
from include/linux/input.h:19,
from drivers/input/touchscreen/dynapro.c:20:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
| ^~~~~~~~~~~
drivers/input/touchscreen/dynapro.c: In function 'dynapro_connect':
drivers/input/touchscreen/dynapro.c:123:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
123 | "%s/input0", serio->phys);
| ^~~~~~~
drivers/input/touchscreen/dynapro.c:122:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
122 | snprintf(pdynapro->phys, sizeof(pdynapro->phys),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123 | "%s/input0", serio->phys);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
vim +885 arch/powerpc/include/asm/io.h
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 853
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 854 /**
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 855 * ioremap - map bus memory into CPU space
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 856 * @address: bus address of the memory
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 857 * @size: size of the resource to map
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 858 *
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 859 * ioremap performs a platform specific sequence of operations to
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 860 * make bus memory CPU accessible via the readb/readw/readl/writeb/
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 861 * writew/writel functions and the other mmio helpers. The returned
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 862 * address is not guaranteed to be usable directly as a virtual
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 863 * address.
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 864 *
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 865 * We provide a few variations of it:
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 866 *
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 867 * * ioremap is the standard one and provides non-cacheable guarded mappings
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 868 * and can be hooked by the platform via ppc_md
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 869 *
40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 870 * * ioremap_prot allows to specify the page flags as an argument and can
40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 871 * also be hooked by the platform via ppc_md.
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 872 *
be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 873 * * ioremap_wc enables write combining
be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 874 *
86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 875 * * ioremap_wt enables write through
86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 876 *
86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 877 * * ioremap_coherent maps coherent cached memory
86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 878 *
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 879 * * iounmap undoes such a mapping and can be hooked
4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 880 *
1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 881 * * __ioremap_caller is the same as above but takes an explicit caller
1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 882 * reference rather than using __builtin_return_address(0)
1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 883 *
^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 884 */
68a64357d15ae4f include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-13 @885 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 886 #define ioremap ioremap
8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 887 #define ioremap_prot ioremap_prot
be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 888 extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 889 #define ioremap_wc ioremap_wc
894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 890
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 14:30 ` kernel test robot
@ 2025-02-10 15:23 ` Andy Shevchenko
2025-02-10 21:35 ` Raag Jadav
2025-02-11 7:36 ` Arnd Bergmann
0 siblings, 2 replies; 35+ messages in thread
From: Andy Shevchenko @ 2025-02-10 15:23 UTC (permalink / raw)
To: kernel test robot, Arnd Bergmann
Cc: Raag Jadav, gregkh, rafael, linus.walleij, mika.westerberg,
dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel, oe-kbuild-all, linux-gpio, linux-kernel,
linux-input, linux-sound, linux-pm, linux-iio
+Cc: Arnd
On Mon, Feb 10, 2025 at 10:30:28PM +0800, kernel test robot wrote:
> Hi Raag,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/driver-core-Split-devres-APIs-to-device-devres-h/20250210-145732
> base: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
> patch link: https://lore.kernel.org/r/20250210064906.2181867-2-raag.jadav%40intel.com
> patch subject: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
> config: powerpc64-randconfig-002-20250210 (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/config)
> compiler: powerpc64-linux-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202502102201.zLWaJC6V-lkp@intel.com/
>
> All error/warnings (new ones prefixed by >>):
TBH I have no quick idea how to address this. It seems that io.h includes device.h
for no reason (but I haven't checked that carefully). OTOH, we need only
IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h as the
former includes the latter and the definition depends only on compiler_types.h.
Arnd?
> In file included from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from arch/powerpc/include/asm/io.h:22,
> from include/linux/scatterlist.h:9,
> from crypto/rsassa-pkcs1.c:11:
> include/linux/io.h: In function 'pci_remap_cfgspace':
> include/linux/io.h:106:16: error: implicit declaration of function 'ioremap_np' [-Wimplicit-function-declaration]
> 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> | ^~~~~~~~~~
> include/linux/io.h:106:44: error: implicit declaration of function 'ioremap' [-Wimplicit-function-declaration]
> 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> | ^~~~~~~
> include/linux/io.h:106:42: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
> 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/include/asm/io.h: At top level:
> >> arch/powerpc/include/asm/io.h:885:22: error: conflicting types for 'ioremap'; have 'void *(phys_addr_t, long unsigned int)' {aka 'void *(long long unsigned int, long unsigned int)'}
> 885 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
> | ^~~~~~~
> include/linux/io.h:106:44: note: previous implicit declaration of 'ioremap' with type 'int()'
> 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> | ^~~~~~~
> In file included from include/asm-generic/io.h:17,
> from arch/powerpc/include/asm/io.h:1031:
> >> include/asm-generic/iomap.h:106:20: error: conflicting types for 'ioremap_np'; have 'void *(phys_addr_t, size_t)' {aka 'void *(long long unsigned int, long unsigned int)'}
> 106 | #define ioremap_np ioremap_np
> | ^~~~~~~~~~
> include/asm-generic/iomap.h:107:29: note: in expansion of macro 'ioremap_np'
> 107 | static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
> | ^~~~~~~~~~
> include/linux/io.h:106:16: note: previous implicit declaration of 'ioremap_np' with type 'int()'
> 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> | ^~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/acpi.h:14,
> from include/linux/i2c.h:13,
> from drivers/input/touchscreen/ili210x.c:5:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/touchright.c:17:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/touchright.c: In function 'tr_connect':
> drivers/input/touchscreen/touchright.c:114:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/touchright.c:114:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/penmount.c:17:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/penmount.c: In function 'pm_connect':
> drivers/input/touchscreen/penmount.c:211:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/penmount.c:211:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/inexio.c:19:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/inexio.c: In function 'inexio_connect':
> drivers/input/touchscreen/inexio.c:126:59: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/inexio.c:126:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/touchwin.c:24:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/touchwin.c: In function 'tw_connect':
> drivers/input/touchscreen/touchwin.c:121:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/touchwin.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/hampshire.c:19:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/hampshire.c: In function 'hampshire_connect':
> drivers/input/touchscreen/hampshire.c:122:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 122 | "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/hampshire.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 121 | snprintf(phampshire->phys, sizeof(phampshire->phys),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 122 | "%s/input0", serio->phys);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/tsc40.c:12:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/tsc40.c: In function 'tsc_connect':
> drivers/input/touchscreen/tsc40.c:95:53: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/tsc40.c:95:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> In file included from arch/powerpc/include/asm/io.h:274,
> from include/linux/io.h:14,
> from include/linux/device/devres.h:7,
> from include/linux/device.h:31,
> from include/linux/input.h:19,
> from drivers/input/touchscreen/dynapro.c:20:
> >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> | ^~~~~~~~~~~
> drivers/input/touchscreen/dynapro.c: In function 'dynapro_connect':
> drivers/input/touchscreen/dynapro.c:123:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> 123 | "%s/input0", serio->phys);
> | ^~~~~~~
> drivers/input/touchscreen/dynapro.c:122:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> 122 | snprintf(pdynapro->phys, sizeof(pdynapro->phys),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 123 | "%s/input0", serio->phys);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> vim +885 arch/powerpc/include/asm/io.h
>
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 853
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 854 /**
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 855 * ioremap - map bus memory into CPU space
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 856 * @address: bus address of the memory
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 857 * @size: size of the resource to map
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 858 *
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 859 * ioremap performs a platform specific sequence of operations to
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 860 * make bus memory CPU accessible via the readb/readw/readl/writeb/
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 861 * writew/writel functions and the other mmio helpers. The returned
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 862 * address is not guaranteed to be usable directly as a virtual
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 863 * address.
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 864 *
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 865 * We provide a few variations of it:
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 866 *
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 867 * * ioremap is the standard one and provides non-cacheable guarded mappings
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 868 * and can be hooked by the platform via ppc_md
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 869 *
> 40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 870 * * ioremap_prot allows to specify the page flags as an argument and can
> 40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 871 * also be hooked by the platform via ppc_md.
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 872 *
> be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 873 * * ioremap_wc enables write combining
> be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 874 *
> 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 875 * * ioremap_wt enables write through
> 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 876 *
> 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 877 * * ioremap_coherent maps coherent cached memory
> 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 878 *
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 879 * * iounmap undoes such a mapping and can be hooked
> 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 880 *
> 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 881 * * __ioremap_caller is the same as above but takes an explicit caller
> 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 882 * reference rather than using __builtin_return_address(0)
> 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 883 *
> ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 884 */
> 68a64357d15ae4f include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-13 @885 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
> 8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 886 #define ioremap ioremap
> 8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 887 #define ioremap_prot ioremap_prot
> be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 888 extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
> 894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 889 #define ioremap_wc ioremap_wc
> 894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 890
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-10 14:08 ` kernel test robot
2025-02-10 14:30 ` kernel test robot
@ 2025-02-10 18:43 ` kernel test robot
2 siblings, 0 replies; 35+ messages in thread
From: kernel test robot @ 2025-02-10 18:43 UTC (permalink / raw)
To: Raag Jadav, gregkh, rafael, linus.walleij, mika.westerberg,
andriy.shevchenko, dmitry.torokhov, lgirdwood, broonie, sre,
jic23, przemyslaw.kitszel
Cc: oe-kbuild-all, linux-gpio, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio, Raag Jadav
Hi Raag,
kernel test robot noticed the following build warnings:
[auto build test WARNING on a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744]
url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/driver-core-Split-devres-APIs-to-device-devres-h/20250210-145732
base: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
patch link: https://lore.kernel.org/r/20250210064906.2181867-2-raag.jadav%40intel.com
patch subject: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20250211/202502110256.ZtYROQTy-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250211/202502110256.ZtYROQTy-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502110256.ZtYROQTy-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/input/input.c:14:
In file included from include/linux/input/mt.h:11:
In file included from include/linux/input.h:19:
In file included from include/linux/device.h:31:
In file included from include/linux/device/devres.h:7:
In file included from include/linux/io.h:14:
In file included from arch/powerpc/include/asm/io.h:274:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: declaration of 'struct iommu_group' will not be visible outside of this function [-Wvisibility]
struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
^
1 warning generated.
--
In file included from drivers/input/touchscreen/mms114.c:10:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:31:
In file included from include/linux/device/devres.h:7:
In file included from include/linux/io.h:14:
In file included from arch/powerpc/include/asm/io.h:274:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: declaration of 'struct iommu_group' will not be visible outside of this function [-Wvisibility]
struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
^
drivers/input/touchscreen/mms114.c:507:15: warning: cast to smaller integer type 'enum mms_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
data->type = (enum mms_type)match_data;
^~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
--
In file included from drivers/input/touchscreen/wdt87xx_i2c.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:31:
In file included from include/linux/device/devres.h:7:
In file included from include/linux/io.h:14:
In file included from arch/powerpc/include/asm/io.h:274:
>> arch/powerpc/include/asm/eeh.h:304:45: warning: declaration of 'struct iommu_group' will not be visible outside of this function [-Wvisibility]
struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
^
drivers/input/touchscreen/wdt87xx_i2c.c:1156:36: warning: unused variable 'wdt87xx_acpi_id' [-Wunused-const-variable]
static const struct acpi_device_id wdt87xx_acpi_id[] = {
^
2 warnings generated.
vim +304 arch/powerpc/include/asm/eeh.h
55037d176107c3 arch/powerpc/include/asm/eeh.h Gavin Shan 2012-09-07 292
c44e4ccadaca58 arch/powerpc/include/asm/eeh.h Sam Bobroff 2019-08-16 293 void eeh_show_enabled(void);
d125aedb404204 arch/powerpc/include/asm/eeh.h Oliver O'Halloran 2020-09-18 294 int __init eeh_init(struct eeh_ops *ops);
3e938052fb7655 arch/powerpc/include/asm/eeh.h Gavin Shan 2014-09-30 295 int eeh_check_failure(const volatile void __iomem *token);
f8f7d63fd96ead arch/powerpc/include/asm/eeh.h Gavin Shan 2012-09-07 296 int eeh_dev_check_failure(struct eeh_dev *edev);
685a0bc00abcf1 arch/powerpc/include/asm/eeh.h Sam Bobroff 2019-08-16 297 void eeh_addr_cache_init(void);
e86350f70a02e5 arch/powerpc/include/asm/eeh.h Oliver O'Halloran 2020-03-06 298 void eeh_probe_device(struct pci_dev *pdev);
807a827d4e7455 arch/powerpc/include/asm/eeh.h Gavin Shan 2013-07-24 299 void eeh_remove_device(struct pci_dev *);
188fdea69fa91d arch/powerpc/include/asm/eeh.h Sam Bobroff 2018-11-29 300 int eeh_unfreeze_pe(struct eeh_pe *pe);
5cfb20b96f624e arch/powerpc/include/asm/eeh.h Gavin Shan 2014-09-30 301 int eeh_pe_reset_and_recover(struct eeh_pe *pe);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 302 int eeh_dev_open(struct pci_dev *pdev);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 303 void eeh_dev_release(struct pci_dev *pdev);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 @304 struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 305 int eeh_pe_set_option(struct eeh_pe *pe, int option);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 306 int eeh_pe_get_state(struct eeh_pe *pe);
1ef52073fd25ea arch/powerpc/include/asm/eeh.h Sam Bobroff 2018-11-29 307 int eeh_pe_reset(struct eeh_pe *pe, int option, bool include_passed);
212d16cdca2d0f arch/powerpc/include/asm/eeh.h Gavin Shan 2014-06-10 308 int eeh_pe_configure(struct eeh_pe *pe);
ec33d36e5ab5d5 arch/powerpc/include/asm/eeh.h Gavin Shan 2015-03-26 309 int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
ec33d36e5ab5d5 arch/powerpc/include/asm/eeh.h Gavin Shan 2015-03-26 310 unsigned long addr, unsigned long mask);
b0e2b828dfca64 arch/powerpc/include/asm/eeh.h Narayana Murty N 2024-09-09 311 int eeh_pe_inject_mmio_error(struct pci_dev *pdev);
e2a296eeaa3444 include/asm-powerpc/eeh.h Linas Vepstas 2005-11-03 312
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 15:23 ` Andy Shevchenko
@ 2025-02-10 21:35 ` Raag Jadav
2025-02-11 7:36 ` Arnd Bergmann
1 sibling, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-10 21:35 UTC (permalink / raw)
To: Andy Shevchenko
Cc: kernel test robot, Arnd Bergmann, gregkh, rafael, linus.walleij,
mika.westerberg, dmitry.torokhov, lgirdwood, broonie, sre, jic23,
przemyslaw.kitszel, oe-kbuild-all, linux-gpio, linux-kernel,
linux-input, linux-sound, linux-pm, linux-iio
On Mon, Feb 10, 2025 at 05:23:33PM +0200, Andy Shevchenko wrote:
> +Cc: Arnd
>
> On Mon, Feb 10, 2025 at 10:30:28PM +0800, kernel test robot wrote:
> > Hi Raag,
> >
> > kernel test robot noticed the following build errors:
> >
> > [auto build test ERROR on a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/driver-core-Split-devres-APIs-to-device-devres-h/20250210-145732
> > base: a1e062ab4a1f19bb0e94093ef90ab9a74f1f7744
> > patch link: https://lore.kernel.org/r/20250210064906.2181867-2-raag.jadav%40intel.com
> > patch subject: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
> > config: powerpc64-randconfig-002-20250210 (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/config)
> > compiler: powerpc64-linux-gcc (GCC) 14.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250210/202502102201.zLWaJC6V-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202502102201.zLWaJC6V-lkp@intel.com/
> >
> > All error/warnings (new ones prefixed by >>):
>
> TBH I have no quick idea how to address this. It seems that io.h includes device.h
> for no reason (but I haven't checked that carefully). OTOH, we need only
> IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h as the
> former includes the latter and the definition depends only on compiler_types.h.
I atleast managed to build this after dropping device.h from asm/io.h however
eeh.h is just something else.
Raag
> Arnd?
>
> > In file included from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from arch/powerpc/include/asm/io.h:22,
> > from include/linux/scatterlist.h:9,
> > from crypto/rsassa-pkcs1.c:11:
> > include/linux/io.h: In function 'pci_remap_cfgspace':
> > include/linux/io.h:106:16: error: implicit declaration of function 'ioremap_np' [-Wimplicit-function-declaration]
> > 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> > | ^~~~~~~~~~
> > include/linux/io.h:106:44: error: implicit declaration of function 'ioremap' [-Wimplicit-function-declaration]
> > 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> > | ^~~~~~~
> > include/linux/io.h:106:42: error: returning 'int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
> > 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> > arch/powerpc/include/asm/io.h: At top level:
> > >> arch/powerpc/include/asm/io.h:885:22: error: conflicting types for 'ioremap'; have 'void *(phys_addr_t, long unsigned int)' {aka 'void *(long long unsigned int, long unsigned int)'}
> > 885 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
> > | ^~~~~~~
> > include/linux/io.h:106:44: note: previous implicit declaration of 'ioremap' with type 'int()'
> > 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> > | ^~~~~~~
> > In file included from include/asm-generic/io.h:17,
> > from arch/powerpc/include/asm/io.h:1031:
> > >> include/asm-generic/iomap.h:106:20: error: conflicting types for 'ioremap_np'; have 'void *(phys_addr_t, size_t)' {aka 'void *(long long unsigned int, long unsigned int)'}
> > 106 | #define ioremap_np ioremap_np
> > | ^~~~~~~~~~
> > include/asm-generic/iomap.h:107:29: note: in expansion of macro 'ioremap_np'
> > 107 | static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
> > | ^~~~~~~~~~
> > include/linux/io.h:106:16: note: previous implicit declaration of 'ioremap_np' with type 'int()'
> > 106 | return ioremap_np(offset, size) ?: ioremap(offset, size);
> > | ^~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/acpi.h:14,
> > from include/linux/i2c.h:13,
> > from drivers/input/touchscreen/ili210x.c:5:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/touchright.c:17:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/touchright.c: In function 'tr_connect':
> > drivers/input/touchscreen/touchright.c:114:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/touchright.c:114:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 114 | snprintf(tr->phys, sizeof(tr->phys), "%s/input0", serio->phys);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/penmount.c:17:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/penmount.c: In function 'pm_connect':
> > drivers/input/touchscreen/penmount.c:211:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/penmount.c:211:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 211 | snprintf(pm->phys, sizeof(pm->phys), "%s/input0", serio->phys);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/inexio.c:19:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/inexio.c: In function 'inexio_connect':
> > drivers/input/touchscreen/inexio.c:126:59: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/inexio.c:126:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 126 | snprintf(pinexio->phys, sizeof(pinexio->phys), "%s/input0", serio->phys);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/touchwin.c:24:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/touchwin.c: In function 'tw_connect':
> > drivers/input/touchscreen/touchwin.c:121:49: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/touchwin.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 121 | snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/hampshire.c:19:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/hampshire.c: In function 'hampshire_connect':
> > drivers/input/touchscreen/hampshire.c:122:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 122 | "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/hampshire.c:121:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 121 | snprintf(phampshire->phys, sizeof(phampshire->phys),
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 122 | "%s/input0", serio->phys);
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/tsc40.c:12:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/tsc40.c: In function 'tsc_connect':
> > drivers/input/touchscreen/tsc40.c:95:53: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/tsc40.c:95:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 95 | snprintf(ptsc->phys, sizeof(ptsc->phys), "%s/input0", serio->phys);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > --
> > In file included from arch/powerpc/include/asm/io.h:274,
> > from include/linux/io.h:14,
> > from include/linux/device/devres.h:7,
> > from include/linux/device.h:31,
> > from include/linux/input.h:19,
> > from drivers/input/touchscreen/dynapro.c:20:
> > >> arch/powerpc/include/asm/eeh.h:304:45: warning: 'struct iommu_group' declared inside parameter list will not be visible outside of this definition or declaration
> > 304 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
> > | ^~~~~~~~~~~
> > drivers/input/touchscreen/dynapro.c: In function 'dynapro_connect':
> > drivers/input/touchscreen/dynapro.c:123:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
> > 123 | "%s/input0", serio->phys);
> > | ^~~~~~~
> > drivers/input/touchscreen/dynapro.c:122:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
> > 122 | snprintf(pdynapro->phys, sizeof(pdynapro->phys),
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 123 | "%s/input0", serio->phys);
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > vim +885 arch/powerpc/include/asm/io.h
> >
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 853
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 854 /**
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 855 * ioremap - map bus memory into CPU space
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 856 * @address: bus address of the memory
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 857 * @size: size of the resource to map
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 858 *
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 859 * ioremap performs a platform specific sequence of operations to
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 860 * make bus memory CPU accessible via the readb/readw/readl/writeb/
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 861 * writew/writel functions and the other mmio helpers. The returned
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 862 * address is not guaranteed to be usable directly as a virtual
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 863 * address.
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 864 *
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 865 * We provide a few variations of it:
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 866 *
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 867 * * ioremap is the standard one and provides non-cacheable guarded mappings
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 868 * and can be hooked by the platform via ppc_md
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 869 *
> > 40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 870 * * ioremap_prot allows to specify the page flags as an argument and can
> > 40f1ce7fb7e8b5d arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 871 * also be hooked by the platform via ppc_md.
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 872 *
> > be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 873 * * ioremap_wc enables write combining
> > be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 874 *
> > 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 875 * * ioremap_wt enables write through
> > 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 876 *
> > 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 877 * * ioremap_coherent maps coherent cached memory
> > 86c391bd5f47101 arch/powerpc/include/asm/io.h Christophe Leroy 2018-10-09 878 *
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 879 * * iounmap undoes such a mapping and can be hooked
> > 4cb3cee03d558fd include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-11 880 *
> > 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 881 * * __ioremap_caller is the same as above but takes an explicit caller
> > 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 882 * reference rather than using __builtin_return_address(0)
> > 1cdab55d8a8313f arch/powerpc/include/asm/io.h Benjamin Herrenschmidt 2009-02-22 883 *
> > ^1da177e4c3f415 include/asm-ppc64/io.h Linus Torvalds 2005-04-16 884 */
> > 68a64357d15ae4f include/asm-powerpc/io.h Benjamin Herrenschmidt 2006-11-13 @885 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
> > 8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 886 #define ioremap ioremap
> > 8d05554dca2af6a arch/powerpc/include/asm/io.h Christophe Leroy 2023-07-06 887 #define ioremap_prot ioremap_prot
> > be135f40899cb33 arch/powerpc/include/asm/io.h Anton Blanchard 2011-05-08 888 extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
> > 894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 889 #define ioremap_wc ioremap_wc
> > 894fa235eb4ca0b arch/powerpc/include/asm/io.h Christophe Leroy 2020-11-21 890
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-10 15:23 ` Andy Shevchenko
2025-02-10 21:35 ` Raag Jadav
@ 2025-02-11 7:36 ` Arnd Bergmann
2025-02-11 9:27 ` Andy Shevchenko
1 sibling, 1 reply; 35+ messages in thread
From: Arnd Bergmann @ 2025-02-11 7:36 UTC (permalink / raw)
To: Andy Shevchenko, kernel test robot
Cc: Raag Jadav, Greg Kroah-Hartman, Rafael J . Wysocki, Linus Walleij,
Mika Westerberg, Dmitry Torokhov, lgirdwood, Mark Brown,
Sebastian Reichel, Jonathan Cameron, Przemek Kitszel,
oe-kbuild-all, open list:GPIO SUBSYSTEM, linux-kernel,
linux-input, linux-sound, linux-pm, linux-iio
On Mon, Feb 10, 2025, at 16:23, Andy Shevchenko wrote:
> +Cc: Arnd
>
>
> TBH I have no quick idea how to address this. It seems that io.h
> includes device.h
> for no reason (but I haven't checked that carefully). OTOH, we need only
> IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h
> as the
> former includes the latter and the definition depends only on
> compiler_types.h.
>
> Arnd?
Removing linux/device.h from asm/io.h is probably the right step,
it really has no business in there and no other architecture
includes it. I don't see an IOMEM_IS_ERR() definition, do you
mean EEH_POSSIBLE_ERROR?
Most of asm/eeh.h probably shouldn't be included by asm/io.h
either, my guess is that we can get away with the
eeh_{s,}{b,w,l,q}{_be} helpers, eeh_memcpy_fromio() and
eeh_check_failure(), which have no dependency on 'struct
device' in the header.
Removing a giant header inclusion from another one likely causes
build regressions in drivers that should have included the
header (linux/device.h or something included by that) themselves,
so ideally there should be some separate build testing of
powerpc kernels.
Arnd
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 7:36 ` Arnd Bergmann
@ 2025-02-11 9:27 ` Andy Shevchenko
2025-02-11 9:39 ` Arnd Bergmann
0 siblings, 1 reply; 35+ messages in thread
From: Andy Shevchenko @ 2025-02-11 9:27 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025 at 08:36:47AM +0100, Arnd Bergmann wrote:
> On Mon, Feb 10, 2025, at 16:23, Andy Shevchenko wrote:
> >
> > TBH I have no quick idea how to address this. It seems that io.h
> > includes device.h
> > for no reason (but I haven't checked that carefully). OTOH, we need only
> > IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h
> > as the
> > former includes the latter and the definition depends only on
> > compiler_types.h.
> >
> > Arnd?
>
> Removing linux/device.h from asm/io.h is probably the right step,
> it really has no business in there and no other architecture
> includes it. I don't see an IOMEM_IS_ERR() definition, do you
> mean EEH_POSSIBLE_ERROR?
The definition is in the generic header and patch here relies on
that definition to fix the sparse warning. The simplest solution
is to add another patch that simply moves the macro from
linux/io.h to linux/err.h.
> Most of asm/eeh.h probably shouldn't be included by asm/io.h
> either, my guess is that we can get away with the
> eeh_{s,}{b,w,l,q}{_be} helpers, eeh_memcpy_fromio() and
> eeh_check_failure(), which have no dependency on 'struct
> device' in the header.
>
> Removing a giant header inclusion from another one likely causes
> build regressions in drivers that should have included the
> header (linux/device.h or something included by that) themselves,
> so ideally there should be some separate build testing of
> powerpc kernels.
I believe this might be far out of scope for this series due to potential
fallouts here and there. But would be good to have it separately.
Raag, I think if you have time and motivation you can create that patch,
but send it separately. And this series can be fixed with the move of the
macro.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 9:27 ` Andy Shevchenko
@ 2025-02-11 9:39 ` Arnd Bergmann
2025-02-11 10:11 ` Andy Shevchenko
0 siblings, 1 reply; 35+ messages in thread
From: Arnd Bergmann @ 2025-02-11 9:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025, at 10:27, Andy Shevchenko wrote:
> On Tue, Feb 11, 2025 at 08:36:47AM +0100, Arnd Bergmann wrote:
>> On Mon, Feb 10, 2025, at 16:23, Andy Shevchenko wrote:
>> >
>> > TBH I have no quick idea how to address this. It seems that io.h
>> > includes device.h
>> > for no reason (but I haven't checked that carefully). OTOH, we need only
>> > IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h
>> > as the
>> > former includes the latter and the definition depends only on
>> > compiler_types.h.
>> >
>> > Arnd?
>>
>> Removing linux/device.h from asm/io.h is probably the right step,
>> it really has no business in there and no other architecture
>> includes it. I don't see an IOMEM_IS_ERR() definition, do you
>> mean EEH_POSSIBLE_ERROR?
>
> The definition is in the generic header and patch here relies on
> that definition to fix the sparse warning. The simplest solution
> is to add another patch that simply moves the macro from
> linux/io.h to linux/err.h.
Ah, IOMEM_ERR_PTR(), not IOMEM_IS_ERR().
I don't mind moving that if it helps you, but don't see what
the problem is here. Is this missing because of a circular
#include list with linux/device.h including asm/io.h and vice
versa? If that is the root cause, then I assume there will be
additional problems either way until the loop can be broken.
>> Most of asm/eeh.h probably shouldn't be included by asm/io.h
>> either, my guess is that we can get away with the
>> eeh_{s,}{b,w,l,q}{_be} helpers, eeh_memcpy_fromio() and
>> eeh_check_failure(), which have no dependency on 'struct
>> device' in the header.
>>
>> Removing a giant header inclusion from another one likely causes
>> build regressions in drivers that should have included the
>> header (linux/device.h or something included by that) themselves,
>> so ideally there should be some separate build testing of
>> powerpc kernels.
>
> I believe this might be far out of scope for this series due to potential
> fallouts here and there. But would be good to have it separately.
It certainly gets towards yak-shaving, but it does look like
the best solution. It really depends on how much breaks -- if there
are only a couple of missing #include statements, I can see those
get merged early as a bugfix or as part of another series. If there
are a lot of them, it is probably not worth it.
Arnd
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 9:39 ` Arnd Bergmann
@ 2025-02-11 10:11 ` Andy Shevchenko
2025-02-11 10:23 ` Arnd Bergmann
0 siblings, 1 reply; 35+ messages in thread
From: Andy Shevchenko @ 2025-02-11 10:11 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025 at 10:39:16AM +0100, Arnd Bergmann wrote:
> On Tue, Feb 11, 2025, at 10:27, Andy Shevchenko wrote:
> > On Tue, Feb 11, 2025 at 08:36:47AM +0100, Arnd Bergmann wrote:
> >> On Mon, Feb 10, 2025, at 16:23, Andy Shevchenko wrote:
> >> >
> >> > TBH I have no quick idea how to address this. It seems that io.h
> >> > includes device.h
> >> > for no reason (but I haven't checked that carefully). OTOH, we need only
> >> > IOMEM_IS_ERR() definition which can simply be moved from io.h to err.h
> >> > as the
> >> > former includes the latter and the definition depends only on
> >> > compiler_types.h.
> >> >
> >> > Arnd?
> >>
> >> Removing linux/device.h from asm/io.h is probably the right step,
> >> it really has no business in there and no other architecture
> >> includes it. I don't see an IOMEM_IS_ERR() definition, do you
> >> mean EEH_POSSIBLE_ERROR?
> >
> > The definition is in the generic header and patch here relies on
> > that definition to fix the sparse warning. The simplest solution
> > is to add another patch that simply moves the macro from
> > linux/io.h to linux/err.h.
>
> Ah, IOMEM_ERR_PTR(), not IOMEM_IS_ERR().
Oh, yes, sorry for the confusion.
> I don't mind moving that if it helps you, but don't see what
> the problem is here. Is this missing because of a circular
> #include list with linux/device.h including asm/io.h and vice
> versa? If that is the root cause, then I assume there will be
> additional problems either way until the loop can be broken.
I don't see how. io.h already includes err.h, so whoever includes io.h should
have that as previously.
> >> Most of asm/eeh.h probably shouldn't be included by asm/io.h
> >> either, my guess is that we can get away with the
> >> eeh_{s,}{b,w,l,q}{_be} helpers, eeh_memcpy_fromio() and
> >> eeh_check_failure(), which have no dependency on 'struct
> >> device' in the header.
> >>
> >> Removing a giant header inclusion from another one likely causes
> >> build regressions in drivers that should have included the
> >> header (linux/device.h or something included by that) themselves,
> >> so ideally there should be some separate build testing of
> >> powerpc kernels.
> >
> > I believe this might be far out of scope for this series due to potential
> > fallouts here and there. But would be good to have it separately.
>
> It certainly gets towards yak-shaving, but it does look like
> the best solution. It really depends on how much breaks -- if there
> are only a couple of missing #include statements, I can see those
> get merged early as a bugfix or as part of another series. If there
> are a lot of them, it is probably not worth it.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 10:11 ` Andy Shevchenko
@ 2025-02-11 10:23 ` Arnd Bergmann
2025-02-11 11:37 ` Andy Shevchenko
0 siblings, 1 reply; 35+ messages in thread
From: Arnd Bergmann @ 2025-02-11 10:23 UTC (permalink / raw)
To: Andy Shevchenko
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025, at 11:11, Andy Shevchenko wrote:
> On Tue, Feb 11, 2025 at 10:39:16AM +0100, Arnd Bergmann wrote:
>> On Tue, Feb 11, 2025, at 10:27, Andy Shevchenko wrote:
>
>> I don't mind moving that if it helps you, but don't see what
>> the problem is here. Is this missing because of a circular
>> #include list with linux/device.h including asm/io.h and vice
>> versa? If that is the root cause, then I assume there will be
>> additional problems either way until the loop can be broken.
>
> I don't see how. io.h already includes err.h, so whoever includes io.h should
> have that as previously.
I mean I never understood what problem you are trying to solve
exactly. From the log, it appears that the problem is an include
loop between linux/device.h, linux/device/devres.h and asm/io.h,
and anything that breaks the loop should work. Your suggestion of
stopping asm/io.h from including linux/device.h sounds like
the most promising here, but this should be possible regardless
of whether IOMEM_ERR_PTR() gets moved.
Arnd
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 10:23 ` Arnd Bergmann
@ 2025-02-11 11:37 ` Andy Shevchenko
2025-02-11 11:56 ` Arnd Bergmann
0 siblings, 1 reply; 35+ messages in thread
From: Andy Shevchenko @ 2025-02-11 11:37 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025 at 11:23:07AM +0100, Arnd Bergmann wrote:
> On Tue, Feb 11, 2025, at 11:11, Andy Shevchenko wrote:
> > On Tue, Feb 11, 2025 at 10:39:16AM +0100, Arnd Bergmann wrote:
> >> On Tue, Feb 11, 2025, at 10:27, Andy Shevchenko wrote:
> >
> >> I don't mind moving that if it helps you, but don't see what
> >> the problem is here. Is this missing because of a circular
> >> #include list with linux/device.h including asm/io.h and vice
> >> versa? If that is the root cause, then I assume there will be
> >> additional problems either way until the loop can be broken.
> >
> > I don't see how. io.h already includes err.h, so whoever includes io.h should
> > have that as previously.
>
> I mean I never understood what problem you are trying to solve
> exactly. From the log, it appears that the problem is an include
> loop between linux/device.h, linux/device/devres.h and asm/io.h,
> and anything that breaks the loop should work. Your suggestion of
> stopping asm/io.h from including linux/device.h sounds like
> the most promising here, but this should be possible regardless
> of whether IOMEM_ERR_PTR() gets moved.
The problem this series solves at the beginning is that not all the consumers
of device.h needs it, in many cases the device/devres.h (or subset of
device/*.h) is enough to include. While solving this, it appears that
the current code uses ERR_PTR() instead of IOMEM_ERR_PTR() in devm_*io*() APIs
and kernel test robot found this and complained about. While solving
this new issue, LKP found another issue that is circular dependency.
But the original code only wants to have an access to IOMEM_ERR_PTR() which
is in io.h and can be moved to err.h AFAICS. Does this sound reasonable?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 11:37 ` Andy Shevchenko
@ 2025-02-11 11:56 ` Arnd Bergmann
2025-02-11 12:10 ` Andy Shevchenko
0 siblings, 1 reply; 35+ messages in thread
From: Arnd Bergmann @ 2025-02-11 11:56 UTC (permalink / raw)
To: Andy Shevchenko
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025, at 12:37, Andy Shevchenko wrote:
>
> The problem this series solves at the beginning is that not all the consumers
> of device.h needs it, in many cases the device/devres.h (or subset of
> device/*.h) is enough to include. While solving this, it appears that
> the current code uses ERR_PTR() instead of IOMEM_ERR_PTR() in devm_*io*() APIs
> and kernel test robot found this and complained about. While solving
> this new issue, LKP found another issue that is circular dependency.
> But the original code only wants to have an access to IOMEM_ERR_PTR() which
> is in io.h and can be moved to err.h AFAICS. Does this sound reasonable?
Yes, that sounds fine to me. I agree that not including linux/io.h
from device/devres.h is a good idea, same as no longer including
linux/device.h from asm/io.h. Moving IOMEM_ERR_PTR() as you
describe is the right idea.
Side note: I looked at large-scale header file cleanups in the past,
and in general the result of that was that the best way to reduce the
indirect inclusions is by splitting data structure definitions from
inline functions that use those data structures. The definition of
"struct device" clearly has too many dependencies, and to make
this one better. There has actually been some good preparatory work
done by Kent Overstreet a while ago that moves structures out
(e.g. work_struct and mutex), but not yet struct device and
struct kobject, which are needed in many other headers. The tricky
part that needs to happen to actually make it useful later on is
to replace all the unnecessary indirect includes with the minimal
ones, and that is a huge amount of work.
Arnd
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 11:56 ` Arnd Bergmann
@ 2025-02-11 12:10 ` Andy Shevchenko
2025-02-11 12:57 ` Raag Jadav
0 siblings, 1 reply; 35+ messages in thread
From: Andy Shevchenko @ 2025-02-11 12:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, Raag Jadav, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025 at 12:56:11PM +0100, Arnd Bergmann wrote:
> On Tue, Feb 11, 2025, at 12:37, Andy Shevchenko wrote:
> >
> > The problem this series solves at the beginning is that not all the consumers
> > of device.h needs it, in many cases the device/devres.h (or subset of
> > device/*.h) is enough to include. While solving this, it appears that
> > the current code uses ERR_PTR() instead of IOMEM_ERR_PTR() in devm_*io*() APIs
> > and kernel test robot found this and complained about. While solving
> > this new issue, LKP found another issue that is circular dependency.
> > But the original code only wants to have an access to IOMEM_ERR_PTR() which
> > is in io.h and can be moved to err.h AFAICS. Does this sound reasonable?
>
> Yes, that sounds fine to me. I agree that not including linux/io.h
> from device/devres.h is a good idea, same as no longer including
> linux/device.h from asm/io.h. Moving IOMEM_ERR_PTR() as you
> describe is the right idea.
Thank you for confirming the idea. Raag, please follow as suggested:
Move IOMEM_ERR_PTR() to err.h (perhaps in a separate patch),
and drop io.h from devres.h as it will be not needed.
> Side note: I looked at large-scale header file cleanups in the past,
> and in general the result of that was that the best way to reduce the
> indirect inclusions is by splitting data structure definitions from
> inline functions that use those data structures. The definition of
> "struct device" clearly has too many dependencies, and to make
> this one better. There has actually been some good preparatory work
> done by Kent Overstreet a while ago that moves structures out
> (e.g. work_struct and mutex), but not yet struct device and
> struct kobject, which are needed in many other headers. The tricky
> part that needs to happen to actually make it useful later on is
> to replace all the unnecessary indirect includes with the minimal
> ones, and that is a huge amount of work.
Good to hear that somebody is working on the dependency hell untangling.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h
2025-02-11 12:10 ` Andy Shevchenko
@ 2025-02-11 12:57 ` Raag Jadav
0 siblings, 0 replies; 35+ messages in thread
From: Raag Jadav @ 2025-02-11 12:57 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Arnd Bergmann, kernel test robot, Greg Kroah-Hartman,
Rafael J . Wysocki, Linus Walleij, Mika Westerberg,
Dmitry Torokhov, lgirdwood, Mark Brown, Sebastian Reichel,
Jonathan Cameron, Przemek Kitszel, oe-kbuild-all,
open list:GPIO SUBSYSTEM, linux-kernel, linux-input, linux-sound,
linux-pm, linux-iio
On Tue, Feb 11, 2025 at 02:10:51PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 11, 2025 at 12:56:11PM +0100, Arnd Bergmann wrote:
> > On Tue, Feb 11, 2025, at 12:37, Andy Shevchenko wrote:
> > >
> > > The problem this series solves at the beginning is that not all the consumers
> > > of device.h needs it, in many cases the device/devres.h (or subset of
> > > device/*.h) is enough to include. While solving this, it appears that
> > > the current code uses ERR_PTR() instead of IOMEM_ERR_PTR() in devm_*io*() APIs
> > > and kernel test robot found this and complained about. While solving
> > > this new issue, LKP found another issue that is circular dependency.
> > > But the original code only wants to have an access to IOMEM_ERR_PTR() which
> > > is in io.h and can be moved to err.h AFAICS. Does this sound reasonable?
> >
> > Yes, that sounds fine to me. I agree that not including linux/io.h
> > from device/devres.h is a good idea, same as no longer including
> > linux/device.h from asm/io.h. Moving IOMEM_ERR_PTR() as you
> > describe is the right idea.
>
> Thank you for confirming the idea. Raag, please follow as suggested:
>
> Move IOMEM_ERR_PTR() to err.h (perhaps in a separate patch),
> and drop io.h from devres.h as it will be not needed.
Sure, and perhaps drop a few patches to reduce spam while we sort this out.
Raag
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2025-02-11 12:57 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 6:48 [PATCH v4 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-10 14:08 ` kernel test robot
2025-02-10 14:30 ` kernel test robot
2025-02-10 15:23 ` Andy Shevchenko
2025-02-10 21:35 ` Raag Jadav
2025-02-11 7:36 ` Arnd Bergmann
2025-02-11 9:27 ` Andy Shevchenko
2025-02-11 9:39 ` Arnd Bergmann
2025-02-11 10:11 ` Andy Shevchenko
2025-02-11 10:23 ` Arnd Bergmann
2025-02-11 11:37 ` Andy Shevchenko
2025-02-11 11:56 ` Arnd Bergmann
2025-02-11 12:10 ` Andy Shevchenko
2025-02-11 12:57 ` Raag Jadav
2025-02-10 18:43 ` kernel test robot
2025-02-10 6:48 ` [PATCH v4 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
2025-02-10 6:48 ` [PATCH v4 03/20] devres: Introduce devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 04/20] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 05/20] pinctrl: baytrail: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 06/20] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
2025-02-10 6:48 ` [PATCH v4 07/20] pinctrl: tangier: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 08/20] pinctrl: pxa2xx: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 09/20] input: sparse-keymap: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 10/20] input: ipaq-micro-keys: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 11/20] regulator: devres: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 12/20] regulator: cros-ec: " Raag Jadav
2025-02-10 6:48 ` [PATCH v4 13/20] power: supply: sc27xx: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 14/20] iio: adc: xilinx-xadc-core: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 15/20] ASoC: Intel: avs: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 16/20] ASoC: hdac_hdmi: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 17/20] ASoC: tlv320dac33: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 18/20] ASoC: uda1380: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 19/20] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-10 6:49 ` [PATCH v4 20/20] ASoC: uniphier: " Raag Jadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).