* [PATCH] driver core: device.h: fix incorrect type in return expression
@ 2025-01-22 7:35 xiaopeitux
2025-02-21 8:20 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: xiaopeitux @ 2025-01-22 7:35 UTC (permalink / raw)
To: gregkh, broonie, linux-kernel; +Cc: Pei Xiao, kernel test robot
From: Pei Xiao <xiaopei01@kylinos.cn>
sparse warnings:
sparse: incorrect type in return expression, expected void
[noderef] __iomem *, got void *
Fix sparse warnings by use IOMEM_ERR_PTR
Fixes: da7c07b10838 ("driver core: Provide stubs for !IOMEM builds")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501221439.YoPUrrqD-lkp@intel.com/
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
include/linux/device.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/device.h b/include/linux/device.h
index 667cb6db9019..d76c31b9f9b9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -378,14 +378,14 @@ static inline
void __iomem *devm_ioremap_resource(struct device *dev,
const struct resource *res)
{
- return ERR_PTR(-EINVAL);
+ return IOMEM_ERR_PTR(-EINVAL);
}
static inline
void __iomem *devm_ioremap_resource_wc(struct device *dev,
const struct resource *res)
{
- return ERR_PTR(-EINVAL);
+ return IOMEM_ERR_PTR(-EINVAL);
}
static inline
@@ -393,7 +393,7 @@ void __iomem *devm_of_iomap(struct device *dev,
struct device_node *node, int index,
resource_size_t *size)
{
- return ERR_PTR(-EINVAL);
+ return IOMEM_ERR_PTR(-EINVAL);
}
#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] driver core: device.h: fix incorrect type in return expression
2025-01-22 7:35 [PATCH] driver core: device.h: fix incorrect type in return expression xiaopeitux
@ 2025-02-21 8:20 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-02-21 8:20 UTC (permalink / raw)
To: xiaopeitux; +Cc: broonie, linux-kernel, Pei Xiao, kernel test robot
On Wed, Jan 22, 2025 at 03:35:03PM +0800, xiaopeitux@foxmail.com wrote:
> From: Pei Xiao <xiaopei01@kylinos.cn>
>
> sparse warnings:
> sparse: incorrect type in return expression, expected void
> [noderef] __iomem *, got void *
>
> Fix sparse warnings by use IOMEM_ERR_PTR
>
> Fixes: da7c07b10838 ("driver core: Provide stubs for !IOMEM builds")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501221439.YoPUrrqD-lkp@intel.com/
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> ---
> include/linux/device.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 667cb6db9019..d76c31b9f9b9 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -378,14 +378,14 @@ static inline
> void __iomem *devm_ioremap_resource(struct device *dev,
> const struct resource *res)
> {
> - return ERR_PTR(-EINVAL);
> + return IOMEM_ERR_PTR(-EINVAL);
> }
>
> static inline
> void __iomem *devm_ioremap_resource_wc(struct device *dev,
> const struct resource *res)
> {
> - return ERR_PTR(-EINVAL);
> + return IOMEM_ERR_PTR(-EINVAL);
> }
>
> static inline
> @@ -393,7 +393,7 @@ void __iomem *devm_of_iomap(struct device *dev,
> struct device_node *node, int index,
> resource_size_t *size)
> {
> - return ERR_PTR(-EINVAL);
> + return IOMEM_ERR_PTR(-EINVAL);
> }
>
> #endif
> --
> 2.25.1
As the 0-day bot points out, this breaks the build all over the place,
so I'm going to drop it from my trees. Please test-build your code with
the targets that it reported having problems with before submitting it
again.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-21 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22 7:35 [PATCH] driver core: device.h: fix incorrect type in return expression xiaopeitux
2025-02-21 8:20 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.