[PATCH V2] accel/amdxdna: Fix incorrect type used for a local variable

Lizhi Hou posted 1 patch 1 month, 1 week ago
drivers/accel/amdxdna/aie2_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH V2] accel/amdxdna: Fix incorrect type used for a local variable
Posted by Lizhi Hou 1 month, 1 week ago
drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces)

Fixes: c8cea4371e5e ("accel/amdxdna: Add a function to walk hardware contexts")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508230855.0b9efFl6-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/aie2_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 16ac0cab4f44..7a3449541107 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -785,8 +785,9 @@ static int aie2_get_clock_metadata(struct amdxdna_client *client,
 
 static int aie2_hwctx_status_cb(struct amdxdna_hwctx *hwctx, void *arg)
 {
-	struct amdxdna_drm_query_hwctx __user *buf, *tmp __free(kfree) = NULL;
+	struct amdxdna_drm_query_hwctx *tmp __free(kfree) = NULL;
 	struct amdxdna_drm_get_info *get_info_args = arg;
+	struct amdxdna_drm_query_hwctx __user *buf;
 
 	if (get_info_args->buffer_size < sizeof(*tmp))
 		return -EINVAL;
-- 
2.34.1
Re: [PATCH V2] accel/amdxdna: Fix incorrect type used for a local variable
Posted by Mario Limonciello 1 month, 1 week ago
On 8/26/2025 12:19 PM, Lizhi Hou wrote:
> drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces)
> 
> Fixes: c8cea4371e5e ("accel/amdxdna: Add a function to walk hardware contexts")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508230855.0b9efFl6-lkp@intel.com/
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
>   drivers/accel/amdxdna/aie2_pci.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
> index 16ac0cab4f44..7a3449541107 100644
> --- a/drivers/accel/amdxdna/aie2_pci.c
> +++ b/drivers/accel/amdxdna/aie2_pci.c
> @@ -785,8 +785,9 @@ static int aie2_get_clock_metadata(struct amdxdna_client *client,
>   
>   static int aie2_hwctx_status_cb(struct amdxdna_hwctx *hwctx, void *arg)
>   {
> -	struct amdxdna_drm_query_hwctx __user *buf, *tmp __free(kfree) = NULL;
> +	struct amdxdna_drm_query_hwctx *tmp __free(kfree) = NULL;
>   	struct amdxdna_drm_get_info *get_info_args = arg;
> +	struct amdxdna_drm_query_hwctx __user *buf;
>   
>   	if (get_info_args->buffer_size < sizeof(*tmp))
>   		return -EINVAL;